Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
a73b76e
1
Parent(s):
a462022
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,22 +90,24 @@ def GenerateMIDI(progress=gr.Progress()):
|
|
| 90 |
channel = 0
|
| 91 |
|
| 92 |
for ss in song:
|
|
|
|
|
|
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
time +=
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
dur = ((
|
| 101 |
-
vel = (((
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
channel = (
|
| 105 |
-
pitch = (
|
| 106 |
-
|
| 107 |
song_f.append(['note', int(time), int(dur), int(channel), int(pitch), int(vel) ])
|
| 108 |
-
|
| 109 |
output_signature = 'Allegro Music Transformer'
|
| 110 |
output_file_name = 'Allegro-Music-Transformer-Music-Composition'
|
| 111 |
track_name='Project Los Angeles'
|
|
|
|
| 90 |
channel = 0
|
| 91 |
|
| 92 |
for ss in song:
|
| 93 |
+
|
| 94 |
+
ss1 = int(ss)
|
| 95 |
|
| 96 |
+
if ss1 > 0 and ss1 < 256:
|
| 97 |
+
|
| 98 |
+
time += ss1 * 8
|
| 99 |
+
|
| 100 |
+
if ss1 >= 256 and ss1 < 1280:
|
| 101 |
+
|
| 102 |
+
dur = ((ss1-256) // 8) * 32
|
| 103 |
+
vel = (((ss1-256) % 8)+1) * 15
|
| 104 |
+
|
| 105 |
+
if ss1 >= 1280 and ss1 < 2816:
|
| 106 |
+
channel = (ss1-1280) // 128
|
| 107 |
+
pitch = (ss1-1280) % 128
|
| 108 |
+
|
| 109 |
song_f.append(['note', int(time), int(dur), int(channel), int(pitch), int(vel) ])
|
| 110 |
+
|
| 111 |
output_signature = 'Allegro Music Transformer'
|
| 112 |
output_file_name = 'Allegro-Music-Transformer-Music-Composition'
|
| 113 |
track_name='Project Los Angeles'
|