Spaces:
Running
Running
asigalov61
commited on
Commit
•
f5bb777
1
Parent(s):
a9ed318
Update app.py
Browse files
app.py
CHANGED
@@ -102,9 +102,11 @@ def run(search_prompt, mid=None):
|
|
102 |
init_msgs.append(create_msg("visualizer_append", event))
|
103 |
yield mid_seq, None, None, init_msgs
|
104 |
|
|
|
105 |
for i in range(len(mid_seq)-1):
|
106 |
if mid_seq[i][0] == 'note':
|
107 |
-
yield mid_seq, None, None, [create_msg("visualizer_append", mid_seq[i]), create_msg("progress", [
|
|
|
108 |
|
109 |
with open(f"output.mid", 'wb') as f:
|
110 |
f.write(MIDI.score2midi([mid_seq_ticks, mid_seq]))
|
|
|
102 |
init_msgs.append(create_msg("visualizer_append", event))
|
103 |
yield mid_seq, None, None, init_msgs
|
104 |
|
105 |
+
j = 0
|
106 |
for i in range(len(mid_seq)-1):
|
107 |
if mid_seq[i][0] == 'note':
|
108 |
+
yield mid_seq, None, None, [create_msg("visualizer_append", mid_seq[i]), create_msg("progress", [j + 1, len(mid_seq)])]
|
109 |
+
j += 1
|
110 |
|
111 |
with open(f"output.mid", 'wb') as f:
|
112 |
f.write(MIDI.score2midi([mid_seq_ticks, mid_seq]))
|