so i made this program where it take a guitar tab and gets the fret number and runs it through a dictionary which gets the note and searches for it in the uke note dictionary.
but my probleme is if i have a tab in a txt file ex:
|-----11----------11----------11------11--13--11----------11----------11----------11------11--13--11---------------|
|-------13----------13----------13--------------------------13----------13----------13-----------------------------|
|--13-----13---13-----13---12-----12---------------12-13------13---13-----13---12-----12--------------------------|
|------------------------------------------------------------------------------------------------------------------|
|------------------------------------------------------------------------------------------------------------------|
|------------------------------------------------------------------------------------------------------------------|
So what i would want would be to open the txt file and put a letter in front of each number corosponding with the line. so every number on the first line would have say a “e”,second line:”B” and third:”G”
And have it in order so that the end result would be: G13 e11 B13 G13 etc…
Any ideas?
For the parsing, write a function that takes a line of tabs and a note, that yields the frets along with the position:
For the first line,
|-----11--, this will yield(6, "e11"). The tuples can be used later to sort all notes on all strings.Now just
open()the file, read in the first 6 lines and give them the correct names: