I'm wondering if rap/hip-hop music is composed of using a musical instrument like a piano and writing down notes on sheet music?
Rap, as well as rock and pop, are composed in almost as many ways as there are people.
Some will compose in front of a piano and write sheet music, sure, but traditionally this was not the case. Rap came from the streets, with artists laying down backing from records they owned and rhyming or singing over the top. And there are still numerous artists who work this way, only with a huge amount of samples and digitised music as well as records.
There are a fair few big name artists, however, who approach this in a very academic way, with composition first on paper (or electronic equivalent) and layering in a DAW only after the original concept is fully developed.