asigalov61 commited on
Commit
986e4d1
1 Parent(s): e673413

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -25,7 +25,10 @@ in_space = os.getenv("SYSTEM") == "spaces"
25
  #==========================================================================================================
26
 
27
  def find_midi(search_string, search_options):
28
-
 
 
 
29
  print('=' * 70)
30
  print('Preparing to search...')
31
 
@@ -90,7 +93,7 @@ def find_midi(search_string, search_options):
90
  ax=plt.axes(title=title)
91
  ax.set_facecolor('black')
92
 
93
- plt.scatter(x,y, s=2, c=c)
94
  plt.xlabel("Time in MIDI ticks")
95
  plt.ylabel("MIDI Pitch")
96
 
@@ -102,7 +105,7 @@ def find_midi(search_string, search_options):
102
  volume_scale=10,
103
  output_for_gradio=True
104
  )
105
- yield AUX_DATA[search_match_index][0], fn+'.mid', (16000, audio), plt
106
 
107
  #==========================================================================================================
108
 
@@ -141,12 +144,15 @@ if __name__ == "__main__":
141
 
142
  gr.Markdown("# Search results")
143
 
144
- output_midi_seq = gr.Textbox(label="Found MIDI search title")
145
- output_audio = gr.Audio(label="Output MIDI search sample audio", format="wav", elem_id="midi_audio")
146
- output_plot = gr.Plot(label="Output MIDI search sample plot")
147
- output_midi = gr.File(label="Output MIDI search sample MIDI", file_types=[".mid"])
 
 
 
148
 
149
  run_event = submit.click(find_midi, [search_string, search_options],
150
- [output_midi_seq, output_midi, output_audio, output_plot])
151
 
152
  app.queue(1).launch(server_port=opt.port, share=opt.share, inbrowser=True)
 
25
  #==========================================================================================================
26
 
27
  def find_midi(search_string, search_options):
28
+
29
+ print('=' * 70)
30
+ print('Search string', search_string)
31
+ print('Search options', search_options)
32
  print('=' * 70)
33
  print('Preparing to search...')
34
 
 
93
  ax=plt.axes(title=title)
94
  ax.set_facecolor('black')
95
 
96
+ plt.scatter(x,y, s=5, c=c)
97
  plt.xlabel("Time in MIDI ticks")
98
  plt.ylabel("MIDI Pitch")
99
 
 
105
  volume_scale=10,
106
  output_for_gradio=True
107
  )
108
+ yield AUX_DATA[search_match_index][0], AUX_DATA[search_match_index][1], AUX_DATA[search_match_index][2], AUX_DATA[search_match_index][3], fn+'.mid', (16000, audio), plt
109
 
110
  #==========================================================================================================
111
 
 
144
 
145
  gr.Markdown("# Search results")
146
 
147
+ output_midi_md5 = gr.Textbox(label="Output Karaoke MIDI md5 hash")
148
+ output_midi_title = gr.Textbox(label="Output Karaoke MIDI title")
149
+ output_audio = gr.Audio(label="Output Karaoke MIDI audio", format="wav", elem_id="midi_audio")
150
+ output_plot = gr.Plot(label="Output Karaoke MIDI score plot")
151
+ output_midi_lyric = gr.Textbox(label="Output Karaoke MIDI lyric")
152
+ output_midi_summary = gr.Textbox(label="Output Karaoke MIDI summary")
153
+ output_midi = gr.File(label="Output Karaoke MIDI original file", file_types=[".mid"])
154
 
155
  run_event = submit.click(find_midi, [search_string, search_options],
156
+ [output_midi_md5, output_midi_title, output_midi_lyric, output_midi_summary, output_midi, output_audio, output_plot])
157
 
158
  app.queue(1).launch(server_port=opt.port, share=opt.share, inbrowser=True)