Franco Astegiano commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -470,17 +470,17 @@ def main(audio):
|
|
| 470 |
# To create this file, we can use the stream we created before.
|
| 471 |
|
| 472 |
# Saving the recognized musical notes as a MIDI file
|
| 473 |
-
converted_audio_file_as_midi = converted_audio_file[:-4] + '.mid'
|
| 474 |
-
fp = sc.write('midi', fp=converted_audio_file_as_midi)
|
| 475 |
|
| 476 |
-
wav_from_created_midi = converted_audio_file_as_midi.replace(' ', '_') + "_midioutput.wav"
|
| 477 |
#print(wav_from_created_midi)
|
| 478 |
|
| 479 |
# To listen to it on colab, we need to convert it back to wav. An easy way of
|
| 480 |
# doing that is using Timidity.
|
| 481 |
|
| 482 |
#!timidity $converted_audio_file_as_midi -Ow -o $wav_from_created_midi
|
| 483 |
-
return converted_audio_file, fig1, fig2, fig3, fig4,fig5, bpm, best_notes_and_rests
|
| 484 |
#return converted_audio_file, fig1, fig2, fig3, fig4,fig5, bpm, best_notes_and_rests, partitura, wav_from_created_midi
|
| 485 |
|
| 486 |
link = "https://www.tensorflow.org/hub/tutorials/spice?hl=es-419&authuser=2"
|
|
@@ -499,7 +499,7 @@ iface = gr.Interface(
|
|
| 499 |
gr.outputs.Textbox(label="bpm"),
|
| 500 |
gr.outputs.Textbox(label="partitura"),
|
| 501 |
#gr.outputs.Textbox(type="html",label="partitura1"),
|
| 502 |
-
gr.outputs.Audio(label="midi")],
|
| 503 |
interpretation = "default",
|
| 504 |
)
|
| 505 |
|
|
|
|
| 470 |
# To create this file, we can use the stream we created before.
|
| 471 |
|
| 472 |
# Saving the recognized musical notes as a MIDI file
|
| 473 |
+
##converted_audio_file_as_midi = converted_audio_file[:-4] + '.mid'
|
| 474 |
+
##fp = sc.write('midi', fp=converted_audio_file_as_midi)
|
| 475 |
|
| 476 |
+
##wav_from_created_midi = converted_audio_file_as_midi.replace(' ', '_') + "_midioutput.wav"
|
| 477 |
#print(wav_from_created_midi)
|
| 478 |
|
| 479 |
# To listen to it on colab, we need to convert it back to wav. An easy way of
|
| 480 |
# doing that is using Timidity.
|
| 481 |
|
| 482 |
#!timidity $converted_audio_file_as_midi -Ow -o $wav_from_created_midi
|
| 483 |
+
return converted_audio_file, fig1, fig2, fig3, fig4,fig5, bpm, best_notes_and_rests#, wav_from_created_midi
|
| 484 |
#return converted_audio_file, fig1, fig2, fig3, fig4,fig5, bpm, best_notes_and_rests, partitura, wav_from_created_midi
|
| 485 |
|
| 486 |
link = "https://www.tensorflow.org/hub/tutorials/spice?hl=es-419&authuser=2"
|
|
|
|
| 499 |
gr.outputs.Textbox(label="bpm"),
|
| 500 |
gr.outputs.Textbox(label="partitura"),
|
| 501 |
#gr.outputs.Textbox(type="html",label="partitura1"),
|
| 502 |
+
#gr.outputs.Audio(label="midi")],
|
| 503 |
interpretation = "default",
|
| 504 |
)
|
| 505 |
|