projectlosangeles commited on
Commit
e1f3013
1 Parent(s): 492b31f

Upload 2 files

Browse files
Master_MIDI_Dataset_Search_and_Filter.ipynb CHANGED
@@ -285,6 +285,12 @@
285
  "print('Randomizing file list...')\n",
286
  "random.shuffle(filez)\n",
287
  "print('=' * 70)\n",
 
 
 
 
 
 
288
  "###################\n",
289
  "\n",
290
  "input_files_count = 0\n",
@@ -650,10 +656,9 @@
650
  " print('-' * 70)\n",
651
  " print('Copying max ratios MIDIs...')\n",
652
  "\n",
653
- " for i in range(number_of_top_ratios_MIDIs_to_collect):\n",
654
  "\n",
655
- " max_ratio = max_ratios[i]\n",
656
- " max_ratio_index = final_ratios.index(max_ratio)\n",
657
  "\n",
658
  " ffn = meta_data[max_ratio_index][0]\n",
659
  " ffn_idx = [y[0] for y in LAMD_files_list].index(ffn)\n",
@@ -667,12 +672,12 @@
667
  " if not os.path.exists(copy_path):\n",
668
  " os.mkdir(copy_path)\n",
669
  "\n",
670
- " shutil.copy2(f, copy_path+'/'+fn)\n",
671
- "\n",
672
- " fff = str(max_ratio * 100) + '_' + ffn + '.mid'\n",
673
  "\n",
674
  " shutil.copy2(ff, copy_path+'/'+fff)\n",
675
  " \n",
 
 
676
  " #=======================================================\n",
677
  " \n",
678
  " print('Done!')\n",
 
285
  "print('Randomizing file list...')\n",
286
  "random.shuffle(filez)\n",
287
  "print('=' * 70)\n",
288
+ "\n",
289
+ "###################\n",
290
+ "\n",
291
+ "if not os.path.exists('/content/Output-MIDI-Dataset'):\n",
292
+ " os.makedirs('/content/Output-MIDI-Dataset')\n",
293
+ "\n",
294
  "###################\n",
295
  "\n",
296
  "input_files_count = 0\n",
 
656
  " print('-' * 70)\n",
657
  " print('Copying max ratios MIDIs...')\n",
658
  "\n",
659
+ " for m in max_ratios:\n",
660
  "\n",
661
+ " max_ratio_index = final_ratios.index(m)\n",
 
662
  "\n",
663
  " ffn = meta_data[max_ratio_index][0]\n",
664
  " ffn_idx = [y[0] for y in LAMD_files_list].index(ffn)\n",
 
672
  " if not os.path.exists(copy_path):\n",
673
  " os.mkdir(copy_path)\n",
674
  "\n",
675
+ " fff = str(m * 100) + '_' + ffn + '.mid'\n",
 
 
676
  "\n",
677
  " shutil.copy2(ff, copy_path+'/'+fff)\n",
678
  " \n",
679
+ " shutil.copy2(f, copy_path+'/'+fn)\n",
680
+ "\n",
681
  " #=======================================================\n",
682
  " \n",
683
  " print('Done!')\n",
master_midi_dataset_search_and_filter.py CHANGED
@@ -178,6 +178,12 @@ if filez == []:
178
  print('Randomizing file list...')
179
  random.shuffle(filez)
180
  print('=' * 70)
 
 
 
 
 
 
181
  ###################
182
 
183
  input_files_count = 0
@@ -543,10 +549,9 @@ for f in filez:
543
  print('-' * 70)
544
  print('Copying max ratios MIDIs...')
545
 
546
- for i in range(number_of_top_ratios_MIDIs_to_collect):
547
 
548
- max_ratio = max_ratios[i]
549
- max_ratio_index = final_ratios.index(max_ratio)
550
 
551
  ffn = meta_data[max_ratio_index][0]
552
  ffn_idx = [y[0] for y in LAMD_files_list].index(ffn)
@@ -560,12 +565,12 @@ for f in filez:
560
  if not os.path.exists(copy_path):
561
  os.mkdir(copy_path)
562
 
563
- shutil.copy2(f, copy_path+'/'+fn)
564
-
565
- fff = str(max_ratio * 100) + '_' + ffn + '.mid'
566
 
567
  shutil.copy2(ff, copy_path+'/'+fff)
568
 
 
 
569
  #=======================================================
570
 
571
  print('Done!')
 
178
  print('Randomizing file list...')
179
  random.shuffle(filez)
180
  print('=' * 70)
181
+
182
+ ###################
183
+
184
+ if not os.path.exists('/content/Output-MIDI-Dataset'):
185
+ os.makedirs('/content/Output-MIDI-Dataset')
186
+
187
  ###################
188
 
189
  input_files_count = 0
 
549
  print('-' * 70)
550
  print('Copying max ratios MIDIs...')
551
 
552
+ for m in max_ratios:
553
 
554
+ max_ratio_index = final_ratios.index(m)
 
555
 
556
  ffn = meta_data[max_ratio_index][0]
557
  ffn_idx = [y[0] for y in LAMD_files_list].index(ffn)
 
565
  if not os.path.exists(copy_path):
566
  os.mkdir(copy_path)
567
 
568
+ fff = str(m * 100) + '_' + ffn + '.mid'
 
 
569
 
570
  shutil.copy2(ff, copy_path+'/'+fff)
571
 
572
+ shutil.copy2(f, copy_path+'/'+fn)
573
+
574
  #=======================================================
575
 
576
  print('Done!')