Hip hop and rap beats normally consist of heavy doses of bass and percussion, but many iconic rap songs also make use of other instruments, like the piano. Just listen to "Goldmine" by Busta Rhymes, "If I Can't" by 50 Cent and "Dead Presidents" by Jay Z. A piano can set the right mood for a hip-hop song when other instrument fails. You can make your own piano-based beats at home.
Listen to rap piano beats for inspiration, and try playing the beats on your piano (or other musical keyboard) to gain a feel for how other rap artists use the piano in their own music. Listen to songs like 2 Pac's "I Ain't Mad At Cha," The Game's "Hard Liquor" and Biz Markie's "Just a Friend." If some songs are too difficult for you to play by ear, focus on the basic tempo and arrangement, and gain a feel for how the piano melodies complement the vocals.
Find your notes. If you have experience playing piano, begin forming chords and note patterns until you find the right mood for your song. If you have little or no experience with piano, try experimenting with different keys, individually and in groups, to find something appealing. You can form chords by playing groups of keys. For instance, by playing the "C" key, the "E" key and "G" key simultaneously, you can play a "C Major" chord.
Construct melodies by playing sequences of chords, such as C-G-F, or C-A-G. If you have experience playing piano or keyboards, you should already understand the process of constructing melodies. If you have limited experience, you can learn by trying to emulate existing songs and by experimenting with different note patterns. For a two-handed approach, play full chords (as described in the previous step) using your left hand, while using your right hand to play scales (sequences of individual notes within the same key). As an alternative, you can play individual notes with your left hand (providing bass) while playing scales with your right hand (providing melody).
Record your beat. Open your program, set up a new recording project and create a recording track for your piano beat. A recording track will look like a horizontal bar, and it serves as a layer of music, meaning that you can add other instruments (like bass and percussion) later. Just find the "New Track" option on your menu bar, select it once, click "Record" and begin recording your piano melody. If your program supports multi-tracking, you will always find the "New Track" option (sometimes labeled "Create Track" or "Add Track") on the menu bar or on a tool bar.
Free audio recording programs include Audacity, QTractor and Linux Multimedia Studio. Retail programs include GarageBand, FL Studio, Logic and Cubase.
For better recording quality, try to record directly into your computer, rather than simply playing the piano and using your computer microphone to pick up the sound. For a direct connection, connect a MIDI keyboard to your computer (any digital music keyboard will suffice), using a MIDI cable and MIDI USB adapter. If using a live piano, connect a professional XLR microphone to your computer and set the mic directly beside the piano for improved quality. If you must, you can record live piano using your computer microphone, but again, the quality will not sound as good.