VST 乐器多路输入和输出
我想创建一个具有 16 个 MIDI 输入和至少 16 个音频输出的 VST 乐器。类似于 kontakt 或 halion 的做法。
有什么想法吗?
I want to create a VST instrument that has 16 MIDI inputs and at least 16 audio outputs. Similar to how kontakt or halion do this.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 @leftaroundabout 所指出的,您不太可能需要 16 个输入和输出,尤其是对于仪器而言。然而,对于鼓机和其他多轨乐器来说,拥有 16 个 MIDI 输入和 16 个音频输出是很常见的,用户可能希望单独处理每个声音。一般来说,音频输入对于整个乐器来说并不是特别有用。
也就是说,您只需像这样实例化您的插件:
这就是您的起点。然而,由于绝大多数插件只是立体声,因此您需要做很多其他工作才能让主机为您提供 16 个输出通道(假设它支持)。您可能需要在某些时候调用
getSpeakerArrangement()
和setSpeakerArrangement()
,并覆盖getOutputProperties()
。至于 MIDI 通道,主机不应以与正常情况不同的方式对待它们。您将以
VstMidiEvent
的形式收到常规 MIDI 事件,其中包含常规 MIDI 数据(即,如果用户选择,则适用于所有 16 个通道)。这是简单的部分——设置输出就是诀窍。As @leftaroundabout noted, it's unlikely that you need 16 inputs and outputs, especially for an instrument. However, having 16 MIDI inputs and 16 audio outputs is very common for drum machines and other multitracked instruments where the user might want to process each voice individually. Audio inputs in general are not particularly useful for instruments as a whole.
That said, you simply instantiate your plugin like so:
That's your starting point. However, since the vast majority of plugins are stereo only, there is a bunch of other work you will need to do to get the host to deliver you 16 output channels (assuming it supports it). You will likely need to call
getSpeakerArrangement()
andsetSpeakerArrangement()
at some point, and also overridegetOutputProperties()
.As for the MIDI channels, the host should not treat them any differently than normal. You will be delivered regular MIDI events, in the form of
VstMidiEvent
s which will contain regular MIDI data (ie, for all 16 channels if the user so chooses). This is the easy part -- it's getting the outputs set up that's the trick.