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

Abundant Music: An online procedural music generator

This might be a very good place to start looking for information regarding that subject. You might also want to consider generating the midi files yourself and replaying them, but that also will take research.