Spaces:
Running
Running
asigalov61
commited on
Commit
•
fc2b6d6
1
Parent(s):
e06f0cf
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,7 @@ from midi_synthesizer import synthesis
|
|
14 |
in_space = os.getenv("SYSTEM") == "spaces"
|
15 |
|
16 |
|
17 |
-
def
|
18 |
-
disable_patch_change=False, disable_control_change=False, disable_channels=None):
|
19 |
if disable_channels is not None:
|
20 |
disable_channels = [tokenizer.parameter_ids["channel"][c] for c in disable_channels]
|
21 |
else:
|
@@ -84,22 +83,25 @@ def create_msg(name, data):
|
|
84 |
return {"name": name, "data": data}
|
85 |
|
86 |
|
87 |
-
def run(search_prompt):
|
88 |
mid_seq = []
|
89 |
-
max_len = gen_events
|
90 |
|
91 |
disable_patch_change = False
|
92 |
disable_channels = None
|
93 |
if tab == 0:
|
94 |
mid_seq = []
|
|
|
|
|
|
|
|
|
95 |
|
96 |
elif mid is not None:
|
97 |
mid_seq = MIDI.midi2score(mid)
|
98 |
|
99 |
init_msgs = [create_msg("visualizer_clear", None)]
|
100 |
-
for
|
101 |
-
|
102 |
-
yield mid_seq, None, None, init_msgs
|
103 |
|
104 |
for i in range(len(mid_seq)):
|
105 |
yield mid_seq, None, None, [create_msg("visualizer_append", mid_seq[i]), create_msg("progress", [i + 1, len(mid_seq)])]
|
|
|
14 |
in_space = os.getenv("SYSTEM") == "spaces"
|
15 |
|
16 |
|
17 |
+
def find_midi():
|
|
|
18 |
if disable_channels is not None:
|
19 |
disable_channels = [tokenizer.parameter_ids["channel"][c] for c in disable_channels]
|
20 |
else:
|
|
|
83 |
return {"name": name, "data": data}
|
84 |
|
85 |
|
86 |
+
def run(search_prompt, mid=None):
|
87 |
mid_seq = []
|
|
|
88 |
|
89 |
disable_patch_change = False
|
90 |
disable_channels = None
|
91 |
if tab == 0:
|
92 |
mid_seq = []
|
93 |
+
|
94 |
+
for m in meta_data:
|
95 |
+
mid_seq.extend([m[1][17:-1]])
|
96 |
+
break
|
97 |
|
98 |
elif mid is not None:
|
99 |
mid_seq = MIDI.midi2score(mid)
|
100 |
|
101 |
init_msgs = [create_msg("visualizer_clear", None)]
|
102 |
+
# for events in mid_seq:
|
103 |
+
# init_msgs.append(create_msg("visualizer_append", events))
|
104 |
+
# yield mid_seq, None, None, init_msgs
|
105 |
|
106 |
for i in range(len(mid_seq)):
|
107 |
yield mid_seq, None, None, [create_msg("visualizer_append", mid_seq[i]), create_msg("progress", [i + 1, len(mid_seq)])]
|