projectlosangeles commited on
Commit
39c0b14
·
verified ·
1 Parent(s): 0d8675a

Upload 14 files

Browse files
Monster-MIDI-Dataset-main.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8e021400efc79006c854784a2739f31686373d42c916589169f1351b92f86a85
3
- size 5812266
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:757d062266783a026e4fe6c99af0a435d0aebdddda5dc1c87d7f06b725e05b64
3
+ size 5813535
Monster_MIDI_Dataset_GPU_Search_and_Filter.ipynb CHANGED
@@ -430,7 +430,7 @@
430
  " try:\n",
431
  " sig_token = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord) + 128\n",
432
  " except:\n",
433
- " checked_tones_chord = TMIDIX.advanced_check_and_fix_tones_chord(tones_chord)\n",
434
  " sig_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128\n",
435
  "\n",
436
  " elif len(pitches) == 1:\n",
@@ -811,7 +811,7 @@
811
  " try:\n",
812
  " chord_token = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord) + 128\n",
813
  " except:\n",
814
- " checked_tones_chord = TMIDIX.advanced_check_and_fix_tones_chord(tones_chord)\n",
815
  " chord_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128\n",
816
  "\n",
817
  " elif len(pitches) == 1:\n",
 
430
  " try:\n",
431
  " sig_token = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord) + 128\n",
432
  " except:\n",
433
+ " checked_tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord)\n",
434
  " sig_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128\n",
435
  "\n",
436
  " elif len(pitches) == 1:\n",
 
811
  " try:\n",
812
  " chord_token = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord) + 128\n",
813
  " except:\n",
814
+ " checked_tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord)\n",
815
  " chord_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128\n",
816
  "\n",
817
  " elif len(pitches) == 1:\n",
TMIDIX.py CHANGED
@@ -9477,7 +9477,7 @@ def decode_from_ord(ord_list, chars_range=[], sub_char='', chars_shift=0):
9477
 
9478
  def lists_similarity(list1, list2, by_elements=True, by_sum=True):
9479
 
9480
- if len(list1) != len(list2) or len(list1) % 2 != 0:
9481
  return -1
9482
 
9483
  element_ratios = []
@@ -9525,6 +9525,217 @@ def find_indexes(lst, value, mode='equal', dual_mode=True):
9525
 
9526
  return sorted(set(indexes))
9527
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9528
  ###################################################################################
9529
  #
9530
  # This is the end of the TMIDI X Python module
 
9477
 
9478
  def lists_similarity(list1, list2, by_elements=True, by_sum=True):
9479
 
9480
+ if len(list1) != len(list2):
9481
  return -1
9482
 
9483
  element_ratios = []
 
9525
 
9526
  return sorted(set(indexes))
9527
 
