Skip to content

Commit

Permalink
Version 1.0 Code corrections and new functions
Browse files Browse the repository at this point in the history
  • Loading branch information
asigalov61 authored Sep 2, 2024
1 parent bff0380 commit d073226
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tegridy-tools/TMIDIX.py
Original file line number Diff line number Diff line change
Expand Up @@ -4749,14 +4749,15 @@ def augment_enhanced_score_notes(enhanced_score_notes,
if legacy_timings:
abs_time = int(e[1] / timings_divider) + timings_shift

else:
abs_time += dtime

e[1] = max(0, abs_time + timings_shift)

e[2] = max(1, int(e[2] / timings_divider)) + timings_shift

e[4] = max(1, min(127, e[4] + pitch_shift))

abs_time += dtime

pe = enhanced_score_notes[i]

if full_sorting:
Expand Down Expand Up @@ -8364,6 +8365,18 @@ def escore_notes_delta_times(escore_notes,

return dtimes

# This is the end of the TMIDI X Python module
###################################################################################

def monophonic_check(escore_notes, times_index=1):
return len(escore_notes) == len(set([e[times_index] for e in escore_notes]))

###################################################################################

def count_escore_notes_patches(escore_notes, patches_index=6):
return [list(c) for c in Counter([e[patches_index] for e in escore_notes]).most_common()]

###################################################################################
#
# This is the end of the TMIDI X Python module
#
###################################################################################

0 comments on commit d073226

Please sign in to comment.