Update app.py
Browse files
app.py
CHANGED
|
@@ -178,13 +178,15 @@ def Render_MIDI(input_midi,
|
|
| 178 |
if render_type == "Multi-Instrumental Summary":
|
| 179 |
zscore = TMIDIX.recalculate_score_timings(output_score)
|
| 180 |
c_escore_notes = TMIDIX.compress_patches_in_escore_notes_chords(zscore)
|
| 181 |
-
cmatrix = TMIDIX.escore_notes_to_image_matrix(c_escore_notes, filter_out_zero_rows=True, filter_out_duplicate_rows=True)
|
| 182 |
-
smatrix = TPLOTS.square_image_matrix(cmatrix)
|
| 183 |
-
output_score = TMIDIX.image_matrix_to_original_escore_notes(smatrix)
|
| 184 |
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
if render_output_as_solo_piano:
|
| 190 |
output_score = TMIDIX.solo_piano_escore_notes(output_score, keep_drums=True)
|
|
@@ -195,14 +197,17 @@ def Render_MIDI(input_midi,
|
|
| 195 |
if render_type == "Solo Piano Summary":
|
| 196 |
sp_escore_notes = TMIDIX.solo_piano_escore_notes(output_score, keep_drums=False)
|
| 197 |
zscore = TMIDIX.recalculate_score_timings(sp_escore_notes)
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
|
|
|
|
|
|
|
|
|
| 206 |
|
| 207 |
SONG, patches, overflow_patches = TMIDIX.patch_enhanced_score_notes(output_score)
|
| 208 |
|
|
|
|
| 178 |
if render_type == "Multi-Instrumental Summary":
|
| 179 |
zscore = TMIDIX.recalculate_score_timings(output_score)
|
| 180 |
c_escore_notes = TMIDIX.compress_patches_in_escore_notes_chords(zscore)
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
+
if len(c_escore_notes) > 128:
|
| 183 |
+
cmatrix = TMIDIX.escore_notes_to_image_matrix(c_escore_notes, filter_out_zero_rows=True, filter_out_duplicate_rows=True)
|
| 184 |
+
smatrix = TPLOTS.square_image_matrix(cmatrix)
|
| 185 |
+
output_score = TMIDIX.image_matrix_to_original_escore_notes(smatrix)
|
| 186 |
+
|
| 187 |
+
for o in output_score:
|
| 188 |
+
o[1] *= 250
|
| 189 |
+
o[2] *= 250
|
| 190 |
|
| 191 |
if render_output_as_solo_piano:
|
| 192 |
output_score = TMIDIX.solo_piano_escore_notes(output_score, keep_drums=True)
|
|
|
|
| 197 |
if render_type == "Solo Piano Summary":
|
| 198 |
sp_escore_notes = TMIDIX.solo_piano_escore_notes(output_score, keep_drums=False)
|
| 199 |
zscore = TMIDIX.recalculate_score_timings(sp_escore_notes)
|
| 200 |
+
|
| 201 |
+
if len(zscore) > 128:
|
| 202 |
+
|
| 203 |
+
bmatrix = TMIDIX.escore_notes_to_binary_matrix(zscore)
|
| 204 |
+
cmatrix = TMIDIX.compress_binary_matrix(bmatrix, only_compress_zeros=True)
|
| 205 |
+
smatrix = TPLOTS.square_binary_matrix(cmatrix)
|
| 206 |
+
output_score = TMIDIX.binary_matrix_to_original_escore_notes(smatrix)
|
| 207 |
+
|
| 208 |
+
for o in output_score:
|
| 209 |
+
o[1] *= 200
|
| 210 |
+
o[2] *= 200
|
| 211 |
|
| 212 |
SONG, patches, overflow_patches = TMIDIX.patch_enhanced_score_notes(output_score)
|
| 213 |
|