Franco Astegiano commited on
Commit
b191346
·
unverified ·
1 Parent(s): 1f9d3d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -381,11 +381,11 @@ def main(audio):
381
 
382
  # At this point, best_notes_and_rests contains the best quantization.
383
  # Since we don't need to have rests at the beginning, let's remove these:
384
- #while best_notes_and_rests[0] == 'Rest':
385
- # best_notes_and_rests = best_notes_and_rests[1:]
386
  # Also remove silence at the end.
387
- #while best_notes_and_rests[-1] == 'Rest':
388
- # best_notes_and_rests = best_notes_and_rests[:-1]
389
 
390
  # ____________________________________________________________________________
391
  # Now let's write the quantized notes as sheet music score!
@@ -460,7 +460,7 @@ def main(audio):
460
  return a
461
 
462
  # rendering the music score
463
- partitura = showScore(sc)
464
  #print(best_notes_and_rests)
465
 
466
 
@@ -480,8 +480,8 @@ def main(audio):
480
  # doing that is using Timidity.
481
 
482
  #!timidity $converted_audio_file_as_midi -Ow -o $wav_from_created_midi
483
-
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"
487
 
@@ -498,7 +498,7 @@ iface = gr.Interface(
498
  gr.outputs.Plot(type="auto",label="Espectro+Notas"),
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
  )
 
381
 
382
  # At this point, best_notes_and_rests contains the best quantization.
383
  # Since we don't need to have rests at the beginning, let's remove these:
384
+ while best_notes_and_rests[0] == 'Rest':
385
+ best_notes_and_rests = best_notes_and_rests[1:]
386
  # Also remove silence at the end.
387
+ while best_notes_and_rests[-1] == 'Rest':
388
+ best_notes_and_rests = best_notes_and_rests[:-1]
389
 
390
  # ____________________________________________________________________________
391
  # Now let's write the quantized notes as sheet music score!
 
460
  return a
461
 
462
  # rendering the music score
463
+ ###partitura = showScore(sc)
464
  #print(best_notes_and_rests)
465
 
466
 
 
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"
487
 
 
498
  gr.outputs.Plot(type="auto",label="Espectro+Notas"),
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
  )