I'm planning to create my own metronome (woodblock instrument) using Java that could set its bpm, volume, etc. And I have tried over 16 channels (MIDI 1.0 specification) obtained from getChannels()
but there is no woodblock heard at all.
Here's the code taken from http://www.jsresources.org
/*
* Turn the note on on MIDI channel 1.
* (Index zero means MIDI channel 1)
*/
MidiChannel[] channels = synth.getChannels();
channels[0].noteOn(nNoteNumber, nVelocity);
/*
* Wait for the specified amount of time
* (the duration of the note).
*/
try
{
Thread.sleep(nDuration);
}
catch (InterruptedException e)
{
}
/*
* Turn the note off.
*/
channels[0].noteOff(nNoteNumber);
Anyone got anything about this? thanks.