用于创建游戏的 Midi C 库
我正在用 C 创建一个简单的基于 midi 的游戏,我想知道是否有任何库可以加载 midi 文件、播放并通过获取音符值来操作它。
提前致谢!
I'm creating a simple midi based game in C and I am wondering if there are any libraries to load a midi file, play and also manipulate it by getting the note values.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检查 SDL。更具体地说,SDL_mixer。
Check SDL. More especifically, SDL_mixer.
如果您想操纵 MIDI 并自己处理其内容而不仅仅是播放它,
SDL_Mixer
可能不是您想要的。在这种情况下,我只需阅读规范并编写您自己的代码。 MIDI 是一种极其简单的格式,您可能可以在 15 分钟左右编写出您需要的任何代码...:-)If you want to manipulate the MIDI and process its contents yourself rather than just playing it,
SDL_Mixer
might not be what you want. In this case I would just read the spec and write your own code. MIDI is an extremely simple format and you can probably write whatever code you need in 15 minutes or so... :-)我意识到这个问题已经得到了解答,但我必须同意@R..,因为 SDL 对于您想要做的事情来说可能有点过分了。您还应该看看 jdksmidi,这是一个用 C++ 编写的小得多的 MIDI 库。
I realize this question has already been answered, but I would have to agree with @R.. in that SDL is probably overkill for what you are trying to do. You should also take a look at jdksmidi, a much smaller MIDI library written in C++.