Note that the author of this guide is not an attorney and is providing information on copyright only. Nothing on this site should be taken as legal advice. For legal advice, please see an attorney.
Music is complicated when it comes to copyright as there are often multiple copyrights involved. For instance, a composition can be copyrighted by a composer then a performer can copyright a performance of the piece. If the performance is used in a larger work such as a movie, that will be copyrighted as well and may influence how a recording can be used. Add to that that music companies tend to be diligent in trolling the web for the use of their copyrighted work even in the background of other works and music becomes a minefield.
Printed music follows the length of copyright term of everything else - a definite plus for classical music fans! However, new copyrights can come into play if a piece that is out of copyright is edited enough to warrant a new copyright. Hense, if I rearrange Mozart's Jupiter Symphony a bit by adding some dynamics and other interpretation marks and perhaps changing the instrumentation slighly, I could possibly copyright my version of Mozart's Jupiter Symphony. (Mozart's Jupiter Symphony was written in 1788 so it has been copyright free for a very long time.)
Remember that copyright protects the right not only to copying printed music but to performing it. Public performance rights are one of the rights granted to the copyright owner. That means that when I start my new band, I will need to get permission to perform any work that is still copyrighted. To get permission, I will probably have to pay to use it. SDSU's music department pays a general license every year that covers the band, orchestra, choir, and solo performances. When the drama department puts on their wonderful musicals, they pay royalties when they rent the scores and scripts. SDSU's licenses wouldn't cover the band I put together unless I do it under the direction of the music department.
Recorded music is mostly copyrighted as the ability to record music comercially is not much older than the current copyright terms. There is a fair amount of music that has fallen into the public domain but identifying it is very difficult because there was a period where copyright terms were fairly short but could be renewed. Determining if something was renewed or not can be difficult so it is safest to assume that the recording you want to use is copyrighted.
Using music in class is guided by the "Guidelines for Educational Uses of Music". It is also goverened by fair use so be sure to consult both the guidelines and fair use to determine if you can do what you want in your class.
Playing music in public is another matter. Whether the music is broadcast over the internet or a radio station, played at a large party by a DJ (or just a host of the party), or it is playing in the background as you record for YouTube your increadibly cute and precocious 2 year old dancing to a song, it is a public performance. Radio stations and professional DJs pay licenses to play music in public. They also have to keep detailed records of what they play and when. YouTube can remove your video no matter how cute and precocious your kid is if the owner of the music copyright asks them to or they can be asked to put advertisements on your video and the income from the ads will go to the copyright owner. Your parties without a DJ are likely to be fairly safe unless they are large and J. Lo happens to come and hear you playing one of her songs (or you make your knowledgeable next-door neighbor really mad at you).
One note - a recorded piece of music can be copyrighted even if the piece itself is in the public domain. So, if the SDSU Symphony plays a copyright-free version of Mozart's Jupiter Symphony, their recording can itself be copyrighted. Although others could still play the piece, the actual recording of them playing it would have to be done with their permission.
Use this form to search for music that is licensed for reuse with creative commons licenses. Please be aware that not everything this search comes up with will have a creative commons license so please check for the license graphic or text before you use a music file. There are a number of search engines you can use with this form - the "Search using" box allows you to choose what search engine you will use.
This image indicates that the work must be attributed to the creator.
This image indicates that the work must be attributed to the creator and no derivitive works can be made from it.
This image indicates that the work must be attributed to the creator, the work cannot be used commercially and any derivitives created must be shared with the same license.
This image indicates that the work must be attributed to the creator and, if you make changes, you must share it with the same license.
This image indicates that the work must be attributed to the creator and it cannot be used commercially.
This image indicates taht the work must be attributed to the creator, it cannot be used commerically, and no derivitive works can be made from it.