Spaces:
Running
on
Zero
Running
on
Zero
keshavbhandari
commited on
Commit
β’
2099bec
1
Parent(s):
df62afa
changing soundfont
Browse files- app.py +2 -2
- example.mid +0 -0
- soundfont.sf β soundfont.sf2 +2 -2
app.py
CHANGED
@@ -23,7 +23,7 @@ def save_wav(filepath):
|
|
23 |
|
24 |
# Run the fluidsynth command to convert MIDI to WAV
|
25 |
process = subprocess.Popen(
|
26 |
-
f"fluidsynth -r 16000 soundfont.
|
27 |
shell=True
|
28 |
)
|
29 |
process.wait()
|
@@ -49,7 +49,7 @@ def generate_midi(caption, temperature=0.9, max_len=500):
|
|
49 |
model.eval()
|
50 |
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-base")
|
51 |
|
52 |
-
caption = "A cinematic electronic soundtrack that evokes an epic and dark atmosphere, featuring cello, contrabass, and drums. The song is set in A minor with a moderate tempo and a 4/4 time signature, creating an emotional and action-packed ambiance suitable for film."
|
53 |
inputs = tokenizer(caption, return_tensors='pt', padding=True, truncation=True)
|
54 |
input_ids = nn.utils.rnn.pad_sequence(inputs.input_ids, batch_first=True, padding_value=0)
|
55 |
input_ids = input_ids.to(device)
|
|
|
23 |
|
24 |
# Run the fluidsynth command to convert MIDI to WAV
|
25 |
process = subprocess.Popen(
|
26 |
+
f"fluidsynth -r 16000 soundfont.sf2 -g 1.0 --quiet --no-shell {midi_filepath} -T wav -F {wav_filepath} > /dev/null",
|
27 |
shell=True
|
28 |
)
|
29 |
process.wait()
|
|
|
49 |
model.eval()
|
50 |
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-base")
|
51 |
|
52 |
+
# caption = "A cinematic electronic soundtrack that evokes an epic and dark atmosphere, featuring cello, contrabass, and drums. The song is set in A minor with a moderate tempo and a 4/4 time signature, creating an emotional and action-packed ambiance suitable for film."
|
53 |
inputs = tokenizer(caption, return_tensors='pt', padding=True, truncation=True)
|
54 |
input_ids = nn.utils.rnn.pad_sequence(inputs.input_ids, batch_first=True, padding_value=0)
|
55 |
input_ids = input_ids.to(device)
|
example.mid
CHANGED
Binary files a/example.mid and b/example.mid differ
|
|
soundfont.sf β soundfont.sf2
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a57fb3b6714e69dda12390e351b087e81fc3b1eca15c6b4bbe172799f4cf3cd
|
3 |
+
size 155405818
|