Spaces:
Runtime error
Runtime error
Add article.
Browse files
app.py
CHANGED
|
@@ -131,10 +131,20 @@ def process_midi(MIDI_File, Text_to_Sonify, Randomness, Amount_of_Music_to_Add):
|
|
| 131 |
FluidSynth(sound_font).midi_to_audio('result.midi', 'result.wav')
|
| 132 |
return 'result.wav'
|
| 133 |
|
| 134 |
-
midi_file_desc = """Upload your own MIDI file here.
|
| 135 |
If you do not have a MIDI file, add some text and we will turn it into music!
|
| 136 |
"""
|
| 137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
iface = gr.Interface(
|
| 139 |
fn=process_midi,
|
| 140 |
inputs=[
|
|
@@ -144,6 +154,7 @@ iface = gr.Interface(
|
|
| 144 |
gr.inputs.Radio([100, 200, 500], type="value", default=100)
|
| 145 |
],
|
| 146 |
outputs="audio",
|
|
|
|
| 147 |
# examples=['C major scale.midi']
|
| 148 |
)
|
| 149 |
|
|
|
|
| 131 |
FluidSynth(sound_font).midi_to_audio('result.midi', 'result.wav')
|
| 132 |
return 'result.wav'
|
| 133 |
|
| 134 |
+
midi_file_desc = """Upload your own MIDI file here (try to keep it small without any fun time signatures).
|
| 135 |
If you do not have a MIDI file, add some text and we will turn it into music!
|
| 136 |
"""
|
| 137 |
|
| 138 |
+
article = """# Pop Music Transformer
|
| 139 |
+
We are using a language model to create music by treating a musical standard MIDI a simple text, with tokens for note values, note duration, and separations to denote movement forward in time.
|
| 140 |
+
|
| 141 |
+
This is all following the great work you can find [at this repo](https://github.com/bearpelican/musicautobot). Moreover check out [their full web app](http://musicautobot.com/). We use the pretrained model they created as well as the utilities for converting between MIDI, audio streams, numpy encodings, and WAV files.
|
| 142 |
+
|
| 143 |
+
## Sonification
|
| 144 |
+
|
| 145 |
+
This is the process of turning something not inherently musical into music. Here we do something pretty simple. We take your input text "pretty cool", get a sentiment score (hard coded right now, model TODO), and use a major progression if it's positive and a minor progression if it's negative, and then factor the score into the randomness of the generated music. We also take the text and extract a melody by taking any of the letters from A to G, which in the example is just "E C". With the simple "E C" melody and a major progression a musical idea is generated.
|
| 146 |
+
"""
|
| 147 |
+
|
| 148 |
iface = gr.Interface(
|
| 149 |
fn=process_midi,
|
| 150 |
inputs=[
|
|
|
|
| 154 |
gr.inputs.Radio([100, 200, 500], type="value", default=100)
|
| 155 |
],
|
| 156 |
outputs="audio",
|
| 157 |
+
article=article
|
| 158 |
# examples=['C major scale.midi']
|
| 159 |
)
|
| 160 |
|