Not an ultimate question at all.
It depends on the Music you are listening to, generally you can listen to music that is about God and the Prophets or religious music. The instruments should be not more the Duf (thin drum).
As for rap and rock, due to its contents it makes its highly disliked - makruh. especially when people talk of killing or hurting etc. Music can influence a person in a negative way.
One golden rule to remember is what you are not allowed to do, you should not listen to.
I hope this helps