projectlosangeles commited on
Commit
a137311
1 Parent(s): bf20027

Upload 3 files

Browse files
Monster_MIDI_Dataset_GPU_Search_and_Filter.ipynb CHANGED
@@ -418,8 +418,8 @@
418
  " checked_tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord)\n",
419
  " sig_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128\n",
420
  "\n",
421
- " elif len(pitches) == 1:\n",
422
- " sig_token = pitches[0]\n",
423
  "\n",
424
  " sig.append(sig_token)\n",
425
  "\n",
 
418
  " checked_tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord)\n",
419
  " sig_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128\n",
420
  "\n",
421
+ " elif len(pitches) == 1:\n",
422
+ " sig_token = pitches[0]\n",
423
  "\n",
424
  " sig.append(sig_token)\n",
425
  "\n",
TMIDIX.py CHANGED
@@ -5050,6 +5050,47 @@ def frame_monophonic_melody(monophonic_melody, min_frame_time_threshold=10):
5050
 
5051
  ###################################################################################
5052
 
5053
- # This is the end of the TMIDI X Python module
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5054
 
5055
  ###################################################################################
 
 
 
 
 
5050
 
5051
  ###################################################################################
5052
 
5053
+ def delta_score_notes(score_notes,
5054
+ timings_clip_value=255,
5055
+ even_timings=False,
5056
+ compress_timings=False
5057
+ ):
5058
+
5059
+ delta_score = []
5060
+
5061
+ pe = score_notes[0]
5062
+
5063
+ for n in score_notes:
5064
+
5065
+ note = copy.deepcopy(n)
5066
+
5067
+ time = n[1] - pe[1]
5068
+ dur = n[2]
5069
+
5070
+ if even_timings:
5071
+ if time != 0 and time % 2 != 0:
5072
+ time += 1
5073
+ if dur % 2 != 0:
5074
+ dur += 1
5075
+
5076
+ time = max(0, min(timings_clip_value, time))
5077
+ dur = max(0, min(timings_clip_value, dur))
5078
+
5079
+ if compress_timings:
5080
+ time /= 2
5081
+ dur /= 2
5082
+
5083
+ note[1] = int(time)
5084
+ note[2] = int(dur)
5085
+
5086
+ delta_score.append(note)
5087
+
5088
+ pe = n
5089
+
5090
+ return delta_score
5091
 
5092
  ###################################################################################
5093
+
5094
+ # This is the end of the TMIDI X Python module
5095
+
5096
+ ###################################################################################
monster_midi_dataset_gpu_search_and_filter.py CHANGED
@@ -291,8 +291,8 @@ if filez:
291
  checked_tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord)
292
  sig_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128
293
 
294
- elif len(pitches) == 1:
295
- sig_token = pitches[0]
296
 
297
  sig.append(sig_token)
298
 
 
291
  checked_tones_chord = TMIDIX.check_and_fix_tones_chord(tones_chord)
292
  sig_token = TMIDIX.ALL_CHORDS_SORTED.index(checked_tones_chord) + 128
293
 
294
+ elif len(pitches) == 1:
295
+ sig_token = pitches[0]
296
 
297
  sig.append(sig_token)
298