Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -115,8 +115,7 @@ def find_best_midx(midxs, trg_midx):
|
|
115 |
|
116 |
#==================================================================================
|
117 |
|
118 |
-
def Mix_Loops(
|
119 |
-
generation_type,
|
120 |
melody_patch,
|
121 |
model_temperature
|
122 |
):
|
@@ -127,11 +126,7 @@ def Mix_Loops(input_midi,
|
|
127 |
print('Req start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
|
128 |
start_time = reqtime.time()
|
129 |
print('=' * 70)
|
130 |
-
|
131 |
-
fn = os.path.basename(input_midi)
|
132 |
-
fn1 = fn.split('.')[0]
|
133 |
-
|
134 |
-
print('=' * 70)
|
135 |
print('Requested settings:')
|
136 |
print('=' * 70)
|
137 |
print('Input MIDI file name:', fn)
|
@@ -452,7 +447,7 @@ with gr.Blocks() as demo:
|
|
452 |
melody_patch = gr.Slider(-1, 127, value=-1, step=1, label="Source melody MIDI patch")
|
453 |
model_temperature = gr.Slider(0.1, 1, value=0.9, step=0.01, label="Model temperature")
|
454 |
|
455 |
-
|
456 |
|
457 |
gr.Markdown("## Mixing results")
|
458 |
|
@@ -461,20 +456,19 @@ with gr.Blocks() as demo:
|
|
461 |
output_plot = gr.Plot(label="MIDI score plot")
|
462 |
output_midi = gr.File(label="MIDI file", file_types=[".mid"])
|
463 |
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
)
|
478 |
|
479 |
#==================================================================================
|
480 |
|
|
|
115 |
|
116 |
#==================================================================================
|
117 |
|
118 |
+
def Mix_Loops(generation_type,
|
|
|
119 |
melody_patch,
|
120 |
model_temperature
|
121 |
):
|
|
|
126 |
print('Req start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
|
127 |
start_time = reqtime.time()
|
128 |
print('=' * 70)
|
129 |
+
|
|
|
|
|
|
|
|
|
130 |
print('Requested settings:')
|
131 |
print('=' * 70)
|
132 |
print('Input MIDI file name:', fn)
|
|
|
447 |
melody_patch = gr.Slider(-1, 127, value=-1, step=1, label="Source melody MIDI patch")
|
448 |
model_temperature = gr.Slider(0.1, 1, value=0.9, step=0.01, label="Model temperature")
|
449 |
|
450 |
+
mix_btn = gr.Button("Mix", variant="primary")
|
451 |
|
452 |
gr.Markdown("## Mixing results")
|
453 |
|
|
|
456 |
output_plot = gr.Plot(label="MIDI score plot")
|
457 |
output_midi = gr.File(label="MIDI file", file_types=[".mid"])
|
458 |
|
459 |
+
mix_btn.click(Mix_Loops,
|
460 |
+
[
|
461 |
+
generation_type,
|
462 |
+
melody_patch,
|
463 |
+
model_temperature
|
464 |
+
],
|
465 |
+
[
|
466 |
+
output_midi_summary,
|
467 |
+
output_audio,
|
468 |
+
output_plot,
|
469 |
+
output_midi
|
470 |
+
]
|
471 |
+
)
|
|
|
472 |
|
473 |
#==================================================================================
|
474 |
|