asigalov61
commited on
Commit
•
464df0b
1
Parent(s):
21779fc
Update app.py
Browse files
app.py
CHANGED
@@ -237,11 +237,11 @@ def Harmonize_Melody(input_src_midi,
|
|
237 |
harmonization_summary_string = '=' * 70
|
238 |
harmonization_summary_string += '\n'
|
239 |
|
240 |
-
harmonization_summary_string += 'Source melody has ' + str(len(mel_pitches)) + ' monophonic pitches'
|
241 |
harmonization_summary_string += '=' * 70
|
242 |
harmonization_summary_string += '\n'
|
243 |
|
244 |
-
harmonization_summary_string += 'Harmonized ' + str(len(song)) + ' out of ' + str(len(mel_pitches)) + ' source melody pitches'
|
245 |
harmonization_summary_string += '=' * 70
|
246 |
harmonization_summary_string += '\n'
|
247 |
|
@@ -305,6 +305,8 @@ if __name__ == "__main__":
|
|
305 |
|
306 |
gr.Markdown("## Upload source MIDI")
|
307 |
|
|
|
|
|
308 |
input_src_midi = gr.File(label="Source MIDI", file_types=[".midi", ".mid", ".kar"])
|
309 |
|
310 |
gr.Markdown("## Select harmonization options")
|
@@ -319,13 +321,13 @@ if __name__ == "__main__":
|
|
319 |
|
320 |
run_btn = gr.Button("harmonize melody", variant="primary")
|
321 |
|
322 |
-
gr.Markdown("##
|
323 |
|
324 |
output_audio = gr.Audio(label="Output MIDI audio", format="mp3", elem_id="midi_audio")
|
325 |
output_plot = gr.Plot(label="Output MIDI score plot")
|
326 |
output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
|
327 |
|
328 |
-
output_summary = gr.Textbox(label="
|
329 |
|
330 |
run_event = run_btn.click(Harmonize_Melody,
|
331 |
[input_src_midi,
|
@@ -340,7 +342,7 @@ if __name__ == "__main__":
|
|
340 |
|
341 |
gr.Examples(
|
342 |
[
|
343 |
-
["USSR Anthem Seed Melody.mid", 0, 12,
|
344 |
],
|
345 |
[input_src_midi,
|
346 |
source_melody_transpose_value,
|
|
|
237 |
harmonization_summary_string = '=' * 70
|
238 |
harmonization_summary_string += '\n'
|
239 |
|
240 |
+
harmonization_summary_string += 'Source melody has ' + str(len(mel_pitches)) + ' monophonic pitches' + '\n'
|
241 |
harmonization_summary_string += '=' * 70
|
242 |
harmonization_summary_string += '\n'
|
243 |
|
244 |
+
harmonization_summary_string += 'Harmonized ' + str(len(song)) + ' out of ' + str(len(mel_pitches)) + ' source melody pitches' + '\n'
|
245 |
harmonization_summary_string += '=' * 70
|
246 |
harmonization_summary_string += '\n'
|
247 |
|
|
|
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")
|
|
|
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,
|
|
|
342 |
|
343 |
gr.Examples(
|
344 |
[
|
345 |
+
["USSR Anthem Seed Melody.mid", 0, 12, 0, 40, 0, 35],
|
346 |
],
|
347 |
[input_src_midi,
|
348 |
source_melody_transpose_value,
|