Sketch for MIDI in to control Tone Function

There are lots of projects that take in MIDI and do things like light LEDs. Just take that code and modify it to turn on and off the tone generator instead of the LED.
Here is one of mine:-
http://www.thebox.myzen.co.uk/Hardware/Glockenspiel.html
You need to learn about arrays.
http://www.thebox.myzen.co.uk/Tutorial/Arrays.html