Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,11 +114,14 @@ def render_midi(input_midi, render_type, soundfont_bank, render_sample_rate, cus
|
|
| 114 |
output_score = copy.deepcopy(fixed_score)
|
| 115 |
|
| 116 |
elif render_type == "Transform":
|
| 117 |
-
output_score = copy.deepcopy(escore)
|
| 118 |
|
| 119 |
-
for e in
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
elif render_type == 'Repair':
|
| 124 |
output_score = []
|
|
|
|
| 114 |
output_score = copy.deepcopy(fixed_score)
|
| 115 |
|
| 116 |
elif render_type == "Transform":
|
|
|
|
| 117 |
|
| 118 |
+
min_pitch = min([e[4] for e in escore if e[3] != 9])
|
| 119 |
+
|
| 120 |
+
fliped_score = [127 - e[4] if e[3] != 9 else e[4] for e in escore]
|
| 121 |
+
|
| 122 |
+
delta_min_pitch = min_pitch - min([e[4] for e in fliped_score if e[3] != 9])
|
| 123 |
+
|
| 124 |
+
output_score = [e[4]+delta_min_pitch if e[3] != 9 else e[4] for e in fliped_score]
|
| 125 |
|
| 126 |
elif render_type == 'Repair':
|
| 127 |
output_score = []
|