Update app.py
Browse files
app.py
CHANGED
|
@@ -167,10 +167,10 @@ def Render_MIDI(input_midi,
|
|
| 167 |
|
| 168 |
if render_type == "Longest Repeating Phrase":
|
| 169 |
zscore = TMIDIX.recalculate_score_timings(output_score)
|
| 170 |
-
lrno_score = TMIDIX.
|
| 171 |
|
| 172 |
if lrno_score is not None:
|
| 173 |
-
output_score =
|
| 174 |
|
| 175 |
else:
|
| 176 |
output_score = TMIDIX.recalculate_score_timings(TMIDIX.escore_notes_middle(output_score, 50))
|
|
@@ -181,7 +181,7 @@ def Render_MIDI(input_midi,
|
|
| 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:
|
|
@@ -202,7 +202,7 @@ def Render_MIDI(input_midi,
|
|
| 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:
|
|
|
|
| 167 |
|
| 168 |
if render_type == "Longest Repeating Phrase":
|
| 169 |
zscore = TMIDIX.recalculate_score_timings(output_score)
|
| 170 |
+
lrno_score = TMIDIX.escore_notes_lrno_pattern_fast(zscore)
|
| 171 |
|
| 172 |
if lrno_score is not None:
|
| 173 |
+
output_score = lrno_score
|
| 174 |
|
| 175 |
else:
|
| 176 |
output_score = TMIDIX.recalculate_score_timings(TMIDIX.escore_notes_middle(output_score, 50))
|
|
|
|
| 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, num_pca_components=max(1, min(5, len(c_escore_notes) // 128)))
|
| 185 |
output_score = TMIDIX.image_matrix_to_original_escore_notes(smatrix)
|
| 186 |
|
| 187 |
for o in output_score:
|
|
|
|
| 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, interpolation_order=max(1, min(5, len(c_escore_notes) // 128)))
|
| 206 |
output_score = TMIDIX.binary_matrix_to_original_escore_notes(smatrix)
|
| 207 |
|
| 208 |
for o in output_score:
|