Dmytro Lopushanskyy
commited on
Commit
·
358d884
1
Parent(s):
c12a65c
fix bugs
Browse files- app.py +4 -2
- requirements.txt +1 -2
- result.midi +0 -0
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import pickle
|
2 |
import pretty_midi
|
|
|
3 |
from music21 import *
|
4 |
from midi2audio import FluidSynth
|
5 |
|
@@ -143,7 +144,8 @@ def get_note_names(midi):
|
|
143 |
|
144 |
|
145 |
def process_input(input_midi_file, input_randomness, input_duration):
|
146 |
-
|
|
|
147 |
note_names = get_note_names(midi)
|
148 |
int_notes = [note_to_int[note_name] for note_name in note_names]
|
149 |
|
@@ -184,7 +186,7 @@ iface = gr.Interface(
|
|
184 |
],
|
185 |
outputs=["audio", "file"],
|
186 |
article=article,
|
187 |
-
|
188 |
)
|
189 |
|
190 |
iface.launch()
|
|
|
1 |
import pickle
|
2 |
import pretty_midi
|
3 |
+
import gradio as gr
|
4 |
from music21 import *
|
5 |
from midi2audio import FluidSynth
|
6 |
|
|
|
144 |
|
145 |
|
146 |
def process_input(input_midi_file, input_randomness, input_duration):
|
147 |
+
print(input_midi_file.name)
|
148 |
+
midi = converter.parse(input_midi_file.name)
|
149 |
note_names = get_note_names(midi)
|
150 |
int_notes = [note_to_int[note_name] for note_name in note_names]
|
151 |
|
|
|
186 |
],
|
187 |
outputs=["audio", "file"],
|
188 |
article=article,
|
189 |
+
# examples=['examples/mozart.midi']
|
190 |
)
|
191 |
|
192 |
iface.launch()
|
requirements.txt
CHANGED
@@ -6,5 +6,4 @@ midi2audio
|
|
6 |
spacy
|
7 |
transformers
|
8 |
gradio
|
9 |
-
pretty_midi
|
10 |
-
pypianoroll
|
|
|
6 |
spacy
|
7 |
transformers
|
8 |
gradio
|
9 |
+
pretty_midi
|
|
result.midi
ADDED
Binary file (2.05 kB). View file
|
|