Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -144,7 +144,14 @@ def GenerateMIDI(num_tok, idrums, iinstr):
|
|
144 |
if 1280 <= ss1 < 2816:
|
145 |
channel = (ss1 - 1280) // 128
|
146 |
pitch = (ss1 - 1280) % 128
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
output[-1].append(event)
|
149 |
|
150 |
midi_data = TMIDIX.score2midi(output, text_encoding)
|
|
|
144 |
if 1280 <= ss1 < 2816:
|
145 |
channel = (ss1 - 1280) // 128
|
146 |
pitch = (ss1 - 1280) % 128
|
147 |
+
|
148 |
+
if channel != 9:
|
149 |
+
pat = list_of_MIDI_patches[channel]
|
150 |
+
else:
|
151 |
+
pat = 128
|
152 |
+
|
153 |
+
event = ['note', ctime, dur, channel, pitch, vel, pat]
|
154 |
+
|
155 |
output[-1].append(event)
|
156 |
|
157 |
midi_data = TMIDIX.score2midi(output, text_encoding)
|