asigalov61 commited on
Commit
c12a6f7
1 Parent(s): f222a78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -142,7 +142,7 @@ def find_midi(title, artist):
142
  with open(f"MIDI-Match-Sample.mid", 'wb') as f:
143
  f.write(MIDI.score2midi([1000, song_f]))
144
  audio = synthesis(MIDI.score2opus([1000, song_f]), soundfont_path)
145
- yield "MIDI-Match-Sample.mid", (44100, audio), plt
146
 
147
  #==========================================================================================================
148
 
@@ -182,12 +182,13 @@ if __name__ == "__main__":
182
  submit = gr.Button()
183
 
184
  gr.Markdown("# Match results")
185
-
 
186
  output_audio = gr.Audio(label="Output MIDI match sample audio", format="mp3", elem_id="midi_audio")
187
  output_plot = gr.Plot(label="Output MIDI match sample plot")
188
  output_midi = gr.File(label="Output MIDI match sample MIDI", file_types=[".mid"])
189
 
190
  run_event = submit.click(find_midi, [title, artist],
191
- [output_midi, output_audio, output_plot])
192
 
193
  app.queue(1).launch(server_port=opt.port, share=opt.share, inbrowser=True)
 
142
  with open(f"MIDI-Match-Sample.mid", 'wb') as f:
143
  f.write(MIDI.score2midi([1000, song_f]))
144
  audio = synthesis(MIDI.score2opus([1000, song_f]), soundfont_path)
145
+ yield AUX_DATA[search_index][0], "MIDI-Match-Sample.mid", (44100, audio), plt
146
 
147
  #==========================================================================================================
148
 
 
182
  submit = gr.Button()
183
 
184
  gr.Markdown("# Match results")
185
+
186
+ output_midi_seq = gr.Textbox(label="Output MIDI match metadata")
187
  output_audio = gr.Audio(label="Output MIDI match sample audio", format="mp3", elem_id="midi_audio")
188
  output_plot = gr.Plot(label="Output MIDI match sample plot")
189
  output_midi = gr.File(label="Output MIDI match sample MIDI", file_types=[".mid"])
190
 
191
  run_event = submit.click(find_midi, [title, artist],
192
+ [output_midi_seq, output_midi, output_audio, output_plot])
193
 
194
  app.queue(1).launch(server_port=opt.port, share=opt.share, inbrowser=True)