Upload TMIDIX.py
Browse files
TMIDIX.py
CHANGED
|
@@ -15502,27 +15502,29 @@ def even_out_durations_in_escore_notes(escore_notes, min_notes_gap=0):
|
|
| 15502 |
score = [e for e in escore_notes if e[3] != 9]
|
| 15503 |
drums = [e for e in escore_notes if e[3] == 9]
|
| 15504 |
|
| 15505 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15506 |
|
| 15507 |
-
|
| 15508 |
|
| 15509 |
-
|
| 15510 |
-
|
| 15511 |
|
| 15512 |
-
|
| 15513 |
|
| 15514 |
-
|
| 15515 |
-
|
| 15516 |
-
|
| 15517 |
-
|
| 15518 |
-
|
| 15519 |
-
|
| 15520 |
-
|
| 15521 |
-
|
| 15522 |
-
|
| 15523 |
-
output_score.extend(cc)
|
| 15524 |
|
| 15525 |
-
return sorted(output_score + drums, key=lambda x: (x[1], -x[4]))
|
| 15526 |
|
| 15527 |
###################################################################################
|
| 15528 |
|
|
@@ -15531,31 +15533,32 @@ def even_out_velocities_in_escore_notes(escore_notes, use_pitches=False):
|
|
| 15531 |
score = [e for e in escore_notes if e[3] != 9]
|
| 15532 |
drums = [e for e in escore_notes if e[3] == 9]
|
| 15533 |
|
| 15534 |
-
|
|
|
|
|
|
|
|
|
|
| 15535 |
|
| 15536 |
-
|
| 15537 |
|
| 15538 |
-
|
| 15539 |
-
|
| 15540 |
-
|
| 15541 |
|
| 15542 |
-
|
| 15543 |
-
|
| 15544 |
|
| 15545 |
-
|
| 15546 |
|
| 15547 |
-
|
| 15548 |
-
|
| 15549 |
-
|
| 15550 |
-
|
| 15551 |
-
|
| 15552 |
-
|
| 15553 |
-
|
| 15554 |
-
|
| 15555 |
-
|
| 15556 |
-
output_score.extend(cc)
|
| 15557 |
|
| 15558 |
-
return sorted(output_score + drums, key=lambda x: (x[1], -x[4]))
|
| 15559 |
|
| 15560 |
###################################################################################
|
| 15561 |
|
|
|
|
| 15502 |
score = [e for e in escore_notes if e[3] != 9]
|
| 15503 |
drums = [e for e in escore_notes if e[3] == 9]
|
| 15504 |
|
| 15505 |
+
output_score = []
|
| 15506 |
+
|
| 15507 |
+
if score:
|
| 15508 |
+
|
| 15509 |
+
cscore = chordify_score([1000, score])
|
| 15510 |
|
| 15511 |
+
durs = []
|
| 15512 |
|
| 15513 |
+
for c in cscore:
|
| 15514 |
+
durs.append([e[2] for e in c])
|
| 15515 |
|
| 15516 |
+
ndurs = even_out_values_in_list_of_lists(durs)
|
| 15517 |
|
| 15518 |
+
for i, c in enumerate(cscore):
|
| 15519 |
+
cc = copy.deepcopy(c)
|
| 15520 |
+
ndur = ndurs[i]
|
| 15521 |
+
|
| 15522 |
+
for j, e in enumerate(cc):
|
| 15523 |
+
e[2] = ndur[j]
|
| 15524 |
+
|
| 15525 |
+
output_score.extend(cc)
|
|
|
|
|
|
|
| 15526 |
|
| 15527 |
+
return sorted(output_score + drums, key=lambda x: (x[1], -x[4], x[6]))
|
| 15528 |
|
| 15529 |
###################################################################################
|
| 15530 |
|
|
|
|
| 15533 |
score = [e for e in escore_notes if e[3] != 9]
|
| 15534 |
drums = [e for e in escore_notes if e[3] == 9]
|
| 15535 |
|
| 15536 |
+
output_score = []
|
| 15537 |
+
|
| 15538 |
+
if score:
|
| 15539 |
+
cscore = chordify_score([1000, score])
|
| 15540 |
|
| 15541 |
+
vels = []
|
| 15542 |
|
| 15543 |
+
for c in cscore:
|
| 15544 |
+
if use_pitches:
|
| 15545 |
+
vels.append([max(40, e[4]) for e in c])
|
| 15546 |
|
| 15547 |
+
else:
|
| 15548 |
+
vels.append([e[5] for e in c])
|
| 15549 |
|
| 15550 |
+
nvels = even_out_values_in_list_of_lists(vels)
|
| 15551 |
|
| 15552 |
+
for i, c in enumerate(cscore):
|
| 15553 |
+
cc = copy.deepcopy(c)
|
| 15554 |
+
nvel = nvels[i]
|
| 15555 |
+
|
| 15556 |
+
for j, e in enumerate(cc):
|
| 15557 |
+
e[5] = nvel[j]
|
| 15558 |
+
|
| 15559 |
+
output_score.extend(cc)
|
|
|
|
|
|
|
| 15560 |
|
| 15561 |
+
return sorted(output_score + drums, key=lambda x: (x[1], -x[4], x[6]))
|
| 15562 |
|
| 15563 |
###################################################################################
|
| 15564 |
|