Javaを使ってbpmや音量などを設定できるメトロノーム(木版楽器)を自作しようと思っています。入手した16チャンネル以上(MIDI 1.0仕様)を試してみましgetChannels()
たが、木版が全く聞こえません。
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);
これについて何か知っている人はいますか?ありがとう。