asigalov61
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -82,18 +82,7 @@ def render_midi(input_midi, render_type, soundfont_bank, render_sample_rate, cus
|
|
82 |
return TMIDIX.extract_melody(cscore)
|
83 |
|
84 |
elif render_type == "Transform":
|
85 |
-
|
86 |
-
min_pitch = min([e[4] for e in escore if e[3] != 9])
|
87 |
-
|
88 |
-
fliped_score_pitches = [127 - e[4]for e in escore if e[3] != 9]
|
89 |
-
|
90 |
-
delta_min_pitch = min_pitch - min([p for p in fliped_score_pitches])
|
91 |
-
|
92 |
-
output_score = copy.deepcopy(escore)
|
93 |
-
|
94 |
-
for e in output_score:
|
95 |
-
if e[3] != 9:
|
96 |
-
e[4] = (127 - e[4]) + delta_min_pitch
|
97 |
|
98 |
elif render_type == 'Repair':
|
99 |
output_score = []
|
|
|
82 |
return TMIDIX.extract_melody(cscore)
|
83 |
|
84 |
elif render_type == "Transform":
|
85 |
+
return TMIDIX.flip_enhanced_score_notes(escore)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
elif render_type == 'Repair':
|
88 |
output_score = []
|