9528
+ ###################################################################################
9529
+
9530
+ NUMERALS = ["one", "two", "three", "four",
9531
+ "five", "six", "seven", "eight",
9532
+ "nine", "ten", "eleven", "twelve",
9533
+ "thirteen", "fourteen", "fifteen", "sixteen"
9534
+ ]
9535
+
9536
+ SEMITONES = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]
9537
+
9538
+ MOOD_SCALES = ['Major', 'Minor', 'Major Minor']
9539
+
9540
+ ###################################################################################
9541
+
9542
+ def alpha_str(string):
9543
+ return re.sub(r'[^a-zA-Z ()]', '', string).strip()
9544
+
9545
+ ###################################################################################
9546
+
9547
+ def escore_notes_to_text_description(escore_notes, song_name='', artist_name=''):
9548
+
9549
+ #==============================================================================
9550
+
9551
+ song_time_min = (escore_notes[-1][1] * 16) / 1000 / 60
9552
+
9553
+ if song_time_min < 1.5:
9554
+ song_length = 'short'
9555
+
9556
+ elif 1.5 <= song_time_min < 2.5:
9557
+ song_length = 'average'
9558
+
9559
+ elif song_time_min >= 2.5:
9560
+ song_length = 'long'
9561
+
9562
+ #==============================================================================
9563
+
9564
+ escore_times = [e[1] for e in escore_notes if e[3] != 9]
9565
+
9566
+ comp_type = ''
9567
+
9568
+ if len(escore_times) > 0:
9569
+ if len(escore_times) == len(set(escore_times)):
9570
+ comp_type = 'melody only'
9571
+
9572
+ elif len(escore_times) >= len(set(escore_times)) and 1 in Counter(escore_times).values():
9573
+ comp_type = 'melody and accompaniment'
9574
+
9575
+ elif len(escore_times) >= len(set(escore_times)) and 1 not in Counter(escore_times).values():
9576
+ comp_type = 'accompaniment only'
9577
+
9578
+ else:
9579
+ comp_type = 'drums only'
9580
+
9581
+ #==============================================================================
9582
+
9583
+ patches = sorted(set([e[6] for e in escore_notes]))
9584
+
9585
+ instruments = [alpha_str(Number2patch[p]) for p in patches if p < 128]
9586
+
9587
+ if 128 in patches:
9588
+ drums_present = True
9589
+
9590
+ else:
9591
+ drums_present = False
9592
+
9593
+ drums_pitches = [e[4] for e in escore_notes if e[3] == 9]
9594
+
9595
+ most_common_drums = [alpha_str(Notenum2percussion[p[0]]) for p in Counter(drums_pitches).most_common(3)]
9596
+
9597
+ #==============================================================================
9598
+
9599
+ pitches = [e[4] for e in escore_notes if e[3] != 9]
9600
+
9601
+ key = ''
9602
+
9603
+ if pitches:
9604
+ key = SEMITONES[statistics.mode(pitches) % 12]
9605
+
9606
+ #==============================================================================
9607
+
9608
+ mood = ''
9609
+
9610
+ if pitches:
9611
+
9612
+ cscore = chordify_score([1000, escore_notes])
9613
+
9614
+ tones_chords = Counter()
9615
+
9616
+ for c in cscore:
9617
+ if len([e for e in c if e[3] != 9]) > 0:
9618
+ tones_chords[tuple(sorted(set([e[4] % 12 for e in c if e[3] != 9])))] += 1
9619
+
9620
+ most_common_tones_chords = [check_and_fix_tones_chord(list(c[0])) for c in tones_chords.most_common(10)]
9621
+
9622
+ mood_scale = statistics.mode(tones_chords_to_types(most_common_tones_chords, return_chord_type_index=True)) % 3
9623
+
9624
+ mood = MOOD_SCALES[mood_scale]
9625
+
9626
+ #==============================================================================
9627
+
9628
+ if pitches:
9629
+
9630
+ escore_averages = escore_notes_averages(escore_notes, return_ptcs_and_vels=True)
9631
+
9632
+ if escore_averages[0] < 8:
9633
+ rythm = 'fast'
9634
+
9635
+ elif 8 <= escore_averages[0] <= 12:
9636
+ rythm = 'average'
9637
+
9638
+ elif escore_averages[0] > 12:
9639
+ rythm = 'slow'
9640
+
9641
+ if escore_averages[1] < 16:
9642
+ tempo = 'fast'
9643
+
9644
+ elif 16 <= escore_averages[1] <= 24:
9645
+ tempo = 'average'
9646
+
9647
+ elif escore_averages[1] > 24:
9648
+ tempo = 'slow'
9649
+
9650
+ if escore_averages[2] < 50:
9651
+ tone = 'bass'
9652
+
9653
+ elif 50 <= escore_averages[2] <= 70:
9654
+ tone = 'midrange'
9655
+
9656
+ elif escore_averages[2] > 70:
9657
+ tone = 'treble'
9658
+
9659
+ if escore_averages[3] < 80:
9660
+ dynamics = 'quiet'
9661
+
9662
+ elif 80 <= escore_averages[3] <= 100:
9663
+ dynamics = 'average'
9664
+
9665
+ elif escore_averages[3] > 100:
9666
+ dynamics = 'loud'
9667
+
9668
+ #==============================================================================
9669
+
9670
+ description = ''
9671
+
9672
+ if song_name != '':
9673
+ description = 'Song "' + song_name + '"'
9674
+
9675
+ if artist_name != '':
9676
+ description += ' by ' + artist_name
9677
+
9678
+ if song_name != '' or artist_name != '':
9679
+ description += '.'
9680
+ description += '\n'
9681
+
9682
+ description += 'The song is '
9683
+
9684
+ if song_length != 'average':
9685
+ description += 'a ' + song_length
9686
+
9687
+ else:
9688
+ description += 'an ' + song_length
9689
+
9690
+ description += ' duration '
9691
+
9692
+ description += comp_type + ' composition'
9693
+
9694
+ if comp_type != 'drums only':
9695
+
9696
+ if drums_present:
9697
+ description += ' with drums'
9698
+
9699
+ else:
9700
+ description += ' without drums'
9701
+
9702
+ if key and mood:
9703
+ description += ' in ' + key + ' ' + mood
9704
+
9705
+ description += '.'
9706
+
9707
+ description += '\n'
9708
+
9709
+ if pitches:
9710
+
9711
+ description += 'It has '
9712
+
9713
+ description += rythm + ' rythm, '
9714
+ description += tempo + ' tempo, '
9715
+ description += tone + ' tone and '
9716
+ description += dynamics + ' dynamics.'
9717
+
9718
+ description += '\n'
9719
+
9720
+ description += 'The song '
9721
+
9722
+ if len(instruments) == 1:
9723
+ description += 'is played on a solo ' + instruments[0] + '.'
9724
+
9725
+ else:
9726
+ description += 'features ' + NUMERALS[len(instruments)-1] + ' instruments: '
9727
+ description += ', '.join(instruments[:-1]) + ' and ' + instruments[-1] + '.'
9728
+
9729
+ description += '\n'
9730
+
9731
+ if drums_present:
9732
+ description += 'The drum track has predominant '
9733
+ description += ', '.join(most_common_drums[:-1]) + ' and ' + most_common_drums[-1] + '.'
9734
+
9735
+ #==============================================================================
9736
+
9737
+ return description
9738
+
9739
  ###################################################################################
