psistolar commited on
Commit
1637cee
1 Parent(s): 0fd1c62

Try to return the produced MIDI

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -129,7 +129,8 @@ def process_midi(MIDI_File, Text_to_Sonify, Randomness, Amount_of_Music_to_Add):
129
  # use fluidsynth to convert MIDI to WAV so the user can hear the output
130
  sound_font = "/usr/share/sounds/sf2/FluidR3_GM.sf2"
131
  FluidSynth(sound_font).midi_to_audio('result.midi', 'result.wav')
132
- return 'result.wav'
 
133
 
134
  midi_file_desc = """Upload your own MIDI file here (try to keep it small without any fun time signatures).
135
  If you do not have a MIDI file, add some text and we will turn it into music!
@@ -153,7 +154,7 @@ iface = gr.Interface(
153
  gr.inputs.Slider(0, 250, default=100, step=50),
154
  gr.inputs.Radio([100, 200, 500], type="value", default=100)
155
  ],
156
- outputs="audio",
157
  article=article
158
  # examples=['C major scale.midi']
159
  )
 
129
  # use fluidsynth to convert MIDI to WAV so the user can hear the output
130
  sound_font = "/usr/share/sounds/sf2/FluidR3_GM.sf2"
131
  FluidSynth(sound_font).midi_to_audio('result.midi', 'result.wav')
132
+ # TODO: if we can personalize the file names, let's do that with the text
133
+ return 'result.wav', 'result.midi'
134
 
135
  midi_file_desc = """Upload your own MIDI file here (try to keep it small without any fun time signatures).
136
  If you do not have a MIDI file, add some text and we will turn it into music!
 
154
  gr.inputs.Slider(0, 250, default=100, step=50),
155
  gr.inputs.Radio([100, 200, 500], type="value", default=100)
156
  ],
157
+ outputs=["audio", "file"],
158
  article=article
159
  # examples=['C major scale.midi']
160
  )