If you plan to sell or distribute music that contains a sample, you must acquire permission from the artist as well as those who own the rights to the recording (i.e Vivendi, Warner, etc).
If you plan to remake the music yourself, either in part or as a whole, and you plan to distribute it WHETHER YOU SELL THE PRODUCT OR NOT you need to contact the Harry Fox Agency
http://www.harryfox.com/index.jsp to discuss and determine what mechanical rights are involved. The only way to bypass this is to directly negotiate with the "publishers" of the music.
The Publisher owns the right to the song and/or parts of the songs. They can determine, for example, if they want a phrase from their song to be used as a central part of a hip-hop song or not.
Let's look at two examples.
1. You have a line in your song that repeats "Party like it's 1999". You give this song away for FREE, but without the Publisher's permission or licensing. Prince can come back and sue you for damages, and if he don't Warner Brothers will.
2. You include the "famous" five notes from Close Encounters of the Third Kind in a song. Again you distribute this for FREE without permission. You can be sued by the holder of the rights to that song. Likely this is some bigger entity than John Williams.
If you think that they won't or can't find out, trust me when I say that they have bots that scour the Internet on sites such as Google looking for the very thing that I just mentioned. This does not mean that you WILL get caught. But if someone turned you in, it is guaranteed.
A local club just got shut down because they held Karaoke and did not pay ASCAP royalties. I have never heard of a club that ACTUALLY paid royalties, but someone busted on this club and it got shut down and only reopened with piped in music. They won't even do a live band.
Solo