简体   繁体   English

从python中的任意MIDI文件生成MIDI编号序列

[英]Generating a sequence of MIDI numbers from an arbitrary MIDI file in python

I'm in the process of creating an app that reads a sheet and then generates a sequence of piano keys to be pressed in order for the sheet to be "played". 我正在创建一个应用程序,该应用程序读取一张纸,然后生成一系列要按的钢琴键,以便“播放”该纸。 I managed to get the MusicXML or MIDI file for my sheets. 我设法为我的床单获取了MusicXML或MIDI文件。 MIDI format is exactly what I need since there's a one to one correspondence between a MIDI number and a key on the piano (according to http://newt.phys.unsw.edu.au/jw/notes.html ) and it simpler than mapping each note of in the MusicXML file to a key. MIDI格式正是我需要的格式,因为MIDI编号和钢琴上的键之间存在一对一的对应关系(根据http://newt.phys.unsw.edu.au/jw/notes.html ),而且更简单而不是将MusicXML文件中的每个音符映射到一个键。 However I cannot access MIDI numbers themselves and MIDI editors (like MuseScore) only show the notation not the actual numbers. 但是,我本身无法访问MIDI数字,并且MIDI编辑器(如MuseScore)仅显示表示法,而不显示实际数字。 Is there a way to generate the sequence of MIDI numbers for a MIDI file in python? 有没有一种方法可以为python中的MIDI文件生成MIDI编号序列?

you can use the python-midi library ( https://github.com/vishnubob/python-midi ) to parse a midi file and access the midi-data 您可以使用python-midi库( https://github.com/vishnubob/python-midi )来解析midi文件并访问midi数据

have a look at the midi-dump script (in the script folder) 看一下midi-dump脚本(在script文件夹中)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM