How to connect to ALSA server (in this case, Timidity) in Ubuntu using C++?

给你一囗甜甜゛ 提交于 2019-12-11 07:34:20

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/8330846/how-to-connect-to-alsa-server-in-this-case-timidity-in-ubuntu-using-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!