Your landlord cannot tell you how to live, and he cannot interfere with your right to use and enjoy the apartment the way you see fit. If your lease does not prohibit music, then you can play music.
Of course, this comes with a caution: you can't play your music in such a way that it interferes with anyone else either. If you're causing noise disturbances to other tenants or other people where you live, then your music is too loud.
DISCLAIMER: Brandy A. Peeples is licensed to practice law in the State of Maryland. This answer is being provided for informational purposes only and the laws of your jurisdiction may differ. This answer based on general legal principles and is not intended for the purpose of providing specific legal advice or opinions. Under no circumstances does this answer constitute the establishment of an attorney-client relationship. For legal advice relating to your specific situation, I strongly urge you to consult with an attorney in your area. NO COMMUNICATIONS WITH ME ARE TO BE CONSTRUED AS ARISING FROM AN ATTORNEY-CLIENT RELATIONSHIP AND NO ATTORNEY-CLIENT RELATIONSHIP WILL BE ESTABLISHED WITH ME UNLESS I HAVE EXPRESSLY AGREED TO UNDERTAKE YOUR REPRESENTATION, WHICH INCLUDES THE EXECUTION OF A WRITTEN AGREEMENT OF RETAINER.
The landlord is probably making up this rule due to complaints from a hypersensitive neighbor (does your landlord have an apartment by yours?). I agree with the prior attorney's answer and add that you only need to be reasonable as to when and how loudly you play your music. While you should try to accommodate your neighbors, there is no reason for you to subordinate your life to the needs of a hypersensitive one.
What does your lease say?
My answer is for general purposes only and is not not intended to establish an attorney-client relationship, nor is it advice upon which you should act or rely. But, if you really want me to tell you something upon which you can actually rely: don't eat yellow snow.
Dear Brooklyn Tenant:
Your lease may directly address this subject and you did not mention if the music is from you playing an instrument or radio, TV, or other media.
On top of all lease provisions dealing with noise, instrument playing, music playing, loud sounds, is also imposed the new New York City Noise Code, local zoning that may impact on use of a residential apartment in certain neighborhoods for rehearsals, music teaching and at home performances.
You must know what you did to have the landlord approach you, and so, if you believe that your tenancy rights are violated by the landlord prohibiting lawful conduct and reasonable use of the apartment you should consult with an attorney.
The answer provided to you is in the nature of general information. The general proposition being that you should try to avoid a bad outcome if you can.