开源 MIDI 库
我想了解可用于对 MIDI 文件执行一些简单任务的开源库:
- 一次读取一个音符或和弦的文件;
- 提取给定的乐器以将其单独重新编码到新文件中;
- 允许生成“可定制”乐谱——我的意思是我应该能够使用库改变从 midi 生成乐谱的方式...我认为这需要与 Lilypond 或 Musixtex 进行交互。
我确实没有首选语言,只要使应用程序跨平台不是太痛苦即可。欢迎其他建议——现在学习比我已经写了很多代码更好。到目前为止,我一直在尝试挖掘 MuseScore 的(C++)源代码,但似乎 GUI 代码渗透到大多数文件中,虽然发现相关文件很容易,但我很难提取我需要的内容(我是目前仅针对命令行应用程序,稍后我将了解接口)。
有什么想法吗?
谢谢!
I would like to know about open source libraries that could be used to perform some simple tasks on MIDI files:
- reading a file one note - or chord - at a time;
- extracting a given instrument to re-encode it separately in a new file;
- allow to produce a "customizable" score -- by that I mean that I should be able to alter the way the sheet music is produced from the midi using the libraries ... I assume this will require an interaction with Lilypond or Musixtex.
I don't really have a preferred language, as long as it is not too painful to make the app cross-platform. Other advice is welcome -- better to learn it now rather than when I've already written a lot of code. So far, I've been trying to dig in MuseScore's (C++) source code, but it seems that GUI code permeates most files and although spotting relevant files was easy, it is difficult for me to extract just what I need (I'm only aiming for a command line application right now, I'll see about interfaces later).
Any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我才刚刚开始,但是 这(Python 中)似乎很有希望。
Well, I'm just getting started, but this (in Python) seems promising.
如果您仍在从事该项目并且语言不是问题,您可以尝试 Python 的跨平台 music21< /a> 它可以将 MIDI 文件解析为音符、和弦、乐器等对象,让您可以操纵乐谱,然后 R/T 回 MIDI 或输出到 Lilypond 等(完全公开,我是作者工具包的一部分;但我不知道有多少其他语言可以将 MIDI 引入而将 Lilypond 排除,同时让您有机会将 MIDI 元素视为对象进行操作。)。
用于将 MIDI 文件中的所有乐器声音搞乱,然后播放它并从中制作 lilypond.pdf 的示例代码:
希望有帮助。
If you're still working on the project and language isn't a problem, you might try Python's cross-platform music21 which can parse midi files into Note, Chord, Instrument, etc., objects, lets you manipulate the scores, and then R/T back to MIDI or output to Lilypond, etc. (full disclosure, I'm the author of the toolkit; but I don't know of many others in any language that will take MIDI in and put Lilypond out while giving you a chance to treat the MIDI elements as objects to manipulate in the meantime.).
Sample code to screw up all the instrument sounds in a MIDI file and then play it and make a lilypond.pdf from it:
Hope that helps.