Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -19,9 +19,9 @@ def write_song():
|
|
19 |
return "tmp.mid","tmp.mid"
|
20 |
def write_song2():
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
|
26 |
bass1 = chord('A1') % (1,) * 4
|
27 |
bass2 = (chord('A1, A2') % (1/16, 1/8) * 4 |
|
@@ -55,14 +55,14 @@ def write_song2():
|
|
55 |
result = P(tracks=[bass_part, guitar_part, drum_part, synth_pad_part],
|
56 |
instruments=[34, 3, 1, 51],
|
57 |
channels=[0, 1, 9, 2],
|
58 |
-
|
59 |
start_times=[0, 0, 4, 8],
|
60 |
bpm=165)
|
61 |
#current_daw.play(result)
|
62 |
-
export(result, filename='song.wav') # export the piece type current_song to
|
63 |
# a wav file named "my first song.wav"
|
64 |
|
65 |
-
|
66 |
|
67 |
export(obj,
|
68 |
mode='wav',
|
@@ -77,7 +77,7 @@ def write_song2():
|
|
77 |
export_args={},
|
78 |
show_msg=False,
|
79 |
soundfont_args=None)
|
80 |
-
|
81 |
return 'song.wav'
|
82 |
|
83 |
|
@@ -122,5 +122,5 @@ with gr.Blocks() as iface:
|
|
122 |
btn=gr.Button()
|
123 |
outp=gr.Files()
|
124 |
aud=gr.Audio()
|
125 |
-
btn.click(
|
126 |
iface.launch()
|
|
|
19 |
return "tmp.mid","tmp.mid"
|
20 |
def write_song2():
|
21 |
|
22 |
+
current_daw = daw(3)
|
23 |
+
current_daw.load(0, )
|
24 |
+
current_daw.load(1, 'Arachno.sf2')
|
25 |
|
26 |
bass1 = chord('A1') % (1,) * 4
|
27 |
bass2 = (chord('A1, A2') % (1/16, 1/8) * 4 |
|
|
|
55 |
result = P(tracks=[bass_part, guitar_part, drum_part, synth_pad_part],
|
56 |
instruments=[34, 3, 1, 51],
|
57 |
channels=[0, 1, 9, 2],
|
58 |
+
daw_channels=[1, 0, 1, 1],
|
59 |
start_times=[0, 0, 4, 8],
|
60 |
bpm=165)
|
61 |
#current_daw.play(result)
|
62 |
+
current_daw.export(result, filename='song.wav') # export the piece type current_song to
|
63 |
# a wav file named "my first song.wav"
|
64 |
|
65 |
+
'''
|
66 |
|
67 |
export(obj,
|
68 |
mode='wav',
|
|
|
77 |
export_args={},
|
78 |
show_msg=False,
|
79 |
soundfont_args=None)
|
80 |
+
'''
|
81 |
return 'song.wav'
|
82 |
|
83 |
|
|
|
122 |
btn=gr.Button()
|
123 |
outp=gr.Files()
|
124 |
aud=gr.Audio()
|
125 |
+
btn.click(write_song2,None,[outp,aud])
|
126 |
iface.launch()
|