asigalov61 commited on
Commit
7c1609a
1 Parent(s): 6fce636

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -204,6 +204,10 @@ def ClassifyMIDI(input_midi):
204
 
205
  #===============================================================================
206
  print('Rendering results...')
 
 
 
 
207
 
208
  print('=' * 70)
209
  print('Sample INTs', output[:15])
@@ -211,13 +215,14 @@ def ClassifyMIDI(input_midi):
211
 
212
  out1 = output
213
 
214
- fn1 = "Melody2Song-Seq2Seq-Music-Transformer-Composition"
215
 
216
  detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(song_f,
217
  output_signature = 'Advanced MIDI Classifier',
218
  output_file_name = fn1,
219
  track_name='Project Los Angeles',
220
- list_of_MIDI_patches=patches
 
221
  )
222
 
223
  new_fn = fn1+'.mid'
@@ -236,11 +241,11 @@ def ClassifyMIDI(input_midi):
236
  #========================================================
237
 
238
  output_midi_title = str(fn1)
239
- output_midi_summary = str(song_f[:3])
240
  output_midi = str(new_fn)
241
  output_audio = (16000, audio)
242
 
243
- output_plot = TMIDIX.plot_ms_SONG(song_f, plot_title=output_midi, return_plt=True)
244
 
245
  print('Output MIDI file name:', output_midi)
246
  print('Output MIDI title:', output_midi_title)
@@ -271,12 +276,11 @@ if __name__ == "__main__":
271
 
272
  print('Loading Annotated MIDI Dataset processed scores...')
273
  processed_scores = TMIDIX.Tegridy_Any_Pickle_File_Reader('processed_scores')
274
- print(processed_scores[0][0])
275
  print('=' * 70)
276
 
277
  print('Loading Annotated MIDI Dataset Classifier Songs Artists Labels...')
278
  classifier_labels = TMIDIX.Tegridy_Any_Pickle_File_Reader('Annotated_MIDI_Dataset_Classifier_Songs_Artists_Labels')
279
- print(classifier_labels[0])
280
  print('=' * 70)
281
 
282
  app = gr.Blocks()
 
204
 
205
  #===============================================================================
206
  print('Rendering results...')
207
+
208
+ score_idx = processed_scores_labels.index(classifier_labels[0][final_result-384])
209
+
210
+ output = processed_score[score_idx][1]
211
 
212
  print('=' * 70)
213
  print('Sample INTs', output[:15])
 
215
 
216
  out1 = output
217
 
218
+ fn1 = processed_score[score_idx][0]
219
 
220
  detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(song_f,
221
  output_signature = 'Advanced MIDI Classifier',
222
  output_file_name = fn1,
223
  track_name='Project Los Angeles',
224
+ list_of_MIDI_patches=patches,
225
+ timings_multiplier=16
226
  )
227
 
228
  new_fn = fn1+'.mid'
 
241
  #========================================================
242
 
243
  output_midi_title = str(fn1)
244
+ output_midi_summary = str('Summary')
245
  output_midi = str(new_fn)
246
  output_audio = (16000, audio)
247
 
248
+ output_plot = TMIDIX.plot_ms_SONG(song_f, plot_title=output_midi, return_plt=True, timings_multiplier=16)
249
 
250
  print('Output MIDI file name:', output_midi)
251
  print('Output MIDI title:', output_midi_title)
 
276
 
277
  print('Loading Annotated MIDI Dataset processed scores...')
278
  processed_scores = TMIDIX.Tegridy_Any_Pickle_File_Reader('processed_scores')
279
+ processed_scores_labels = [l[0] for l in processed_scores]
280
  print('=' * 70)
281
 
282
  print('Loading Annotated MIDI Dataset Classifier Songs Artists Labels...')
283
  classifier_labels = TMIDIX.Tegridy_Any_Pickle_File_Reader('Annotated_MIDI_Dataset_Classifier_Songs_Artists_Labels')
 
284
  print('=' * 70)
285
 
286
  app = gr.Blocks()