Transposing previously written vextab code

64 views
Skip to first unread message

Paul Schofield

unread,
Oct 1, 2016, 2:05:27 PM10/1/16
to vexflow
So I'm working on some tabs that I'd like the end user to be able to transpose to different keys on-the-fly on my web page. 

I'm looking for some advice on the best way to handle this. I'd prefer not to have to manually transpose every tab, but to have a general solution. Are there hooks in VexTab where I could transpose after my vextab is parsed but before it's rendered? Or should I write something on the server side to transpose my vextab before it's sent down with the web page?

Thanks for your help!
Paul Schofield

Paul Schofield

unread,
Oct 1, 2016, 3:10:41 PM10/1/16
to vexflow
I'm also looking to transpose fretboard diagrams as well.

Should I just drop down to the javascript API rather than try to use VexTab and fretboard syntax for this particular application?

John Watson

unread,
Oct 2, 2016, 3:01:36 PM10/2/16
to vexflow
It's probably not what you wish to hear, but I would recommend representing your score in some more abstract manner where transposition would be relatively easy and then translating this to VexTab.  I've taken this approach using an abstract representation of the ABC notation.  If you define your data structures carefully then transposition becomes tricky but not impossible.  I have an example of this in an ABC editor and if you're unfamiliar with ABC, here's a tutorial. 

Paul Schofield

unread,
Oct 5, 2016, 11:20:45 AM10/5/16
to vexflow
Thanks John, I will check it out. It looks like there's good interoperability with MusicXML there, lots of command line converters available. I'm also looking at a library called teoria that looks like it might be useful somewhere in the mix. For my application, I don't really need to do full blown tunes, but just sequences of notes like scales, arpeggios and scale sequences that I can build tab and fretboard diagrams with.  Basically I want to easily generate guitar and bass exercises like all the notes in a scale in a given fretboard position or chord tones in a position, etc.
Reply all
Reply to author
Forward
0 new messages