Update app.py
Browse files
app.py
CHANGED
|
@@ -102,16 +102,19 @@ def render_midi(input_midi, render_options):
|
|
| 102 |
|
| 103 |
new_fn = fn1+'.mid'
|
| 104 |
|
| 105 |
-
patches = [
|
| 106 |
patches[9] = 9
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
| 115 |
detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(output_score,
|
| 116 |
output_signature = 'Advanced MIDI Renderer',
|
| 117 |
output_file_name = fn1,
|
|
|
|
| 102 |
|
| 103 |
new_fn = fn1+'.mid'
|
| 104 |
|
| 105 |
+
patches = [-1] * 16
|
| 106 |
patches[9] = 9
|
| 107 |
|
| 108 |
+
for e in output_score:
|
| 109 |
+
if e[3] != 9:
|
| 110 |
+
if patches[e[3]] == -1:
|
| 111 |
+
patches[e[3]] = e[6]
|
| 112 |
+
else:
|
| 113 |
+
if -1 in patches:
|
| 114 |
+
patches[patches.index(-1)] = e[6]
|
| 115 |
+
else:
|
| 116 |
+
patches[-1] = e[6]
|
| 117 |
+
|
| 118 |
detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(output_score,
|
| 119 |
output_signature = 'Advanced MIDI Renderer',
|
| 120 |
output_file_name = fn1,
|