asigalov61 commited on
Commit
be246c9
1 Parent(s): fef53cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -17
app.py CHANGED
@@ -152,9 +152,9 @@ if __name__ == "__main__":
152
  input_patch = gr.Slider(0, 127, value=40, step=1, label="Melody MIDI patch")
153
  input_start_chord = gr.Slider(0, 128, value=0, step=1, label="Melody start chord")
154
 
155
- run_btn = gr.Button("generate", variant="primary")
156
 
157
- gr.Markdown("## Generation results")
158
 
159
  output_midi_title = gr.Textbox(label="Output MIDI title")
160
  output_midi_summary = gr.Textbox(label="Output MIDI summary")
@@ -163,26 +163,16 @@ if __name__ == "__main__":
163
  output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
164
 
165
 
166
- run_event = run_btn.click(GenerateAccompaniment, [input_midi, input_channel, input_patch, input_start_chord],
167
  [output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
168
 
169
  gr.Examples(
170
- [["Chords-Progressions-Transformer-Piano-Seed-1.mid", 128, "Chords", False],
171
- ["Chords-Progressions-Transformer-Piano-Seed-2.mid", 128, "Chords-Times", False],
172
- ["Chords-Progressions-Transformer-Piano-Seed-3.mid", 128, "Chords-Times-Durations", False],
173
- ["Chords-Progressions-Transformer-Piano-Seed-4.mid", 128, "Chords", False],
174
- ["Chords-Progressions-Transformer-Piano-Seed-5.mid", 128, "Chords-Times", False],
175
- ["Chords-Progressions-Transformer-Piano-Seed-6.mid", 128, "Chords-Times-Durations", False],
176
- ["Chords-Progressions-Transformer-MI-Seed-1.mid", 128, "Chords", False],
177
- ["Chords-Progressions-Transformer-MI-Seed-2.mid", 128, "Chords-Times", False],
178
- ["Chords-Progressions-Transformer-MI-Seed-3.mid", 128, "Chords-Times-Durations", False],
179
- ["Chords-Progressions-Transformer-MI-Seed-4.mid", 128, "Chords-Times", False],
180
- ["Chords-Progressions-Transformer-MI-Seed-5.mid", 128, "Chords", False],
181
- ["Chords-Progressions-Transformer-MI-Seed-6.mid", 128, "Chords-Times-Durations", False]
182
  ],
183
- [input_midi, input_num_tokens, input_conditioning_type, input_strip_notes],
184
  [output_midi_title, output_midi_summary, output_midi, output_audio, output_plot],
185
- GenerateAccompaniment,
186
  cache_examples=True,
187
  )
188
 
 
152
  input_patch = gr.Slider(0, 127, value=40, step=1, label="Melody MIDI patch")
153
  input_start_chord = gr.Slider(0, 128, value=0, step=1, label="Melody start chord")
154
 
155
+ run_btn = gr.Button("add melody", variant="primary")
156
 
157
+ gr.Markdown("## Output results")
158
 
159
  output_midi_title = gr.Textbox(label="Output MIDI title")
160
  output_midi_summary = gr.Textbox(label="Output MIDI summary")
 
163
  output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
164
 
165
 
166
+ run_event = run_btn.click(AddMelody, [input_midi, input_channel, input_patch, input_start_chord],
167
  [output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
168
 
169
  gr.Examples(
170
+ [["Sharing The Night Together.kar", 3, 40, 0],
171
+ ["Deep Relaxation Melody #6.mid", 3, 40, 0],
 
 
 
 
 
 
 
 
 
 
172
  ],
173
+ [input_midi, input_channel, input_patch, input_start_chord],
174
  [output_midi_title, output_midi_summary, output_midi, output_audio, output_plot],
175
+ AddMelody,
176
  cache_examples=True,
177
  )
178