asigalov61 commited on
Commit
6a8ce36
·
verified ·
1 Parent(s): 57e1c25

Upload TMIDIX.py

Browse files
Files changed (1) hide show
  1. TMIDIX.py +36 -1
TMIDIX.py CHANGED
@@ -51,7 +51,7 @@ r'''############################################################################
51
 
52
  ###################################################################################
53
 
54
- __version__ = "25.6.25"
55
 
56
  print('=' * 70)
57
  print('TMIDIX Python module')
@@ -13206,6 +13206,41 @@ def get_chords_by_semitones(chords_list, chord_semitones):
13206
 
13207
  ###################################################################################
13208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13209
  print('Module loaded!')
13210
  print('=' * 70)
13211
  print('Enjoy! :)')
 
51
 
52
  ###################################################################################
53
 
54
+ __version__ = "25.6.30"
55
 
56
  print('=' * 70)
57
  print('TMIDIX Python module')
 
13206
 
13207
  ###################################################################################
13208
 
13209
+ def remove_duplicate_pitches_from_escore_notes(escore_notes,
13210
+ pitches_idx=4,
13211
+ patches_idx=6,
13212
+ return_dupes_count=False
13213
+ ):
13214
+
13215
+ cscore = chordify_score([1000, escore_notes])
13216
+
13217
+ new_escore = []
13218
+
13219
+ bp_count = 0
13220
+
13221
+ for c in cscore:
13222
+
13223
+ cho = []
13224
+ seen = []
13225
+
13226
+ for cc in c:
13227
+ if [cc[pitches_idx], cc[patches_idx]] not in seen:
13228
+ cho.append(cc)
13229
+ seen.append([cc[pitches_idx], cc[patches_idx]])
13230
+
13231
+ else:
13232
+ bp_count += 1
13233
+
13234
+ new_escore.extend(cho)
13235
+
13236
+ if return_dupes_count:
13237
+ return bp_count
13238
+
13239
+ else:
13240
+ return new_escore
13241
+
13242
+ ###################################################################################
13243
+
13244
  print('Module loaded!')
13245
  print('=' * 70)
13246
  print('Enjoy! :)')