asigalov61 commited on
Commit
c26a29c
1 Parent(s): c9dbbc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -16
app.py CHANGED
@@ -32,7 +32,7 @@ def TranscribePianoAudio(input_file):
32
  start_time = reqtime.time()
33
  print('=' * 70)
34
 
35
- fn = os.path.basename(input_file)
36
  fn1 = fn.split('.')[0]
37
 
38
  print('-' * 70)
@@ -52,12 +52,12 @@ def TranscribePianoAudio(input_file):
52
  print('-' * 70)
53
  print('Transcribing...')
54
 
55
- transcribed_dict = transcriptor.transcribe(audio, fn+'.mid')
56
  print('Done!')
57
  print('-' * 70)
58
 
59
  #===============================================================================
60
- raw_score = TMIDIX.midi2single_track_ms_score(fn+'.mid')
61
 
62
  #===============================================================================
63
  # Enhanced score notes
@@ -76,19 +76,9 @@ def TranscribePianoAudio(input_file):
76
  #===============================================================================
77
  print('Rendering results...')
78
 
79
- patches = [0] * 16
80
-
81
- detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(escore,
82
- output_signature = 'ByteDance Solo Piano Audio to MIDI Transcription',
83
- output_file_name = fn1,
84
- track_name='Project Los Angeles',
85
- list_of_MIDI_patches=patches
86
- )
87
  print('=' * 70)
88
- new_fn = fn1+'.mid'
89
-
90
-
91
- audio = midi_to_colab_audio(new_fn,
92
  soundfont_path=soundfont,
93
  sample_rate=16000,
94
  volume_scale=10,
@@ -102,7 +92,7 @@ def TranscribePianoAudio(input_file):
102
 
103
  output_midi_title = str(fn1)
104
  output_midi_summary = str(escore[:3])
105
- output_midi = str(new_fn)
106
  output_audio = (16000, audio)
107
 
108
  output_plot = TMIDIX.plot_ms_SONG(escore, plot_title=output_midi, return_plt=True)
 
32
  start_time = reqtime.time()
33
  print('=' * 70)
34
 
35
+ fn = str(input_file)
36
  fn1 = fn.split('.')[0]
37
 
38
  print('-' * 70)
 
52
  print('-' * 70)
53
  print('Transcribing...')
54
 
55
+ transcribed_dict = transcriptor.transcribe(audio, fn)
56
  print('Done!')
57
  print('-' * 70)
58
 
59
  #===============================================================================
60
+ raw_score = TMIDIX.midi2single_track_ms_score(fn)
61
 
62
  #===============================================================================
63
  # Enhanced score notes
 
76
  #===============================================================================
77
  print('Rendering results...')
78
 
 
 
 
 
 
 
 
 
79
  print('=' * 70)
80
+
81
+ audio = midi_to_colab_audio(fn,
 
 
82
  soundfont_path=soundfont,
83
  sample_rate=16000,
84
  volume_scale=10,
 
92
 
93
  output_midi_title = str(fn1)
94
  output_midi_summary = str(escore[:3])
95
+ output_midi = str(fn)
96
  output_audio = (16000, audio)
97
 
98
  output_plot = TMIDIX.plot_ms_SONG(escore, plot_title=output_midi, return_plt=True)