Sample code for playing a note in MIDI and changing the volume.

Not sure if it works as is, I have no way to try. :)