Saturday, September 20, 2008

HNotate

Copperbox revision 262.

The LilyPond backend now uses the print monad. It doesn't yet handle beaming - I'll have think about how to handle LilyPond's mixfix grouping where a triplet is - c [e g].

HNotate

Copperbox revision 261.

The Abc backend now uses a new output scheme which allows it do beaming.

Previously the output built a pretty printed Doc that was wrapped up with a phantom type layer. With the change to using score file templates there is not so much need for this phantom typed doc - HNotate doesn't export the phantom typed doc to users so the responsibility to generate correct output is entirely internal. And it had always felt very heavyweight, as my struggles to get it to do what I wanted showed.

So now its being replaced by a State monad that works like the Writer monad, but with some quirks - the output can't be an instance of Monoid because the append operation has to be controllable on the fly. This is how Abc beaming works - at the start of the beam group the append operator is changed from (<+>) spaced, to (<>) no space then reverted to spaced at the end of the beam.

The next step is to change the LilyPond backend, which will hopefully corroborate the advantages of the new scheme.

Friday, September 19, 2008

HNotate

Copperbox revision 260.

I've revised the ToNoteList module of HNotate and it now brackets notes into groups when the consecutive durations are less than a quarter - then they can be beamed in the output.

Unfortunately, neither the Abc or LilyPond backends support beaming yet. LilyPond brackets a beam group after the first note so a triplet would be c [e g], whereas HNotate has them [c e g] - clearly a translation would be quite easy for this one. Abc is more tricky - beaming is indicated by the absence of a space separator between notes. To get this right I will probably have to change the Abc pretty print combinators.

Wednesday, September 17, 2008

HNotate

Copperbox revision 259.

Abc output now has durations.

HNotate

Copperbox revision 258.

I've added an initial mechanism for pitch name naturalization to the Abc output so that accidentals aren't printed when they are already accounted for by the key signature. So far this is only done for two keys as I'm not sure whether to enumerate all the keys 'by hand' or take some of the interval code from Bala and construct the pitch spellings from interval patterns.

The Abc output still doesn't calculate durations properly as this is more involved than with LilyPond, that looks like the next thing to do.

Tuesday, September 16, 2008

HNotate

Copperbox revision 257.

I've updated the traversals including a composed traversal for LilyPond. This has neatened up the code somewhat.

Monday, September 15, 2008

HNotate

Copperbox revision 256.

I've started work on sorting out the traversals. I've tidied up the existing ones, but haven't yet composed them together (currently each traversal is run in a separate pass). Ideally there should be a LilyPond pass or an Abc pass that fuses all the appropriate traversals together.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.