如何使用 C++ 在 Ubuntu 中连接到 ALSA 服务器(在本例中为 Timidity)?
我正在尝试在 Linux Ubuntu 下使用 C++ 来使用 MIDI。经过一天使用多种工具(例如 JACK)但没有成功(JACK 在我的机器上疯狂滞后)后,我现在尝试使用 Timidity 作为 MIDI 服务器。但是,我在网上找不到任何有关如何使用 C++ 以编程方式连接到 Timidity 的参考资料。有办法做到这一点吗?
感谢您的任何建议!
注释:
我尝试使用以下内容搜索谷歌:
alsa server connect
timidity connect program
但没有答案。
I am trying to use MIDI under Linux Ubuntu with C++. After a day of using several tools (e.g., JACK) with no success (JACK lags like mad on my machine), I am now trying to use Timidity as the MIDI server. However, I am not able to find any references on the web about how to programmatically connect to Timidity using C++. Is there anyway to do this?
Thanks for any suggestions!
Notes:
I've tried search google with the following:
alsa server connect
timidity connect program
But no answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 RtMidi 库。它是跨平台的(Win、OS X、Linux、SGI),用 C++ 编写,易于编译并包含在您的项目中。
然后启动 Timidity 作为服务器(Ubuntu 为此提供了一个初始化脚本),这将为 Timidity 创建多个 ALSA 定序器客户端端口。打开这些端口之一作为 RtMidi 中的输出并开始发送 MIDI 消息。
Have a look at the RtMidi library. It is cross-platform (Win, OS X, Linux, SGI), written in C++ and easy to compile and include in your project.
Then start Timidity as a server (Ubuntu includes an init script for this), which will create several ALSA sequencer client ports for Timidity. Open one of these ports as an output in RtMidi and start sending midi messages.
使用 ALSA 音序器方法创建 MIDI 消息。
C 库的文档位于:http://www. alsa-project.org/alsa-doc/alsa-lib/group___sequencer.html
use the ALSA sequencer methods to create MIDI messages.
the documentation for the C library is here: http://www.alsa-project.org/alsa-doc/alsa-lib/group___sequencer.html