-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhit_machine
executable file
·48 lines (39 loc) · 1.38 KB
/
hit_machine
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
46
47
48
#!/usr/bin/bash
# - Generate the song midi
# - Generate the song wav
# - Download images for the search
# - Generate separate album art images
# - combine the albums art images into a video plus music
SOUNDFONT="/usr/share/soundfonts/FluidR3_GM.sf2"
SEARCH=$1
mkdir -p hits
echo "Generating Midi"
python music.py --save "hits/${SEARCH}.mid" -m -b 120
echo "Converting MIDI to WAV"
fluidsynth \
-a pulseaudio \
-g 5 \
-m alsa_seq \
-l \
-i $SOUNDFONT \
-F "hits/${SEARCH}.wav" \
"hits/${SEARCH}.mid" \
> /dev/null 2> /dev/null \
echo "Downloading Album Art Base Images"
python art.py -s $SEARCH -d | lolcat
echo "Generating Art From Base Images"
python art.py -s $SEARCH | lolcat
echo "Generating Art From Base Images"
ffmpeg \
-r 1 \
-f image2 \
-s 1920x1080 \
-pattern_type glob \
-i "images/${SEARCH}/album_art/*.*.jpg" \
-vcodec libx264 \
"hits/${SEARCH}.mp4" | pv -s $(ls -1 "images/${SEARCH}/album_art")
echo "Combing Images and Sound into Music Video"
ffmpeg \
-i "hits/${SEARCH}.wav" \
-i "hits/${SEARCH}.mp4" \
"hits/${SEARCH}_music_video.mp4"