asigalov61 commited on
Commit
d57ab6a
1 Parent(s): b64b0f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -12
app.py CHANGED
@@ -84,20 +84,12 @@ def render_midi(input_midi, render_type, soundfont_bank, render_sample_rate, cus
84
  elif render_type == "Extract melody":
85
  output_score = TMIDIX.extract_melody(cscore, melody_range=[48, 84])
86
 
87
- elif render_type == "Transform":
88
  output_score = TMIDIX.flip_enhanced_score_notes(escore)
89
 
90
  elif render_type == 'Repair':
91
- output_score = []
92
-
93
- for c in cscore:
94
- c.sort(key=lambda x: x[4], reverse=True)
95
-
96
- fixed_chord = TMIDIX.check_and_fix_chord(c)
97
-
98
- output_score.extend(fixed_chord)
99
-
100
- output_score.sort(key= lambda x: x[1])
101
 
102
  print('Done processing!')
103
  print('=' * 70)
@@ -221,7 +213,7 @@ if __name__ == "__main__":
221
 
222
  gr.Markdown("## Select desired render type")
223
 
224
- render_type = gr.Radio(["Render as-is", "Custom render", "Extract melody", "Transform", "Repair"], label="Render type", value="Render as-is")
225
 
226
  gr.Markdown("## Select desired render options")
227
 
 
84
  elif render_type == "Extract melody":
85
  output_score = TMIDIX.extract_melody(cscore, melody_range=[48, 84])
86
 
87
+ elif render_type == "Flip":
88
  output_score = TMIDIX.flip_enhanced_score_notes(escore)
89
 
90
  elif render_type == 'Repair':
91
+ fixed_cscore = TMIDIX.advanced_check_and_fix_chords_in_chordified_score(cscore)
92
+ output_score = TMIDIX.flatten(fixed_cscore)
 
 
 
 
 
 
 
 
93
 
94
  print('Done processing!')
95
  print('=' * 70)
 
213
 
214
  gr.Markdown("## Select desired render type")
215
 
216
+ render_type = gr.Radio(["Render as-is", "Custom render", "Extract melody", "Flip", "Repair"], label="Render type", value="Render as-is")
217
 
218
  gr.Markdown("## Select desired render options")
219