Spaces:
Build error
Build error
Commit
·
4a98ae7
1
Parent(s):
abd03e3
Change default based on statistics
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 = ["A2", "D3", "
|
13 |
-
notes_to_midi = {"A2": 45, "D3": 50, "
|
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 |
|
@@ -81,9 +81,9 @@ with demo:
|
|
81 |
# UI for the inputs of the model
|
82 |
gr.Markdown("Select the generation parameters.")
|
83 |
with gr.Row():
|
84 |
-
time_signature = gr.Dropdown(time_signatures, value="
|
85 |
-
note = gr.Dropdown(notes, value="
|
86 |
-
bpm = gr.Slider(minimum=60, maximum=
|
87 |
density = gr.Slider(minimum=0, maximum=4, step=1, value=2, label="Density")
|
88 |
with gr.Row():
|
89 |
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", "C3", "D3", "E4", "G4", "E5"]
|
13 |
+
notes_to_midi = {"A2": 45, "C3": 48, "D3": 50, "E4": 64, "G4":67, "E5": 76}
|
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 |
|
|
|
81 |
# UI for the inputs of the model
|
82 |
gr.Markdown("Select the generation parameters.")
|
83 |
with gr.Row():
|
84 |
+
time_signature = gr.Dropdown(time_signatures, value="2/4", label="Time signature")
|
85 |
+
note = gr.Dropdown(notes, value="E4", label="First note")
|
86 |
+
bpm = gr.Slider(minimum=60, maximum=130, step=10, value=90, label="Tempo")
|
87 |
density = gr.Slider(minimum=0, maximum=4, step=1, value=2, label="Density")
|
88 |
with gr.Row():
|
89 |
btn = gr.Button("Compose")
|