asigalov61 commited on
Commit
174c4ab
1 Parent(s): 464df0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -302,33 +302,30 @@ if __name__ == "__main__":
302
  )
303
 
304
  gr.Markdown("## Upload your MIDI or select a sample example below")
305
-
306
- gr.Markdown("## Upload source MIDI")
307
-
308
  gr.Markdown("### For best results upload only monophonic melody MIDIs")
309
 
310
  input_src_midi = gr.File(label="Source MIDI", file_types=[".midi", ".mid", ".kar"])
311
 
312
  gr.Markdown("## Select harmonization options")
313
 
314
- source_melody_transpose_value = gr.Slider(-6, 6, value=0, step=1, label="Source melody transpose value")
315
- harmonizer_melody_chunk_size = gr.Slider(4, 16, value=8, step=2, label="Hamonizer melody chunk size")
316
- harmonizer_max_matches_count = gr.Slider(-1, 20, value=-1, step=1, label="Harmonizer max matches count")
317
 
318
  melody_MIDI_patch_number = gr.Slider(0, 127, value=40, step=1, label="Source melody MIDI patch number")
319
  harmonized_accompaniment_MIDI_patch_number = gr.Slider(0, 127, value=0, step=1, label="Harmonized accompaniment MIDI patch number")
320
- base_MIDI_patch_number = gr.Slider(0, 127, value=35, step=1, label="Base MIDI patch number")
321
 
322
  run_btn = gr.Button("harmonize melody", variant="primary")
323
 
324
  gr.Markdown("## Harmonization results")
 
 
325
 
326
  output_audio = gr.Audio(label="Output MIDI audio", format="mp3", elem_id="midi_audio")
327
  output_plot = gr.Plot(label="Output MIDI score plot")
328
  output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
329
 
330
- output_summary = gr.Textbox(label="Melody harmonization summary")
331
-
332
  run_event = run_btn.click(Harmonize_Melody,
333
  [input_src_midi,
334
  source_melody_transpose_value,
 
302
  )
303
 
304
  gr.Markdown("## Upload your MIDI or select a sample example below")
 
 
 
305
  gr.Markdown("### For best results upload only monophonic melody MIDIs")
306
 
307
  input_src_midi = gr.File(label="Source MIDI", file_types=[".midi", ".mid", ".kar"])
308
 
309
  gr.Markdown("## Select harmonization options")
310
 
311
+ source_melody_transpose_value = gr.Slider(-6, 6, value=0, step=1, label="Source melody transpose value", info="You can transpose source melody by specified number of semitones if the original melody key does not harmonize well")
312
+ harmonizer_melody_chunk_size = gr.Slider(4, 16, value=8, step=2, label="Hamonizer melody chunk size", info="Larger chunk sizes result in better harmonization at the cost of speed and harminzation length")
313
+ harmonizer_max_matches_count = gr.Slider(-1, 20, value=-1, step=1, label="Harmonizer max matches count", info="Maximum number of harmonized chords per melody note to collect and to select from")
314
 
315
  melody_MIDI_patch_number = gr.Slider(0, 127, value=40, step=1, label="Source melody MIDI patch number")
316
  harmonized_accompaniment_MIDI_patch_number = gr.Slider(0, 127, value=0, step=1, label="Harmonized accompaniment MIDI patch number")
317
+ base_MIDI_patch_number = gr.Slider(-1, 127, value=35, step=1, label="Base MIDI patch number")
318
 
319
  run_btn = gr.Button("harmonize melody", variant="primary")
320
 
321
  gr.Markdown("## Harmonization results")
322
+
323
+ output_summary = gr.Textbox(label="Melody harmonization summary")
324
 
325
  output_audio = gr.Audio(label="Output MIDI audio", format="mp3", elem_id="midi_audio")
326
  output_plot = gr.Plot(label="Output MIDI score plot")
327
  output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
328
 
 
 
329
  run_event = run_btn.click(Harmonize_Melody,
330
  [input_src_midi,
331
  source_melody_transpose_value,