-
Notifications
You must be signed in to change notification settings - Fork 0
/
audio_conversions.py
45 lines (29 loc) · 1.45 KB
/
audio_conversions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from icecream import ic
import os,os.path
import time
import fluidsynth
from midi2audio import FluidSynth
def convert_audio():
fs = FluidSynth()
MIDI = os.listdir('/Users/martintin/Desktop/beat_generator/MIDI')
for i in MIDI:
midi_directory = '/Users/martintin/Desktop/beat_generator/MIDI/'
wav_directory = '/Users/martintin/Desktop/beat_generator/WAV'
input = os.path.join(midi_directory, i)
output = os.path.join(wav_directory, f"{i[:-4]}.wav")
fs.midi_to_audio(input, output)
print(MIDI)
MIDI = os.listdir('/Users/martintin/Desktop/beat_generator/MIDI')
WAV = os.listdir('/Users/martintin/Desktop/beat_generator/WAV')
mids = ['humop1-2.mid', "Willie-Fugal's-Blues.mid", 'flash3.mid', 'Bagatella op33 n3.mid', 'Cisneros_Zulay.mid', 'rac_op33_6_format0.mid', "I'mWaitingForTheDay.mid", 'Markus Schulz - The New World.mid']
fs = FluidSynth()
MIDI = os.listdir('/Users/martintin/Desktop/beat_generator/MIDI')
for i in mids:
midi_directory = '/Users/martintin/Desktop/beat_generator/MIDI/'
wav_directory = '/Users/martintin/Desktop/beat_generator/WAV'
input = os.path.join(midi_directory, i)
output = os.path.join(wav_directory, f"{i[:-4]}.wav")
fs.midi_to_audio(input, output)
#ic(len(os.listdir('/Users/martintin/Desktop/beat_generator/WAV')))
#ic(len(os.listdir('/Users/martintin/Desktop/beat_generator/MIDI')))
#I used my google email to submit class 1 homework. Can I switch to my other classkick account for future homework submissions?