Spaces:
Sleeping
Sleeping
thecollabagepatch
commited on
Commit
·
5098605
1
Parent(s):
df33387
sigh
Browse files
app.py
CHANGED
@@ -218,16 +218,14 @@ with gr.Blocks() as iface:
|
|
218 |
|
219 |
with gr.Row():
|
220 |
with gr.Column():
|
221 |
-
# Input components for MIDI generation
|
222 |
seed = gr.Textbox(label="Seed (leave blank for random)", value="")
|
223 |
use_chords = gr.Checkbox(label="Control Chord Progression", value=False)
|
224 |
-
chord_progression = gr.Textbox(label="Chord Progression (e.g., Am CM Dm E7 Am)", visible=
|
225 |
bpm = gr.Slider(label="BPM", minimum=60, maximum=200, step=1, value=120)
|
226 |
generate_midi_button = gr.Button("Generate MIDI")
|
227 |
-
midi_audio = gr.Audio(label="Generated MIDI Audio")
|
228 |
|
229 |
with gr.Column():
|
230 |
-
# Input components for music generation based on MIDI
|
231 |
prompt_duration = gr.Dropdown(label="Prompt Duration (seconds)", choices=list(range(1, 11)), value=5)
|
232 |
musicgen_model = gr.Dropdown(label="MusicGen Model", choices=[
|
233 |
"thepatch/vanya_ai_dnb_0.1 (small)",
|
@@ -240,7 +238,8 @@ with gr.Blocks() as iface:
|
|
240 |
generate_music_button = gr.Button("Generate Music")
|
241 |
output_audio = gr.Audio(label="Generated Music")
|
242 |
|
243 |
-
|
244 |
-
|
|
|
245 |
|
246 |
iface.launch()
|
|
|
218 |
|
219 |
with gr.Row():
|
220 |
with gr.Column():
|
|
|
221 |
seed = gr.Textbox(label="Seed (leave blank for random)", value="")
|
222 |
use_chords = gr.Checkbox(label="Control Chord Progression", value=False)
|
223 |
+
chord_progression = gr.Textbox(label="Chord Progression (e.g., Am CM Dm E7 Am)", visible=True)
|
224 |
bpm = gr.Slider(label="BPM", minimum=60, maximum=200, step=1, value=120)
|
225 |
generate_midi_button = gr.Button("Generate MIDI")
|
226 |
+
midi_audio = gr.Audio(label="Generated MIDI Audio", type="filepath") # Ensure this is set to handle file paths
|
227 |
|
228 |
with gr.Column():
|
|
|
229 |
prompt_duration = gr.Dropdown(label="Prompt Duration (seconds)", choices=list(range(1, 11)), value=5)
|
230 |
musicgen_model = gr.Dropdown(label="MusicGen Model", choices=[
|
231 |
"thepatch/vanya_ai_dnb_0.1 (small)",
|
|
|
238 |
generate_music_button = gr.Button("Generate Music")
|
239 |
output_audio = gr.Audio(label="Generated Music")
|
240 |
|
241 |
+
# Connecting the components
|
242 |
+
generate_midi_button.click(generate_midi, inputs=[seed, use_chords, chord_progression, bpm], outputs=[midi_audio])
|
243 |
+
generate_music_button.click(generate_music, inputs=[midi_audio, prompt_duration, musicgen_model, num_iterations, bpm], outputs=[output_audio])
|
244 |
|
245 |
iface.launch()
|