这就是我所拥有的:
// Note on message
ShortMessage noteOnMessage = new ShortMessage();
noteOnMessage.setMessage(ShortMessage.NOTE_ON, chanNum, key, velocity);
// Pan change
ShortMessage panChangeMessage = new ShortMessage();
panChangeMessage.setMessage(ShortMessage.CONTROL_CHANGE, chanNum, SoundManager.PAN_CONTROLLER, pan);
// Note off message
ShortMessage noteOffMessage = new ShortMessage();
noteOffMessage.setMessage(ShortMessage.NOTE_OFF, chanNum, key, 0);
问题在于,添加到轨道时的panChangeMessage会更改MidiEvent节拍中所有音符的声音,而不仅仅是当前单个音符。有没有办法改变只有1个音符的声音?
答案 0 :(得分:1)
你不能。
平移通道,然后在触发音符关闭后将其平移。请记住,任何衰变都将被淘汰。
或者,使用多个midi频道,每个频道对应您需要的复音音符。