Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -157,48 +157,65 @@ def GenerateGroove():
|
|
157 |
print('Rendering results...')
|
158 |
|
159 |
print('=' * 70)
|
160 |
-
print('Sample INTs',
|
161 |
print('=' * 70)
|
162 |
-
|
163 |
-
out1 = output
|
164 |
|
165 |
-
if len(
|
166 |
|
167 |
-
song =
|
168 |
song_f = []
|
169 |
|
170 |
time = 0
|
171 |
-
dur =
|
172 |
vel = 90
|
173 |
-
|
|
|
174 |
channel = 0
|
175 |
|
176 |
-
patches = [0
|
|
|
|
|
177 |
|
178 |
-
|
179 |
|
180 |
-
|
181 |
|
182 |
-
|
183 |
|
184 |
-
|
185 |
|
186 |
-
|
187 |
|
188 |
-
|
189 |
|
190 |
-
|
191 |
|
192 |
-
|
193 |
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
-
fn1 =
|
199 |
|
200 |
detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(song_f,
|
201 |
-
output_signature = '
|
202 |
output_file_name = fn1,
|
203 |
track_name='Project Los Angeles',
|
204 |
list_of_MIDI_patches=patches
|
|
|
157 |
print('Rendering results...')
|
158 |
|
159 |
print('=' * 70)
|
160 |
+
print('Sample INTs', outy[:12])
|
161 |
print('=' * 70)
|
|
|
|
|
162 |
|
163 |
+
if len(outy) != 0:
|
164 |
|
165 |
+
song = outy
|
166 |
song_f = []
|
167 |
|
168 |
time = 0
|
169 |
+
dur = 32
|
170 |
vel = 90
|
171 |
+
dvels = [100, 120]
|
172 |
+
pitch = 60
|
173 |
channel = 0
|
174 |
|
175 |
+
patches = [0, 10, 19, 24, 35, 40, 52, 56, 65, 9, 73, 0, 0, 0, 0, 0]
|
176 |
+
|
177 |
+
for ss in song:
|
178 |
|
179 |
+
if 0 <= ss < 128:
|
180 |
|
181 |
+
time += ss * 32
|
182 |
|
183 |
+
if 128 <= ss < 256:
|
184 |
|
185 |
+
song_f.append(['note', time, 32, 9, ss-128, dvels[(ss-128) % 2], 128])
|
186 |
|
187 |
+
if 256 < ss < 384:
|
188 |
|
189 |
+
dur = (ss-256) * 32
|
190 |
|
191 |
+
if 384 < ss < 1664:
|
192 |
|
193 |
+
chan = (ss-384) // 128
|
194 |
|
195 |
+
if chan == 11:
|
196 |
+
channel = 9
|
197 |
+
else:
|
198 |
+
if chan > 8:
|
199 |
+
channel = chan + 1
|
200 |
+
else:
|
201 |
+
channel = chan
|
202 |
|
203 |
+
if channel == 9:
|
204 |
+
patch = 128
|
205 |
+
else:
|
206 |
+
patch = channel * 8
|
207 |
+
|
208 |
+
pitch = (ss-384) % 128
|
209 |
+
|
210 |
+
vel = max(50, pitch)
|
211 |
+
|
212 |
+
song_f.append(['note', time, dur, channel, pitch, vel, patch])
|
213 |
+
|
214 |
|
215 |
+
fn1 = drums_score_fn
|
216 |
|
217 |
detailed_stats = TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(song_f,
|
218 |
+
output_signature = 'Groove Music Transformer',
|
219 |
output_file_name = fn1,
|
220 |
track_name='Project Los Angeles',
|
221 |
list_of_MIDI_patches=patches
|