Hi !
I've just commited into the SVN a first version of tablature,
fingerings are generated randomly, I'll let you improve this if you
have idea on how to achieve it.
I focused on rendering.
You attach a tablature to a voice (for now, there is only one voice in
graphic/midi output, but there are in music model) :
myMusic.getVoice("1").setTablature(abc.notation.Tablature.GUITAR);
"1" is the default name of the first voice.
I didn't find anything in ABC standard that tells the software to
render a tablature. We can imagine %% meta command, but as I said, I
focused on graphical rendering.
A Tablature object is made of notes, number of fret, and we may add
some settings, see comments in .computeFingerings()
I made some example : mandolin, bouzouki, charango and banjo are good
ones with strings not in ascending/descending order!
JTune.compute() calls the tablature string & fingerings computation
A JTablature is attached to a JStaffLine in JTune.initNewStaffLine()
in this method you have currentStaffLine.getBottomY() which give the Y
bottom position of the current staff line (not the one being
initialised), which take into account the tablature space and height,
and add the STAFF_LINE_SPACING template attribute.
About template attribute, a Tune object can be built from ABC parsing,
but also directly by programming, and using template. ABC parsing
should take into account %% meta command about fonts, spacings... but
this is not yet done... and not the priority
How to render things on tablature, 2 ways :
1) JTablature.renderNote - which is the most important : for the given
note, read the string/finger stored in a map by
Tablature.computeFingerings(), and render the number at the right
position. Called by JNote.render() :
getStaffLine().getTablature().renderNote()
2) JBar.render draws barlines on staff and also tablature. Another
class should do the same, JTimeSignature? JDecoration, JRepeatBar ( |
1, :|2...)
Mechanisms could be easily extended to other kind of tablature (why
note?), lyrics...
Enjoy!