juancopi81 commited on
Commit
bdfb432
1 Parent(s): f965999

Add write music21

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -74,9 +74,9 @@ def inference(yt_audio_path):
74
  piano_roll = create_image_from_note_sequence(est_ns)
75
 
76
  parsed = converter.parse("./transcribed.mid")
77
- parsed.show()
78
-
79
- return "./transcribed.mid", (SAMPLE_RATE, int16_data), piano_roll
80
 
81
  title = "Transcribe music from YouTube videos using Transformers."
82
  description = """
@@ -125,12 +125,12 @@ with demo:
125
  midi_audio = gr.Audio()
126
  with gr.Row():
127
  piano_roll = gr.Image()
128
-
129
  btn.click(inference,
130
  inputs=yt_audio_path,
131
- outputs=[midi_file, midi_audio, piano_roll])
132
 
133
- gr.Markdown(article)
134
 
135
 
136
  demo.launch()
 
74
  piano_roll = create_image_from_note_sequence(est_ns)
75
 
76
  parsed = converter.parse("./transcribed.mid")
77
+ score = parsed.write()
78
+ print(score)
79
+ return "./transcribed.mid", (SAMPLE_RATE, int16_data), piano_roll, score
80
 
81
  title = "Transcribe music from YouTube videos using Transformers."
82
  description = """
 
125
  midi_audio = gr.Audio()
126
  with gr.Row():
127
  piano_roll = gr.Image()
128
+ score = gr.Image()
129
  btn.click(inference,
130
  inputs=yt_audio_path,
131
+ outputs=[midi_file, midi_audio, piano_roll, score])
132
 
133
+ gr.Markdown(article)
134
 
135
 
136
  demo.launch()