Spaces:
Build error
Build error
Commit
·
d02f74d
1
Parent(s):
e80023d
Add more options to the inputs
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ SAMPLE_RATE=44100
|
|
9 |
|
10 |
# Feel free to change this, I am using only three notes here because the model
|
11 |
# works better this way.
|
12 |
-
notes = ["D3", "G3", "E4"]
|
13 |
-
notes_to_midi = {"D3": 50, "G3": 55, "E4": 64}
|
14 |
time_signatures = ["4/4", "3/4", "2/4", "6/8"]
|
15 |
time_signature_to_tokens = {"4/4": "4_4", "3/4": "3_4", "2/4": "2_4", "6/8": "6_8"}
|
16 |
|
@@ -80,9 +80,9 @@ with demo:
|
|
80 |
# UI for the inputs of the model
|
81 |
gr.Markdown("Select the generation parameters.")
|
82 |
with gr.Row():
|
83 |
-
time_signature = gr.Dropdown(time_signatures, value="
|
84 |
-
note = gr.Dropdown(notes, value="
|
85 |
-
bpm = gr.Slider(minimum=60, maximum=140, step=10, value=
|
86 |
density = gr.Slider(minimum=0, maximum=4, step=1, value=2, label="Density")
|
87 |
with gr.Row():
|
88 |
btn = gr.Button("Compose")
|
|
|
9 |
|
10 |
# Feel free to change this, I am using only three notes here because the model
|
11 |
# works better this way.
|
12 |
+
notes = ["A2", "D3", "G3", "C4", "E4"]
|
13 |
+
notes_to_midi = {"A2": 45, "D3": 50, "G3": 55, "C4": 60, "E4": 64}
|
14 |
time_signatures = ["4/4", "3/4", "2/4", "6/8"]
|
15 |
time_signature_to_tokens = {"4/4": "4_4", "3/4": "3_4", "2/4": "2_4", "6/8": "6_8"}
|
16 |
|
|
|
80 |
# UI for the inputs of the model
|
81 |
gr.Markdown("Select the generation parameters.")
|
82 |
with gr.Row():
|
83 |
+
time_signature = gr.Dropdown(time_signatures, value="6/8", label="Time signature")
|
84 |
+
note = gr.Dropdown(notes, value="D3", label="First note")
|
85 |
+
bpm = gr.Slider(minimum=60, maximum=140, step=10, value=120, label="Tempo")
|
86 |
density = gr.Slider(minimum=0, maximum=4, step=1, value=2, label="Density")
|
87 |
with gr.Row():
|
88 |
btn = gr.Button("Compose")
|