Obviously, vacation is never fun without a few good coding sprints. I started work on incorporating standard notation into VexTab.
The first thing I needed to do was create a class to convert fret-string pairs to notes. In order to support alternate tunings, I created a Tuning class, whose sole responsibility is to return the correct note for a given fret-string pair, based on the instrument type and tuning.
So, to convert the fret-string pair "5/2" on a 5-string bass to standard notation, all I need to do is:
var tuning = new Vex.Flow.Tuning("G/4,D/4,A/3,E/3,B/2"); var note = tuning.getNoteForFret(5, 2);
The next part was augmenting the language to render standard notation when requested. I modified tabstave to accept key=value parameters, and added a parameter called notation. When set to true, it renders standard notation above the guitar tab.
|VexTab with Standard Notation|
I also started work on basic duration support and auto-beaming. I don't have much to show for this yet, because they're currently a bit intertwined, and automatic beaming is harder than I anticipated (yet again!)
In other news, I open sourced the VexTab parser, so you can learn more about the language or use it in your own rendering engines. It is currently slightly coupled to VexFlow, but pretty trivial to decouple. (I'm going to fully decouple it as this project progresses.)
The parser is licensed under the MIT license, and is available on GitHub at: http://github.com/0xfe/vex/tree/master/vextab/.
Finally, some readers who liked my previous Chrome Poster from Source Code post requested posters for other open-source projects. I generated posters for Firefox, Linux, and FreeBSD, and made them available on my other side project: Wicked Mean Posters.
|Firefox Poster from Source Code|
More next time!