Skip to content

Commit

Permalink
mid转换器改为提示用户输入文件名
Browse files Browse the repository at this point in the history
  • Loading branch information
diylxy committed Oct 5, 2023
1 parent 00ab769 commit a6e2893
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/midi/midi_process.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import mido
import time

midi_to_freq=[
16,
Expand Down Expand Up @@ -130,7 +129,8 @@
22350,
23679,
25087]
mid = mido.MidiFile('/home/lxy/献给爱丽丝.mid')
filename = input("请输入文件名")
mid = mido.MidiFile(filename)
channel = 0

tempo = 500000
Expand Down Expand Up @@ -172,7 +172,7 @@
2字节:频率
2字节:时间
"""
with open('献给爱丽丝.buz', 'wb') as f:
with open(filename.replace(".mid", ".buz").replace(".midi", ".buz"), 'wb') as f:
for i in range(len(music)):
if i == 0 and music[i]['freq'] == 0:
continue
Expand Down

0 comments on commit a6e2893

Please sign in to comment.