juancopi81 commited on
Commit
4a98ae7
1 Parent(s): abd03e3

Change default based on statistics

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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", "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
 
@@ -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="6/8", label="Time signature")
85
- note = gr.Dropdown(notes, value="D3", label="First note")
86
- bpm = gr.Slider(minimum=60, maximum=140, step=10, value=120, 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")
 
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")