I think you should use the Fast Fourier Transform (a library) to split music signal into required frequency ranges.