Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,18 +79,7 @@ def render_midi(input_midi, render_type, soundfont_bank, render_sample_rate, cus
|
|
| 79 |
output_score = copy.deepcopy(escore)
|
| 80 |
|
| 81 |
elif render_type == "Extract melody":
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
for e in melody_score:
|
| 85 |
-
e[3] = 0
|
| 86 |
-
|
| 87 |
-
if e[4] < 60:
|
| 88 |
-
e[4] = (e[4] % 12) + 60
|
| 89 |
-
|
| 90 |
-
if e[4] > 84:
|
| 91 |
-
e[4] = (e[4] % 12) + 72
|
| 92 |
-
|
| 93 |
-
output_score = TMIDIX.fix_monophonic_score_durations(melody_score)
|
| 94 |
|
| 95 |
elif render_type == "Transform":
|
| 96 |
|
|
@@ -131,9 +120,6 @@ def render_midi(input_midi, render_type, soundfont_bank, render_sample_rate, cus
|
|
| 131 |
if -1 < custom_render_patch < 128:
|
| 132 |
if e[3] != 9:
|
| 133 |
e[6] = custom_render_patch
|
| 134 |
-
else:
|
| 135 |
-
if e[3] != 9:
|
| 136 |
-
e[6] = 0
|
| 137 |
|
| 138 |
print('Done recalculating timings!')
|
| 139 |
print('=' * 70)
|
|
|
|
| 79 |
output_score = copy.deepcopy(escore)
|
| 80 |
|
| 81 |
elif render_type == "Extract melody":
|
| 82 |
+
return TMIDIX.extract_melody(cscore)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
elif render_type == "Transform":
|
| 85 |
|
|
|
|
| 120 |
if -1 < custom_render_patch < 128:
|
| 121 |
if e[3] != 9:
|
| 122 |
e[6] = custom_render_patch
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
print('Done recalculating timings!')
|
| 125 |
print('=' * 70)
|