openvpi / SOME

SOME: Singing-Oriented MIDI Extractor.
MIT License
430 stars 41 forks source link

集成mido包 #12

Closed lightenthrive closed 7 months ago

lightenthrive commented 7 months ago

直接测量tempo速度,就省事了。 gpt给的代码示例如下。

import mido

mid = mido.MidiFile('yourfile.mid')

for i, track in enumerate(mid.tracks): for msg in track: if msg.type == 'set_tempo': print(f'Track {i}: Tempo: {msg.tempo}')

yqzhishen commented 7 months ago

大哥,李在赣神魔?我这个项目就是用来提取MIDI的,结果你告诉我还得输入一个MIDI才能用?