My first code turned into a horrible mess; for example, the NoteToken class was returned from the regex-based parsing code. This class ended up with attributes for the note's pitch and duration, and also had an as_svg() method. Yuck!
In the past two weeks I've cleaned things up and resumed making progress.
After rewriting the parser using PLY, there are now
separate Note and NoteGlyph classes, and the parser tokens are no longer also responsible for rendering. This week I've implemented a few symbols, accidentals, and chords.
Here's an SVG example; it should appear in Firefox, Opera, and probably in Safari. If you're using Internet Explorer, sorry; I'll eventually set up an SVG to PNG conversion, but not right now. The music isn't anything in particular, just random things that exercise various parts of the code. The blue border is added for debugging purposes, eventually I'll take it out. The bass clef symbol appears in Opera, but not in Firefox 3.0 or Safari; I'll worry about that later (and maybe Firefox 3.1 will fix it!).
ABC is a complicated format and only a very small subset of it is implemented, but I'm getting close to being able to typeset the beginner- or intermedate-level cello music that I play. The two big missing things are drawing the beams between notes, and drawing slurs across a set of notes; those two features are a little frightening. My plan is to introduce BeamedNote and SlurredNote,
turning the flat list of note glyphs into a tree. We'll see how that goes.