added section and usage description
Browse files- playground.py +22 -6
playground.py
CHANGED
|
@@ -116,7 +116,7 @@ def generator(
|
|
| 116 |
def instrument_row(default_inst, row_id):
|
| 117 |
with gr.Row():
|
| 118 |
row = gr.Variable(row_id)
|
| 119 |
-
with gr.Column(scale=1, min_width=
|
| 120 |
inst = gr.Dropdown(
|
| 121 |
sorted([inst["transfer_to"] for inst in INSTRUMENT_TRANSFER_CLASSES])
|
| 122 |
+ ["Drums"],
|
|
@@ -124,14 +124,18 @@ def instrument_row(default_inst, row_id):
|
|
| 124 |
label="Instrument",
|
| 125 |
)
|
| 126 |
temp = gr.Dropdown(
|
| 127 |
-
[0.
|
|
|
|
|
|
|
| 128 |
)
|
| 129 |
-
density = gr.Dropdown([
|
| 130 |
|
| 131 |
with gr.Column(scale=3):
|
| 132 |
-
output_txt = gr.Textbox(
|
|
|
|
|
|
|
| 133 |
with gr.Column(scale=1, min_width=100):
|
| 134 |
-
inst_audio = gr.Audio(label="Audio")
|
| 135 |
regenerate = gr.Checkbox(value=False, label="Regenerate", visible=False)
|
| 136 |
# add_bars = gr.Checkbox(value=False, label="Add Bars")
|
| 137 |
# add_bar_count = gr.Dropdown([1, 2, 4, 8], value=1, label="Add Bars")
|
|
@@ -154,10 +158,22 @@ def instrument_row(default_inst, row_id):
|
|
| 154 |
with gr.Blocks() as demo:
|
| 155 |
piece_by_track = gr.State([])
|
| 156 |
state = gr.State([])
|
|
|
|
|
|
|
| 157 |
mixed_audio = gr.Audio(label="Mixed Audio")
|
| 158 |
-
piano_roll = gr.Plot(label="Piano Roll")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
instrument_row("Drums", 0)
|
|
|
|
| 160 |
instrument_row("Synth Bass 1", 1)
|
|
|
|
| 161 |
instrument_row("Synth Lead Square", 2)
|
| 162 |
# instrument_row("Piano")
|
| 163 |
|
|
|
|
| 116 |
def instrument_row(default_inst, row_id):
|
| 117 |
with gr.Row():
|
| 118 |
row = gr.Variable(row_id)
|
| 119 |
+
with gr.Column(scale=1, min_width=100):
|
| 120 |
inst = gr.Dropdown(
|
| 121 |
sorted([inst["transfer_to"] for inst in INSTRUMENT_TRANSFER_CLASSES])
|
| 122 |
+ ["Drums"],
|
|
|
|
| 124 |
label="Instrument",
|
| 125 |
)
|
| 126 |
temp = gr.Dropdown(
|
| 127 |
+
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],
|
| 128 |
+
value=0.7,
|
| 129 |
+
label="Creativity",
|
| 130 |
)
|
| 131 |
+
density = gr.Dropdown([1, 2, 3], value=3, label="Note Density")
|
| 132 |
|
| 133 |
with gr.Column(scale=3):
|
| 134 |
+
output_txt = gr.Textbox(
|
| 135 |
+
label="output", lines=9, max_lines=9, show_label=False
|
| 136 |
+
)
|
| 137 |
with gr.Column(scale=1, min_width=100):
|
| 138 |
+
inst_audio = gr.Audio(label="TRACK Audio", show_label=True)
|
| 139 |
regenerate = gr.Checkbox(value=False, label="Regenerate", visible=False)
|
| 140 |
# add_bars = gr.Checkbox(value=False, label="Add Bars")
|
| 141 |
# add_bar_count = gr.Dropdown([1, 2, 4, 8], value=1, label="Add Bars")
|
|
|
|
| 158 |
with gr.Blocks() as demo:
|
| 159 |
piece_by_track = gr.State([])
|
| 160 |
state = gr.State([])
|
| 161 |
+
title = gr.Markdown(""" # Demo-App of The-Jam-Machine""")
|
| 162 |
+
track1_md = gr.Markdown(""" ## Mixed Audio and Piano Roll """)
|
| 163 |
mixed_audio = gr.Audio(label="Mixed Audio")
|
| 164 |
+
piano_roll = gr.Plot(label="Piano Roll", show_label=False)
|
| 165 |
+
description = gr.Markdown(
|
| 166 |
+
"""
|
| 167 |
+
For each **TRACK** choose your **instrument**, along with **creativity** (temperature) and **note density** and **hit the generate Button** !
|
| 168 |
+
The Jam machine is a generative AI trained on text transcription of MIDI music. You can check the generated text, but most importantly, listen to the generated audio!
|
| 169 |
+
If you don't like the track, hit the generate button to regenerate it! Generate more tracks and listen to the mixed audio !
|
| 170 |
+
"""
|
| 171 |
+
)
|
| 172 |
+
track1_md = gr.Markdown(""" ## TRACK 1 """)
|
| 173 |
instrument_row("Drums", 0)
|
| 174 |
+
track1_md = gr.Markdown(""" ## TRACK 2 """)
|
| 175 |
instrument_row("Synth Bass 1", 1)
|
| 176 |
+
track1_md = gr.Markdown(""" ## TRACK 2 """)
|
| 177 |
instrument_row("Synth Lead Square", 2)
|
| 178 |
# instrument_row("Piano")
|
| 179 |
|