如何将控制器连接到软件合成器?
我已经构建了一个软件。我想通过 MIDI 控制器(例如键盘)来控制它。如何使用 ALSA 等将 MIDI 数据从 MIDI 端口传输到我的软件?我正在使用Linux。
I've built a software. I want to control it via a MIDI controller (e.g. keyboard). How do I get the MIDI data from the MIDI port to my software using e.g. ALSA? I'm using Linux.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ttymidi 将充当 ALSA 设备并打印输出或从文件读取输入。预期用途是该文件是串行设备,但 /dev/stdout 也可以工作——然后可以将其通过管道传输到程序。如果您想自己编写设备代码,ttymidi 代码可能比 timidity 更简单,因此您可以使用它作为示例。
ttymidi will act as an ALSA device and print output or read input from a file. The intended use is that this file is a serial device, but /dev/stdout also works -- this can then be piped to the program. If you want to code the device yourself, the ttymidi code is probably simpler than say timidity, so you can use that as an example.
使用 asoundlib。这为您提供了结构化对象而不是二进制数据的 MIDI 事件。
Use asoundlib. This gives you MIDI events as structured objects rather than binary data.