asigalov61 commited on
Commit
fe65f7b
·
verified ·
1 Parent(s): 37f1de7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -110,10 +110,11 @@ def render_midi(input_midi, render_options):
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',
 
110
  if patches[e[3]] == -1:
111
  patches[e[3]] = e[6]
112
  else:
113
+ if patches[e[3]] != e[6]:
114
+ if -1 in patches:
115
+ patches[patches.index(-1)] = e[6]
116
+ else:
117
+ patches[-1] = e[6]
118
 
119
  detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(output_score,
120
  output_signature = 'Advanced MIDI Renderer',