asigalov61 commited on
Commit
55adb3a
·
verified ·
1 Parent(s): d67c1db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -14
app.py CHANGED
@@ -114,9 +114,8 @@ def find_best_midx(midi_loops, midxs, trg_midx):
114
 
115
  #==================================================================================
116
 
117
- def Mix_Loops(generation_type,
118
- melody_patch,
119
- model_temperature
120
  ):
121
 
122
  #===============================================================================
@@ -128,9 +127,7 @@ def Mix_Loops(generation_type,
128
 
129
  print('Requested settings:')
130
  print('=' * 70)
131
- print('Generation type:', generation_type)
132
- print('Source melody patch:', melody_patch)
133
- print('Model temperature:', model_temperature)
134
 
135
  print('=' * 70)
136
 
@@ -165,7 +162,6 @@ def Mix_Loops(generation_type,
165
  print('Mixing loops...')
166
  print('=' * 70)
167
 
168
- max_num_loops = 4
169
  max_tries = 100
170
  loops_mult = 1
171
 
@@ -355,7 +351,7 @@ def Mix_Loops(generation_type,
355
  son = son_art[0]
356
  art = son_art[1]
357
 
358
- midi_summary += 'Loops # ' + str((i*loops_mult)+1) + '-' + str((i*loops_mult)+loops_mult) + ':' + '"' + son + '" by ' + art + '\n'
359
 
360
  #===============================================================================
361
 
@@ -446,9 +442,7 @@ with gr.Blocks() as demo:
446
 
447
  gr.Markdown("## Mixing options")
448
 
449
- generation_type = gr.Radio(["Guided", "Freestyle"], value="Guided", label="Generation type")
450
- melody_patch = gr.Slider(-1, 127, value=-1, step=1, label="Source melody MIDI patch")
451
- model_temperature = gr.Slider(0.1, 1, value=0.9, step=0.01, label="Model temperature")
452
 
453
  mix_btn = gr.Button("Mix", variant="primary")
454
 
@@ -461,9 +455,7 @@ with gr.Blocks() as demo:
461
 
462
  mix_btn.click(Mix_Loops,
463
  [
464
- generation_type,
465
- melody_patch,
466
- model_temperature
467
  ],
468
  [
469
  output_midi_summary,
 
114
 
115
  #==================================================================================
116
 
117
+ def Mix_Loops(max_num_loops
118
+
 
119
  ):
120
 
121
  #===============================================================================
 
127
 
128
  print('Requested settings:')
129
  print('=' * 70)
130
+ print('Max number of loops:', max_num_loops)
 
 
131
 
132
  print('=' * 70)
133
 
 
162
  print('Mixing loops...')
163
  print('=' * 70)
164
 
 
165
  max_tries = 100
166
  loops_mult = 1
167
 
 
351
  son = son_art[0]
352
  art = son_art[1]
353
 
354
+ midi_summary += 'Loops # ' + str((i*loops_mult)+1) + '-' + str((i*loops_mult)+loops_mult) + ': "' + son + '" by ' + art + '\n'
355
 
356
  #===============================================================================
357
 
 
442
 
443
  gr.Markdown("## Mixing options")
444
 
445
+ max_num_loops = gr.Slider(2, 8, value=4, step=1, label="Maximum number of loops to mix")
 
 
446
 
447
  mix_btn = gr.Button("Mix", variant="primary")
448
 
 
455
 
456
  mix_btn.click(Mix_Loops,
457
  [
458
+ max_num_loops,
 
 
459
  ],
460
  [
461
  output_midi_summary,