asigalov61 commited on
Commit
2cb6a42
·
verified ·
1 Parent(s): 1ad380e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -120,7 +120,13 @@ def load_midi(input_midi, melody_patch=-1):
120
  zscore = TMIDIX.recalculate_score_timings(sp_escore_notes)
121
 
122
  else:
123
- zscore = TMIDIX.recalculate_score_timings([e for e in sp_escore_notes if e[6] == melody_patch])
 
 
 
 
 
 
124
 
125
  cscore = TMIDIX.chordify_score([1000, zscore])
126
 
 
120
  zscore = TMIDIX.recalculate_score_timings(sp_escore_notes)
121
 
122
  else:
123
+ mel_score = [e for e in sp_escore_notes if e[6] == melody_patch]
124
+
125
+ if mel_score:
126
+ zscore = TMIDIX.recalculate_score_timings(mel_score)
127
+
128
+ else:
129
+ zscore = TMIDIX.recalculate_score_timings(sp_escore_notes)
130
 
131
  cscore = TMIDIX.chordify_score([1000, zscore])
132