Reading a MIDI file in Python

后端 未结 6 2509
被撕碎了的回忆
被撕碎了的回忆 2021-02-20 06:26

I want to be able to read events from a MIDI file in Python. I have looked for libraries, but can\'t find one that works with my MIDI file in windows. I do not need to do anythi

6条回答
  •  天命终不由人
    2021-02-20 06:49

    the structure of a midi file is quite simple. if you can't find a ready-made library (i am not aware of any) and you only need events and time, i suggest you try parsing the file yourself.

    (prepare for a lot of bit shifting: MIDI data are stored in strings of 7 bits blocks)

    also, you say that you can't find a library which works with your MIDI file on Windows: MIDI file are supposed to be portable, and python too, so a un*x lib should work equally well on windows (or the developper missed the point of both MIDI and python).

提交回复
热议问题