How things work...
step #1 : parboiled parse the source ABC string into a node structure
I convert into my own node structure (called AbcNode) which has more
useful methods
For example, the beginning of an ABC file :
X:1
T:Bu\vcimi\vs
Z:Tous aux Balkans !
F:
http://www.tousauxbalkans.net/Bucimis
O:Bulgarie
Q:1/4=104
P:AABCDEFGAB
M:15/16
L:1/16
%%MIDI gchord f2czf2c2fzcfzcz
K:Bm
P:A
|: "Bm"B2(ef) (fB)(fB) (Pf2e) ({f}edef) | .d2.c2 .d2Pc2 (A^GA)
PB2(BF) :|
the resulting AbcNode structure :
http://www.tousauxbalkans.net/files/nodestructure.txt
(19KB)
This first step is complete. I checked the grammar against a lot of
ABC files, still some tests to do.
If you want to quickly retrieve informations in ABC file, you can stop
at this step, and pick out the nodes you need, e.g.
myAbcRootNode.getChildsInAllGeneration("FieldTitle/TexText") will
return all TexText node which are child of a FieldTitle node... in
other word, all values of these nodes are the titles and subtitles of
the ABC tune. Powerful, isn't it?
step #2 :
The AbcParserAbstract converts the node structure into Tune, Parts,
Voices, Music, Notes, Barlines, KeySignature...
Excepted Voice, meta-command, userdefined symbols, lyrics..., this
step is mostly complete.
e.g. When abc.notation.* will handle lyrics, it'll be easy to convert
lyrics node to abc.notation.* classes. In the grammar, lyrics are
already prepared as syllable, syllable-break, hold, skip-note, next-
bar.
TuneParserListeners are used during step #2 but as step #2 does less
things than the old parse (equivalent of #1 + #2), some listener
method are no more used.
e.g. no need to keep a track of errors during parsing. at tuneEnd()
you have the parsed Tune and the AbcNode structure of step #1 where
you can read errors.
The TuneEditorPane was simplified.
Before commiting to SVN, I have to work on
- TuneBook parser, a abc.notation.TuneBook object ?
- the abcynth package to apply the listener changes.
step #3 - rendering :
Once you have a abc.notation.Tune object, you can generate midi,
graphical output.
This has not changed a lot. Some bugfix in graphical output (e.g. more
barline types).