r/Python • u/TechDumbLogie • Aug 20 '22
Intermediate Showcase I made a bot that learns songs using online tutorials and generates videos of me playing guitar !
Hello everyone !
I have created a program in python that allows me to generate videos of myself playing the guitar!
What ?
Source code : https://github.com/HugoM25/GuitarBot
Here are two examples of videos generated by my program :
Wii sport theme cover (non edited background) : https://youtu.be/8GiqTDT1wqc
Coconut Mall cover (edited background) : https://youtu.be/g3jxPjvE8ag
from tutorial videos from this youtube channel : https://www.youtube.com/c/TabSheetMusic
Why ?
I have, for the most part, learned to play the guitar by myself and I used a lot of tutorials on youtube. When I started the easiest tutorials were the ones where the strings were displayed and you just had to read the tablature to know which note to play. Then I came across the Tab Sheet Music channel which releases videos daily and always follows the same style.
So I decided to reverse-engineer these videos in order to teach a bot the songs and make me play them on the guitar (Like the principle of 1% guitar skill and 99% editing skill).
How (roughly)
The program will look at each frame of the video and will look if the green cursor (supposed to indicate the notes to play) is located on a note and if it is the case then the bot will remember that it will have to play this note at this moment.
The program will then produce a .json file that will indicate how to generate the final video. It will then follow the instructions in the file using videos that I have carefully cut of me playing each note of my guitar fretboard (the 21 squares of each string so 21x6 notes) arriving at the final result.
