Spaces:
Running
Running
asigalov61
commited on
Commit
•
c68d210
1
Parent(s):
9386e92
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import os.path
|
|
5 |
import time as reqtime
|
6 |
import datetime
|
7 |
from pytz import timezone
|
8 |
-
|
9 |
import gradio as gr
|
10 |
|
11 |
import random
|
@@ -100,7 +100,9 @@ def MixMelody(input_midi):
|
|
100 |
new_song = random.choice(matched_songs)
|
101 |
|
102 |
if new_song:
|
103 |
-
print(
|
|
|
|
|
104 |
|
105 |
trg_patch = new_song[1]
|
106 |
|
@@ -206,8 +208,10 @@ if __name__ == "__main__":
|
|
206 |
print('=' * 70)
|
207 |
|
208 |
soundfont = "SGM-v2.01-YamahaGrand-Guit-Bass-v2.7.sf2"
|
|
|
209 |
all_songs = TMIDIX.Tegridy_Any_Pickle_File_Reader('Monster_52905_Mono_Melodies_MIDI_Dataset')
|
210 |
-
|
|
|
211 |
app = gr.Blocks()
|
212 |
with app:
|
213 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Harmonic Melody MIDI Mixer</h1>")
|
@@ -222,7 +226,7 @@ if __name__ == "__main__":
|
|
222 |
|
223 |
input_midi = gr.File(label="Input MIDI", file_types=[".midi", ".mid", ".kar"])
|
224 |
|
225 |
-
run_btn = gr.Button("
|
226 |
|
227 |
gr.Markdown("## Output results")
|
228 |
|
|
|
5 |
import time as reqtime
|
6 |
import datetime
|
7 |
from pytz import timezone
|
8 |
+
import copy
|
9 |
import gradio as gr
|
10 |
|
11 |
import random
|
|
|
100 |
new_song = random.choice(matched_songs)
|
101 |
|
102 |
if new_song:
|
103 |
+
print('Selected Monster Mono Melodies MIDI:', new_song[0])
|
104 |
+
print('Selected melody instrument:', TMIDIX.Number2patch[new_song[1]], '(', new_song[1], ')')
|
105 |
+
print('Melody notes count:', new_song[2])
|
106 |
|
107 |
trg_patch = new_song[1]
|
108 |
|
|
|
208 |
print('=' * 70)
|
209 |
|
210 |
soundfont = "SGM-v2.01-YamahaGrand-Guit-Bass-v2.7.sf2"
|
211 |
+
|
212 |
all_songs = TMIDIX.Tegridy_Any_Pickle_File_Reader('Monster_52905_Mono_Melodies_MIDI_Dataset')
|
213 |
+
print('=' * 70)
|
214 |
+
|
215 |
app = gr.Blocks()
|
216 |
with app:
|
217 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Harmonic Melody MIDI Mixer</h1>")
|
|
|
226 |
|
227 |
input_midi = gr.File(label="Input MIDI", file_types=[".midi", ".mid", ".kar"])
|
228 |
|
229 |
+
run_btn = gr.Button("mix melody", variant="primary")
|
230 |
|
231 |
gr.Markdown("## Output results")
|
232 |
|