9740
  #
9741
  # This is the end of the TMIDI X Python module
fluidsynth-master.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5d67bb7863cc8b2c927c7f726ff8f5344ac875650a00c522939caa0e03bc2209
3
- size 1960774
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:015755e35c03195d7de75b998dc593077281cc626f1b606386705a6e48cf28fe
3
+ size 1968291
monster_midi_dataset_gpu_search_and_filter.py CHANGED
@@ -303,7 +303,7 @@ if filez:
303
  try:
304
  sig_token = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord) + 128
305
  except:
306
- checked_tones_chord = TMIDIX.advanced_check_and_fix_tones_chord(tones_chord)
307
  sig_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128
308
 
309
  elif len(pitches) == 1:
@@ -657,7 +657,7 @@ if filez:
657
  try:
658
  chord_token = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord) + 128
659
  except:
660
- checked_tones_chord = TMIDIX.advanced_check_and_fix_tones_chord(tones_chord)
661
  chord_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128
662
 
663
  elif len(pitches) == 1:
 
303
  try:
304
  sig_token = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord) + 128
305
  except:
306
+ checked_tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord)
307
  sig_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128
308
 
309
  elif len(pitches) == 1:
 
657
  try:
658
  chord_token = TMIDIX.ALL_CHORDS_SORTED.index(tones_chord) + 128
659
  except:
660
+ checked_tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord)
661
  chord_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128
662
 
663
  elif len(pitches) == 1:
tegridy-tools-main.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:86cec8475a0e0cd4ec7ddaf3dee37b892611afb6d3f17dac7f3411f64ae79960
3
- size 108223519
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3660620f49e73b208af028c8788058f0aa7587849f38c63dedcbd4c48457bc74
3
+ size 108228528