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.

5
u/UnClean_Committee Aug 20 '22
Would it be possible for more complicated tracks (like metal for example) to upload a tab into the software and have it generate a video?
6
u/TechDumbLogie Aug 20 '22
Well, for the "learning" part, the software can only generate instructions from the tab sheet music channel (there are some metal tracks like Metallica songs, simplified though). However the generation part works with a json file so you can write your own tracks as json and use them in the software. At the moment the style effects like slides, bends, etc... are not supported (mostly because they are never used in the tutorial videos from this channel)
3
u/cheesestick77 Aug 21 '22
This is the kind of creativity that Python is made for!! Please keep posting, would love to keep up with how the project progresses.
1
u/TechDumbLogie Aug 21 '22
Thanks ! I have some ideas to improve the project, we'll see where it goes !
3
u/A-Dime-A-Dirty-Dozen Aug 21 '22
This is one of the coolest things I’ve ever seen. I was so hype as soon as the first video started
1
1
-3
10
u/UnClean_Committee Aug 20 '22
Whaaaaaaat the fuuuuuuck. Dude. You are awesome! As a guitarist and a lover of programming (that is to say, i love what people do with it and its endless potential, i cannot code for my life) this is like finding pandoras box.