如何设置MIDI声像?
谁能建议我如何设置 MIDI 声音的平移。我正在使用java MIDI合成并且可以使其发声。但我希望声音从左扬声器平移到右扬声器。我谷歌了一下,但我似乎不太清楚?这是我正在处理的代码示例:
Synthesizer synthesizer = MidiSystem.getSynthesizer();
synthesizer.open();
MidiChannel channel = synthesizer.getChannels()[0];
Soundbank soundbank = synthesizer.getDefaultSoundbank();
synthesizer.loadAllInstruments(soundbank);
channel.programChange(0,instrument);
channel.noteOn(60,200);`
我非常感谢您的帮助。 非常感谢!
Can anyone please suggest me how to set panning for a MIDI sound. I am using java MIDI synthesis and can make it sound. But I want the sound to pan from left to right speakers. I did google but it seemed not to clear to me much? Here the example of code I am working on:
Synthesizer synthesizer = MidiSystem.getSynthesizer();
synthesizer.open();
MidiChannel channel = synthesizer.getChannels()[0];
Soundbank soundbank = synthesizer.getDefaultSoundbank();
synthesizer.loadAllInstruments(soundbank);
channel.programChange(0,instrument);
channel.noteOn(60,200);`
I am very grateful for any help.
Thanks much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 MIDI 规范,平移由 Control Change 消息编号 10 控制。这是“粗略”值(7 位精度),但显然“精细”14 位版本(控制更改 42)是 可能会被真实设备忽略。
知道了这一点,您应该能够使用 JavaSound MidiChannel API 控制平移:
According to the MIDI spec, panning is controlled by Control Change message number 10. This is the "coarse" value (7 bits of precision) but apparently the "fine" 14-bit version (control change 42) is likely to be ignored by real devices.
Knowing this, you should be able to use the
controlChange(int, int)
method in the JavaSound MidiChannel API to control your panning: