Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -149,10 +149,10 @@ def GenerateMIDI(num_tok, idrums, iinstr):
|
|
149 |
|
150 |
midi_data = TMIDIX.score2midi(output, text_encoding)
|
151 |
|
152 |
-
with open(f"Allegro-Music-Transformer-
|
153 |
f.write(midi_data)
|
154 |
|
155 |
-
output_plot = TMIDIX.plot_ms_SONG(output, plot_title='Allegro-Music-Transformer-
|
156 |
|
157 |
audio = midi_to_colab_audio(new_fn,
|
158 |
soundfont_path="SGM-v2.01-YamahaGrand-Guit-Bass-v2.7.sf2",
|
@@ -169,7 +169,7 @@ def GenerateMIDI(num_tok, idrums, iinstr):
|
|
169 |
print('-' * 70)
|
170 |
print('Req execution time:', (time.time() - start_time), 'sec')
|
171 |
|
172 |
-
return output_plot, "Allegro-Music-Transformer-
|
173 |
|
174 |
# =================================================================================================
|
175 |
|
|
|
149 |
|
150 |
midi_data = TMIDIX.score2midi(output, text_encoding)
|
151 |
|
152 |
+
with open(f"Allegro-Music-Transformer-Composition.mid", 'wb') as f:
|
153 |
f.write(midi_data)
|
154 |
|
155 |
+
output_plot = TMIDIX.plot_ms_SONG(output[2], plot_title='Allegro-Music-Transformer-Composition', return_plt=True)
|
156 |
|
157 |
audio = midi_to_colab_audio(new_fn,
|
158 |
soundfont_path="SGM-v2.01-YamahaGrand-Guit-Bass-v2.7.sf2",
|
|
|
169 |
print('-' * 70)
|
170 |
print('Req execution time:', (time.time() - start_time), 'sec')
|
171 |
|
172 |
+
return output_plot, "Allegro-Music-Transformer-Composition.mid", (16000, audio)
|
173 |
|
174 |
# =================================================================================================
|
175 |
|