Spaces:
Running
on
Zero
Running
on
Zero
asigalov61
commited on
Commit
•
ecb6ee3
1
Parent(s):
a73b76e
Update midi_synthesizer.py
Browse files- midi_synthesizer.py +2 -1
midi_synthesizer.py
CHANGED
@@ -19,8 +19,9 @@ def synthesis(midi_opus, soundfont_path, sample_rate=44100):
|
|
19 |
fl = fluidsynth.Synth(samplerate=float(sample_rate))
|
20 |
sfid = fl.sfload(soundfont_path)
|
21 |
last_t = 0
|
|
|
22 |
for c in range(16):
|
23 |
-
fl.program_select(c, sfid, 128 if c == 9 else
|
24 |
for event in event_list:
|
25 |
name = event[0]
|
26 |
sample_len = int(((event[1] / ticks_per_beat) * tempo / (10 ** 6)) * sample_rate)
|
|
|
19 |
fl = fluidsynth.Synth(samplerate=float(sample_rate))
|
20 |
sfid = fl.sfload(soundfont_path)
|
21 |
last_t = 0
|
22 |
+
list_of_MIDI_patches=[0, 24, 32, 40, 42, 46, 56, 71, 73, 0, 53, 19, 0, 0, 0, 0]
|
23 |
for c in range(16):
|
24 |
+
fl.program_select(c, sfid, 128 if c == 9 else sfid, list_of_MIDI_patches[c])
|
25 |
for event in event_list:
|
26 |
name = event[0]
|
27 |
sample_len = int(((event[1] / ticks_per_beat) * tempo / (10 ** 6)) * sample_rate)
|