用于从 USB MIDI 设备读取 MIDI 信号的 C/C++ 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3231/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C/C++ library for reading MIDI signals from a USB MIDI device
提问by David
I want to write C/C++ programs that take input from a MIDI device.
我想编写从 MIDI 设备获取输入的 C/C++ 程序。
The MIDI device connects to my PC using a USB connector.
MIDI 设备使用 USB 连接器连接到我的 PC。
I'm looking for a (C/C++ implemented) library that I can use to read the MIDI signals from the MIDI device through the USB port.
我正在寻找一个(C/C++ 实现的)库,我可以用它来通过 USB 端口从 MIDI 设备读取 MIDI 信号。
I'm happy manipulating the MIDI data once I get it, I just don't want to have to implement the code for its capture.
一旦我得到它,我很高兴操纵 MIDI 数据,我只是不想实现它的捕获代码。
I'm planning on writing my code using the Bloodshed Dev-C++ IDE on Windows XP.
我计划在 Windows XP 上使用 Bloodshed Dev-C++ IDE 编写我的代码。
采纳答案by sean e
PortMidiis another open source cross-platform MIDI I/O library worth checking out. On the other hand, if you are working on a sysex type of app, then direct Win32 works easily enough.
PortMidi是另一个值得一试的开源跨平台 MIDI I/O 库。另一方面,如果您正在开发一种 sysex 类型的应用程序,那么直接 Win32 就足够轻松了。
Just came across another open source cross-platform framework that includes MIDI support: Juce.
刚刚遇到另一个包含 MIDI 支持的开源跨平台框架:Juce。
Also, I should note that there isn't anything special about a USB connected MIDI device. It will still be presented as a MIDI device in Windows and you will use standard MIDI APIs (mmsystem) to communicate with it.
另外,我应该注意到 USB 连接的 MIDI 设备没有什么特别之处。它仍将在 Windows 中显示为 MIDI 设备,您将使用标准 MIDI API (mmsystem) 与其进行通信。
[July 2014] I just came across RtMidithat looks to be a nice, compact, open source cross-platform C++ library.
[2014 年 7 月] 我刚刚发现RtMidi,它看起来是一个不错的、紧凑的、开源的跨平台 C++ 库。
回答by andrewrk
Check out the open source project LMMS. It's a music studio for Linux that includes the ability to use MIDI keyboards with software instruments. If you dig around in source fileswith 'midi' in the name, you'll probably find what you're looking for.
查看开源项目LMMS。它是一个 Linux 音乐工作室,包括将 MIDI 键盘与软件乐器一起使用的能力。如果您在名称中带有 'midi' 的源文件中搜索,您可能会找到您要查找的内容。