Spaces:
Running
Running
Next
commited on
Commit
•
014e544
1
Parent(s):
e05976f
Update app.py
Browse files
app.py
CHANGED
@@ -201,35 +201,34 @@ if __name__ == "__main__":
|
|
201 |
"This is a demo for tegridy-tools\n\n"
|
202 |
"Please see [tegridy-tools](https://github.com/asigalov61/tegridy-tools) GitHub repo for more information\n\n"
|
203 |
)
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
input_midi = gr.File(label="Input MIDI", file_types=[".midi", ".mid", ".kar"], type="filepath")
|
208 |
-
|
209 |
-
gr.Markdown("## Select desired render type")
|
210 |
-
|
211 |
-
render_type = gr.Radio(["Render as-is", "Custom render", "Extract melody", "Flip", "Reverse", "Repair"], label="Render type", value="Render as-is")
|
212 |
|
213 |
-
|
214 |
|
215 |
-
|
216 |
|
217 |
-
|
218 |
|
219 |
-
|
220 |
|
221 |
-
|
222 |
|
223 |
-
|
|
|
|
|
|
|
|
|
224 |
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
|
232 |
-
|
233 |
[output_midi_md5, output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
|
234 |
|
235 |
-
|
|
|
201 |
"This is a demo for tegridy-tools\n\n"
|
202 |
"Please see [tegridy-tools](https://github.com/asigalov61/tegridy-tools) GitHub repo for more information\n\n"
|
203 |
)
|
204 |
+
with gr.Tab("main setting"):
|
205 |
+
gr.Markdown("## Upload your MIDI")
|
206 |
+
input_midi = gr.File(label="Input MIDI", file_types=[".midi", ".mid", ".kar"], type="filepath")
|
|
|
|
|
|
|
|
|
|
|
207 |
|
208 |
+
gr.Markdown("## Select desired render type")
|
209 |
|
210 |
+
render_type = gr.Radio(["Render as-is", "Custom render", "Extract melody", "Flip", "Reverse", "Repair"], label="Render type", value="Render as-is")
|
211 |
|
212 |
+
gr.Markdown("## Select desired render options")
|
213 |
|
214 |
+
soundfont_bank = gr.Radio(["General MIDI", "Nice strings plus orchestra", "Real choir", "Super Game Boy", "SEGA Master"], label="SoundFont bank", value="General MIDI")
|
215 |
|
216 |
+
render_sample_rate = gr.Radio(["16000", "32000", "44100"], label="MIDI audio render sample rate", value="16000")
|
217 |
|
218 |
+
custom_render_patch = gr.Slider(-1, 127, value=-1, label="Custom MIDI render patch")
|
219 |
+
|
220 |
+
submit = gr.Button()
|
221 |
+
|
222 |
+
gr.Markdown("## Render results")
|
223 |
|
224 |
+
output_midi_md5 = gr.Textbox(label="Output MIDI md5 hash")
|
225 |
+
output_midi_title = gr.Textbox(label="Output MIDI title")
|
226 |
+
output_midi_summary = gr.Textbox(label="Output MIDI summary")
|
227 |
+
output_audio = gr.Audio(label="Output MIDI audio", format="wav", elem_id="midi_audio")
|
228 |
+
output_plot = gr.Plot(label="Output MIDI score plot")
|
229 |
+
output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
|
230 |
|
231 |
+
run_event = submit.click(render_midi, [input_midi, render_type, soundfont_bank, render_sample_rate, custom_render_patch],
|
232 |
[output_midi_md5, output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
|
233 |
|
234 |
+
app.launch()
|