【发布时间】:2009-10-25 14:38:50
【问题描述】:
我打算使用 Java 创建自己的节拍器(木版乐器),可以设置它的 bpm、音量等。我已经尝试了从 getChannels() 获得的超过 16 个通道(MIDI 1.0 规范),但没有木版完全听过。
这是来自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);
有人对此有所了解吗?谢谢。
【问题讨论】: