MidiTabGen is a program that generates guitar tablature for a user-supplied MIDI sequence file. Tablature is a format for writing music which shows the instrumentalist which strings to hit, and where on the neck to hold the strings down. It is very popular among the guitar community.
By the nature of the guitar, and most stringed instruments, there are several ways to play most notes. Middle C, for example, can be played on every string except for the first string, given that you have a six-string guitar in standard tuning. This is done by holding down different frets - the first fret on the second string, the fifth fret on the third string, and so on. So, the challenge with writing good tablature is to carefully choose how each note will be played so that the player will have as little difficulty as possible playing the song. To this end, I wrote a simple algorithm that, based on the string and fret of the previous note, determines the "burden" of moving to hit a note on another given string and fret. The program evaluates all possible positions in which to play the next note, and chooses the one with the least "burden". It tries to avoid moving the left hand up and down the neck too much, but balances this with avoiding making the player jump over several strings between notes. The algorithm needs some refinement, but has been able to do a reasonably good job with most of the inputs I've given it.
When the user launches the program, a command line appears, prompting the user to drag and drop a MIDI sequence file onto the command line window and press "enter". The program will be given a path to the specified file, and then ask the user which track in the file they would like tablature for, and how many octaves to shift up or down. After this, the program will create a text file containing tablature in the same folder as the MIDI file.
I plan to add support for alternate tunings soon. I just need to figure out a user-friendly way to specify tunings.
I used the Midifile midi library for this project to parse MIDI files.
Log in or sign up for Devpost to join the conversation.