asigalov61 commited on
Commit
94526b4
1 Parent(s): c59fdbf

Update midi_synthesizer.py

Browse files
Files changed (1) hide show
  1. midi_synthesizer.py +4 -1
midi_synthesizer.py CHANGED
@@ -21,7 +21,10 @@ def synthesis(midi_opus, soundfont_path, sample_rate=44100):
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 c, 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)
 
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
+ if c == 9:
25
+ fl.program_select(c, sfid, 128)
26
+ else:
27
+ fl.program_select(c, sfid, list_of_MIDI_patches[c])
28
  for event in event_list:
29
  name = event[0]
30
  sample_len = int(((event[1] / ticks_per_beat) * tempo / (10 ** 6)) * sample_rate)