Java sound manipulation

I want to make a music making program in pure java. The way I want to do this is basically having a bunch of instruments that all can play on different keys of a piano. I guess that I would have to use midi files but how can I implement midi file opening and playing in java. And how can I change the sound(instrument) output of the midi.

Anything would help, pure java if possible but if not it’s okay