Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -282,14 +282,11 @@ def Generate_Rock_Song(input_midi,
|
|
282 |
print('Rendering results...')
|
283 |
|
284 |
print('=' * 70)
|
285 |
-
print('Sample INTs',
|
286 |
print('=' * 70)
|
287 |
|
288 |
-
|
289 |
-
|
290 |
-
if len(out1) != 0:
|
291 |
|
292 |
-
song = out1
|
293 |
song_f = []
|
294 |
|
295 |
time = 0
|
@@ -298,7 +295,8 @@ def Generate_Rock_Song(input_midi,
|
|
298 |
pitch = 60
|
299 |
vel = 90
|
300 |
|
301 |
-
patches = [0, 10, 19, 24, 35, 40, 52, 56, 65, 9,
|
|
|
302 |
|
303 |
for ss in song:
|
304 |
|
@@ -308,7 +306,7 @@ def Generate_Rock_Song(input_midi,
|
|
308 |
|
309 |
if 128 < ss < 256:
|
310 |
|
311 |
-
song_f.append(['note', time, 32, 9, ss-128,
|
312 |
|
313 |
if 256 < ss < 544:
|
314 |
|
@@ -321,7 +319,7 @@ def Generate_Rock_Song(input_midi,
|
|
321 |
|
322 |
pitch = ss-544
|
323 |
|
324 |
-
song_f.append(['note', time, dur, channel, pitch,
|
325 |
|
326 |
song_f, patches, overflow_patches = TMIDIX.patch_enhanced_score_notes(song_f)
|
327 |
|
@@ -386,6 +384,7 @@ if __name__ == "__main__":
|
|
386 |
app = gr.Blocks()
|
387 |
|
388 |
with app:
|
|
|
389 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Guided Rock Music Transformer</h1>")
|
390 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Generate unique rock music compositions with source augmented RoPE music transformer</h1>")
|
391 |
gr.Markdown(
|
@@ -420,11 +419,13 @@ if __name__ == "__main__":
|
|
420 |
[output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
|
421 |
|
422 |
gr.Examples(
|
423 |
-
[["Sharing The Night Together.kar",
|
|
|
424 |
],
|
425 |
-
[
|
426 |
-
|
427 |
-
|
|
|
428 |
],
|
429 |
[output_midi_title, output_midi_summary, output_midi, output_audio, output_plot],
|
430 |
Generate_Rock_Song,
|
|
|
282 |
print('Rendering results...')
|
283 |
|
284 |
print('=' * 70)
|
285 |
+
print('Sample INTs', song[:15])
|
286 |
print('=' * 70)
|
287 |
|
288 |
+
if len(song) != 0:
|
|
|
|
|
289 |
|
|
|
290 |
song_f = []
|
291 |
|
292 |
time = 0
|
|
|
295 |
pitch = 60
|
296 |
vel = 90
|
297 |
|
298 |
+
patches = [0, 10, 19, 24, 35, 40, 52, 56, 65, 9, 0, 0, 0, 0, 0, 0]
|
299 |
+
velocities = [80, 100, 90, 100, 110, 100, 100, 100, 100, 110]
|
300 |
|
301 |
for ss in song:
|
302 |
|
|
|
306 |
|
307 |
if 128 < ss < 256:
|
308 |
|
309 |
+
song_f.append(['note', time, 32, 9, ss-128, velocities[9], 128])
|
310 |
|
311 |
if 256 < ss < 544:
|
312 |
|
|
|
319 |
|
320 |
pitch = ss-544
|
321 |
|
322 |
+
song_f.append(['note', time, dur, channel, pitch, velocities[channel], patch])
|
323 |
|
324 |
song_f, patches, overflow_patches = TMIDIX.patch_enhanced_score_notes(song_f)
|
325 |
|
|
|
384 |
app = gr.Blocks()
|
385 |
|
386 |
with app:
|
387 |
+
|
388 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Guided Rock Music Transformer</h1>")
|
389 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Generate unique rock music compositions with source augmented RoPE music transformer</h1>")
|
390 |
gr.Markdown(
|
|
|
419 |
[output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
|
420 |
|
421 |
gr.Examples(
|
422 |
+
[["Sharing The Night Together.kar", False, 256, True, True],
|
423 |
+
["Hotel California.mid", False, 256, True, True],
|
424 |
],
|
425 |
+
[input_freestyle_continuation,
|
426 |
+
input_number_prime_chords,
|
427 |
+
input_use_original_durations,
|
428 |
+
input_match_original_pitches_counts,
|
429 |
],
|
430 |
[output_midi_title, output_midi_summary, output_midi, output_audio, output_plot],
|
431 |
Generate_Rock_Song,
|