Spaces:
Build error
Build error
juancopi81
commited on
Commit
·
3356573
1
Parent(s):
013f12b
Improve description and add RANDOM to seed
Browse files
main.py
CHANGED
@@ -14,10 +14,11 @@ os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
|
|
14 |
|
15 |
DESCRIPTION = """
|
16 |
<h1>🎵 Multitrack Midi Generator 🎶</h1>
|
17 |
-
<
|
|
|
18 |
|
19 |
<div style="display: flex; justify-content: space-between;">
|
20 |
-
<div style="width:
|
21 |
<h2>Features:</h2>
|
22 |
<ul>
|
23 |
<li>🎼 Select the genre for the music.</li>
|
@@ -26,9 +27,9 @@ DESCRIPTION = """
|
|
26 |
<li>🎹 Use the buttons to generate a new song from scratch, continue generation with the current settings, remove the last added instrument, regenerate the last added instrument with a new one, or change the tempo of the current song.</li>
|
27 |
</ul>
|
28 |
</div>
|
29 |
-
<div style="width:
|
30 |
<h2>Outputs:</h2>
|
31 |
-
The app outputs the following
|
32 |
<ul>
|
33 |
<li>🎧 The audio of the generated song.</li>
|
34 |
<li>📁 A MIDI file of the song.</li>
|
@@ -38,9 +39,13 @@ DESCRIPTION = """
|
|
38 |
</ul>
|
39 |
</div>
|
40 |
</div>
|
41 |
-
|
|
|
|
|
|
|
42 |
"""
|
43 |
|
|
|
44 |
genres = ["ROCK", "POP", "OTHER", "R&B/SOUL", "JAZZ", "ELECTRONIC", "RANDOM"]
|
45 |
|
46 |
demo = gr.Blocks()
|
|
|
14 |
|
15 |
DESCRIPTION = """
|
16 |
<h1>🎵 Multitrack Midi Generator 🎶</h1>
|
17 |
+
<h3>AI-driven Music Composer: Creating Melodies One Instrument at a Time!</h3>
|
18 |
+
<p>This interactive application uses an AI model to generate music sequences based on a chosen genre and various user inputs. The apps constructs the piece instrument by instrument</p>
|
19 |
|
20 |
<div style="display: flex; justify-content: space-between;">
|
21 |
+
<div style="width: 45%; margin-right: 5%;">
|
22 |
<h2>Features:</h2>
|
23 |
<ul>
|
24 |
<li>🎼 Select the genre for the music.</li>
|
|
|
27 |
<li>🎹 Use the buttons to generate a new song from scratch, continue generation with the current settings, remove the last added instrument, regenerate the last added instrument with a new one, or change the tempo of the current song.</li>
|
28 |
</ul>
|
29 |
</div>
|
30 |
+
<div style="width: 45%; margin-left: 5%;">
|
31 |
<h2>Outputs:</h2>
|
32 |
+
<p>The app outputs the following:</p>
|
33 |
<ul>
|
34 |
<li>🎧 The audio of the generated song.</li>
|
35 |
<li>📁 A MIDI file of the song.</li>
|
|
|
39 |
</ul>
|
40 |
</div>
|
41 |
</div>
|
42 |
+
|
43 |
+
<p>This application is built upon the inspiring work of <a href="https://www.linkedin.com/in/dr-tristan-behrens-734967a2" target="_blank">Dr. Tristan Behrens</a></p>
|
44 |
+
|
45 |
+
<p>Enjoy creating your own music!</p>
|
46 |
"""
|
47 |
|
48 |
+
|
49 |
genres = ["ROCK", "POP", "OTHER", "R&B/SOUL", "JAZZ", "ELECTRONIC", "RANDOM"]
|
50 |
|
51 |
demo = gr.Blocks()
|
utils.py
CHANGED
@@ -32,7 +32,10 @@ def create_seed_string(genre: str = "OTHER") -> str:
|
|
32 |
Returns:
|
33 |
str: The seed string.
|
34 |
"""
|
35 |
-
|
|
|
|
|
|
|
36 |
return seed_string
|
37 |
|
38 |
|
|
|
32 |
Returns:
|
33 |
str: The seed string.
|
34 |
"""
|
35 |
+
if genre == "RANDOM":
|
36 |
+
seed_string = "PIECE_START"
|
37 |
+
else:
|
38 |
+
seed_string = f"PIECE_START GENRE={genre} TRACK_START"
|
39 |
return seed_string
|
40 |
|
41 |
|