Play any song in video. Take a midi of the song, a video of yourself playing individual notes, and witness the magic.
- Make a virtual environment (
python3 -m venv .
, etc.). pip3 install -r requirements.txt
- Record yourself playing an instrument one note at a time, ascending a half step at a time, with silences in between.
- Use audiosegmentation.py to find where each note starts:
python3 audiosegmentation.py -i original/flea.mp4 -l 28 -s 0.3 -w 0.7
- Probably fix the resulting csv (original/flea.csv in this case). If you played
n
notes, it should haven
rows withnotecode;time(s)
in each row (wherenotecode
is the midi code of the note). - Use editor.py to make the video:
python3 editor.py -c original/flea.mp4 -t original/flea.csv -v 1 -o output/classicalthumpfull.mp4 -m midis/Wooten,_Victor_-_Classical_Thump.mid
All scripts can be called with -h
to show the help.
- Mido: to parse the midi file and get the notes, times, etc.
- MoviePy: to split the original video in clips for each note, and compose them together to follow the song.
And, experimentally (for now):
- pyAudioAnalysis: to automate the process of generating the csv with the timestamps for each note, which is not fun to do by hand.