mirror of
https://github.com/FireEmblemUniverse/fireemblem8u.git
synced 2024-11-23 13:19:53 +00:00
Add script to omit volume 127 at the start of track for MML compatible mode and use it to match song701.
This commit is contained in:
parent
b34d847e0b
commit
9136b88c12
21
scripts/omit_volume_127.py
Normal file
21
scripts/omit_volume_127.py
Normal file
@ -0,0 +1,21 @@
|
||||
import py_midicsv as pm
|
||||
import sys
|
||||
|
||||
for song in sys.argv[1:]:
|
||||
data = pm.midi_to_csv(f'sound/songs/midi/{song}.mid')
|
||||
|
||||
for i in range(len(data)):
|
||||
line = data[i]
|
||||
|
||||
start_track = False
|
||||
if 'Start_track' in line:
|
||||
start_track = True
|
||||
if 'Control_c' in line and line[-4:] == '127\n':
|
||||
data[i] = ''
|
||||
start_track = False
|
||||
|
||||
midi_object = pm.csv_to_midi(data)
|
||||
|
||||
with open(f'sound/songs/midi/{song}.mid', "wb") as output_file:
|
||||
midi_writer = pm.FileWriter(output_file)
|
||||
midi_writer.write(midi_object)
|
2
songs.mk
2
songs.mk
@ -1364,7 +1364,7 @@ $(MID_SUBDIR)/song700.s: %.s: %.mid
|
||||
$(MID2AGB) $< $@ -E -G036 -P020 -V100 -M
|
||||
|
||||
$(MID_SUBDIR)/song701.s: %.s: %.mid
|
||||
$(MID2AGB) $< $@ -E -G036 -P020 -V127
|
||||
$(MID2AGB) $< $@ -E -G036 -P020 -V127 -M
|
||||
|
||||
$(MID_SUBDIR)/song702.s: %.s: %.mid
|
||||
$(MID2AGB) $< $@ -E -G036 -P020 -V104
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user