Music isn't the worst thing in the world... if you're not on a meditation course, listening to music isn't a big deal, just be mindful of your feelings when listening. If that is your biggest attachment, you should count yourself lucky
If you really want to go to the next level, you have to change your lifestyle; this is why the Buddha differentiated between ordinary precepts (5, no prohibition against music) and meditator precepts (8, prohibition against all forms of entertainment).
So, to answer your question directly, you can't. As long as music is a big part of your life, you'll probably lose your attachment to it. You have to change your life if you want to be free from that attachment, I should think.