Both the classic series and X series have their highs and downs. Here's my opinion:
X1, X4 and X6 have some of the best soundtracks in the X series, X6 is not really that good of a game, but the soundtrack still is incredible.
X2 has some good tunes, even though the loop is a bit in the short side.
X3 is a mixed bag, I really like some like Gravity Beetle/Toxic Seahorse/Doppler Stage 1, but at least half (or maybe more than half) of the soundtrack is quite dreadful.
X5 has musics like Squid Adler/Izzy Glow/Axle the Red/Virus Stage 1 and 2 which I find really catchy and memorable, overall a pretty decent soundtrack.
X7 is the worst in every sense, including the soundtrack, the boss theme is probably the most decent.
X8 has a different style to it, but the more you listen the more it becomes catchy, also a better game than X7.
I could do the same for the classic series, but will leave at that.