asigalov61 commited on
Commit
ff96267
·
verified ·
1 Parent(s): cb9150f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -103,7 +103,13 @@ def render_midi(input_midi, render_options):
103
  new_fn = fn1+'.mid'
104
 
105
  patches = [0] * 16
 
106
 
 
 
 
 
 
107
  detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(output_score,
108
  output_signature = 'Advanced MIDI Renderer',
109
  output_file_name = fn1,
 
103
  new_fn = fn1+'.mid'
104
 
105
  patches = [0] * 16
106
+ channels = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15]
107
 
108
+ score_patches = sorted(set([e[6] for e in output_score])
109
+
110
+ for channel, patch in enumerate(channels[:len(score_patches)]):
111
+ patches[patch] = score_patches[channel]
112
+
113
  detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(output_score,
114
  output_signature = 'Advanced MIDI Renderer',
115
  output_file_name = fn1,