Copperbox revision 240.
HNotate alt - chords and grace notes are now handled in the LilyPond and Abc backends.
Tuesday, August 26, 2008
HNotate
Copperbox revision 239.
The LilyPond backend in HNotate-alt now uses traversals.
Like the Abc backend, the code seems shorter and neater - some of this might be attributable to it being a rewrite, but it does seem as though traversals are making things easier
The LilyPond backend in HNotate-alt now uses traversals.
Like the Abc backend, the code seems shorter and neater - some of this might be attributable to it being a rewrite, but it does seem as though traversals are making things easier
Monday, August 25, 2008
HNotate
Copperbox revision 236.
HNotate alt - more work on the Score datatypes to support traversals and I've added a new module Bifunctor to abstract over Glyphs which have two type arguments - pitch and duration.
Outputting LilyPond and Abc score files from note lists has been far tougher than I expected. When I started I imagined the only big problem would be adding extra information - for instance score files generally need time and key signatures which aren't in note lists.
This is still a problem which I haven't really resolved (although the pretty print combinators let you overcome it in a rough and ready way), but there have been other significant ones that have made the project work rather than fun. The big one has been a good representation of sheet music, which seems so simple on the face of it - essentially lines (staves) and glyphs (notes, rests, chords, grace notes...). This has been particularly dispiriting as each revision of the score representation over the last couple of months has allowed me to get a little bit further, but then derailed leaving the LilyPond and Abc backends with duplicated copy-paste-edit code that impervious to factoring.
Maybe the new revision will work better - it's nice that it can support fmap, Foldable and Traversable on the structure of the score and bimap (analogous to fmap) on the glyphs. The glyphs are terminals if you envisage the score as a grammar. If it doesn't then its time to abandon Bala and HNotate and go onto something else.
HNotate alt - more work on the Score datatypes to support traversals and I've added a new module Bifunctor to abstract over Glyphs which have two type arguments - pitch and duration.
Outputting LilyPond and Abc score files from note lists has been far tougher than I expected. When I started I imagined the only big problem would be adding extra information - for instance score files generally need time and key signatures which aren't in note lists.
This is still a problem which I haven't really resolved (although the pretty print combinators let you overcome it in a rough and ready way), but there have been other significant ones that have made the project work rather than fun. The big one has been a good representation of sheet music, which seems so simple on the face of it - essentially lines (staves) and glyphs (notes, rests, chords, grace notes...). This has been particularly dispiriting as each revision of the score representation over the last couple of months has allowed me to get a little bit further, but then derailed leaving the LilyPond and Abc backends with duplicated copy-paste-edit code that impervious to factoring.
Maybe the new revision will work better - it's nice that it can support fmap, Foldable and Traversable on the structure of the score and bimap (analogous to fmap) on the glyphs. The glyphs are terminals if you envisage the score as a grammar. If it doesn't then its time to abandon Bala and HNotate and go onto something else.
Friday, August 22, 2008
Thursday, August 21, 2008
HNotate
Copperbox revision 233.
I've changed the score datatypes so they can be Functor instances (and Foldable and Traversable instances). They should really have been in this form in the first place (ah hindsight!), but I had wanted to make duration handling easier for chords and graces and had the datatypes parametrized with two holes - glyph and duration, rather than just glyph.
I've changed the score datatypes so they can be Functor instances (and Foldable and Traversable instances). They should really have been in this form in the first place (ah hindsight!), but I had wanted to make duration handling easier for chords and graces and had the datatypes parametrized with two holes - glyph and duration, rather than just glyph.
Wednesday, August 20, 2008
HNotate
Copperbox revision 232.
More work on HNotate - I spent a long time trying to replace the monad transformer with composed applicative functors within the `toScore` renderer. In the end I simply stopped using the state monad as I'm tracking all the necessary state in the the accumulator that builds the measures as they are rendered.
Currently, only the score renderer is working. The backends look set for a change as I could do most of the processing on them with traversals rather than the folds and directly recursive functions that I currently use. To help the move to traversals I've parameterized the score types so that the `terminal` types - notes, rests - are open and can be changed for the respective backend while the structure types - lines, measures - stay the same (so the traversals can be common across backends).
More work on HNotate - I spent a long time trying to replace the monad transformer with composed applicative functors within the `toScore` renderer. In the end I simply stopped using the state monad as I'm tracking all the necessary state in the the accumulator that builds the measures as they are rendered.
Currently, only the score renderer is working. The backends look set for a change as I could do most of the processing on them with traversals rather than the folds and directly recursive functions that I currently use. To help the move to traversals I've parameterized the score types so that the `terminal` types - notes, rests - are open and can be changed for the respective backend while the structure types - lines, measures - stay the same (so the traversals can be common across backends).
Wednesday, August 13, 2008
HNotate
Copperbox revision 230.
I've started and alternative implementation of HNotate - it was already was too complicated and some of the early design decisions seemed wrong (e.g. having different syntax tree data types for each backend was supposed to make the code simpler but didn't).
At the moment the alt-version is smaller and simpler (but doesn't have the features of the original). I'll have to see if I can keep it smaller and simpler as I get it to work.
I've started and alternative implementation of HNotate - it was already was too complicated and some of the early design decisions seemed wrong (e.g. having different syntax tree data types for each backend was supposed to make the code simpler but didn't).
At the moment the alt-version is smaller and simpler (but doesn't have the features of the original). I'll have to see if I can keep it smaller and simpler as I get it to work.
Tuesday, August 12, 2008
HNotate
Copperbox revisions 227 & 228.
Revision 227 - some tidying up of HNotate. Moved the Utils.hs files out of the Abc, LilyPond and Midi backends.
Revision 228 - added a file to track the LilyPond version that HNotate targets. This should have gone in with revision 227.
Revision 227 - some tidying up of HNotate. Moved the Utils.hs files out of the Abc, LilyPond and Midi backends.
Revision 228 - added a file to track the LilyPond version that HNotate targets. This should have gone in with revision 227.
Monday, August 11, 2008
HNotate and Bala
Copperbox revisions 224 and 225.
Revision 224 - the LilyPond renderer is now working to a degree. There is some problem with chords changing the octave step, and a lot of the code is now very messy having been ripped out of Bala.Perform and hacked to work in HNotate.
Revision 225 - set the executable flag on the repository version of runtests.sh
Revision 224 - the LilyPond renderer is now working to a degree. There is some problem with chords changing the octave step, and a lot of the code is now very messy having been ripped out of Bala.Perform and hacked to work in HNotate.
Revision 225 - set the executable flag on the repository version of runtests.sh
Sunday, August 10, 2008
HNotate
Copperbox revision 222.
I've changed the Midi renderer to return parts of a Midi file rather than a completely rendered file.
However the parts are merged together to make a track is now under user control - the user supplies a function of type MidiSystem (i.e. PartMidiFile -> MidiFile) that gets called at the end of the rendering process knitting the parts together.
The LilyPond and Abc renderers will be changed to use this mechanism.
I've changed the Midi renderer to return parts of a Midi file rather than a completely rendered file.
However the parts are merged together to make a track is now under user control - the user supplies a function of type MidiSystem (i.e. PartMidiFile -> MidiFile) that gets called at the end of the rendering process knitting the parts together.
The LilyPond and Abc renderers will be changed to use this mechanism.
HNotate
Copperbox revision 221.
I've added a new operator to the print representations in HNotate - (<+<).
It's a type restricted version of mappend and it allows parameterized sequences to be built. Previously holes in sequences had to be one element because they could only be built with the addto operator (+++), now holes can themselves be sequences. This will allow HNotate LilyPond to append the notelist it produces to a user supplied initial block that contains key signature, time signature etc.
Disappointingly, these four lines of code (one for the type class, one for the fixity declaration, one for the type signature and one for the implementation) have taken four days work. I convinced myself early on that the current representation wasn't suitable and I'd have to go to something more directly compositional like the Wash HTML representation, then spent a lot of time getting lost.
I've added a new operator to the print representations in HNotate - (<+<).
It's a type restricted version of mappend and it allows parameterized sequences to be built. Previously holes in sequences had to be one element because they could only be built with the addto operator (+++), now holes can themselves be sequences. This will allow HNotate LilyPond to append the notelist it produces to a user supplied initial block that contains key signature, time signature etc.
Disappointingly, these four lines of code (one for the type class, one for the fixity declaration, one for the type signature and one for the implementation) have taken four days work. I convinced myself early on that the current representation wasn't suitable and I'd have to go to something more directly compositional like the Wash HTML representation, then spent a lot of time getting lost.
Tuesday, August 5, 2008
HNotate
Copperbox revision 220.
I've tidied up the phantom type layer for the Abc and LilyPond pretty printers. The 'Skeleton Doc' has gone and both libs now share the same code for appending and attributing elements.
This removes one of the 'sore thumbs' of HNotate, there are plenty of others as the code has been written quickly and revised often so is particularly ragged (and there are some holes where I haven't re-implemented features that were 'revised-out').
There are also some stumbling blocks that stop it being generally usefully, big ones are:
- What to do about 'systems' i.e. multiple staves - really the renderers should be open so the user can control this.
- What to do about glyphs that aren't notes or rests - currently there is no way to get say, expression marks, into the score output.
I've tidied up the phantom type layer for the Abc and LilyPond pretty printers. The 'Skeleton Doc' has gone and both libs now share the same code for appending and attributing elements.
This removes one of the 'sore thumbs' of HNotate, there are plenty of others as the code has been written quickly and revised often so is particularly ragged (and there are some holes where I haven't re-implemented features that were 'revised-out').
There are also some stumbling blocks that stop it being generally usefully, big ones are:
- What to do about 'systems' i.e. multiple staves - really the renderers should be open so the user can control this.
- What to do about glyphs that aren't notes or rests - currently there is no way to get say, expression marks, into the score output.
Bala
Copperbox revision 219.
Moved some of the dependencies from Bala to HNotate and ZMidi. I removed the original Midi library from Bala.Format.Midi, but there is still clutter there that needs removing once HNotate is properly capable of outputting LilyPond and Abc.
Moved some of the dependencies from Bala to HNotate and ZMidi. I removed the original Midi library from Bala.Format.Midi, but there is still clutter there that needs removing once HNotate is properly capable of outputting LilyPond and Abc.
Monday, August 4, 2008
ZMidi
Copperbox revision 217.
I've created a new package with the Midi library in Bala.Format - ZMidi. The code is essentially the same (some small clean ups) but it is no longer in the Bala.Format.Midi namespace - instead its plain ZMidi. This should ease making 'Perform' a standalone library.
Dependencies still reach into the BalaFormat.Midi library, so I won't be removing the original just yet.
I've created a new package with the Midi library in Bala.Format - ZMidi. The code is essentially the same (some small clean ups) but it is no longer in the Bala.Format.Midi namespace - instead its plain ZMidi. This should ease making 'Perform' a standalone library.
Dependencies still reach into the BalaFormat.Midi library, so I won't be removing the original just yet.
Sunday, August 3, 2008
Bala
Copperbox revisions 215 & 216.
Revision 215 - a substantial amount of changes as I'm working towards making the Perform modules a standalone library. Particular I've added minimal data types for pitch and duration - this has simplified the internals of the library quite a lot as it is no longer trying to be polymorphic on external pitch and duration representations.
Also I've move the Score representation from Format into Perform, at some point I'll do the same with the pretty printers for Abc and LilyPond in Format/Output. The Midi library should probably be made into a separate package too.
Revision 216 - deletes some of the files that that revision 215 made redundant. For the time being there is still a copy of the Score library in Format but this will go when I've checked there are no references to it.
Revision 215 - a substantial amount of changes as I'm working towards making the Perform modules a standalone library. Particular I've added minimal data types for pitch and duration - this has simplified the internals of the library quite a lot as it is no longer trying to be polymorphic on external pitch and duration representations.
Also I've move the Score representation from Format into Perform, at some point I'll do the same with the pretty printers for Abc and LilyPond in Format/Output. The Midi library should probably be made into a separate package too.
Revision 216 - deletes some of the files that that revision 215 made redundant. For the time being there is still a copy of the Score library in Format but this will go when I've checked there are no references to it.
Bala
Copperbox revision 214.
I've now added a Midi backend, it is as capable as the original renderer (grace notes are still to do), but I think the design is better.
All the new backends have been written quickly to have something working, there's plenty of room for improvement.
I've now added a Midi backend, it is as capable as the original renderer (grace notes are still to do), but I think the design is better.
All the new backends have been written quickly to have something working, there's plenty of room for improvement.
Saturday, August 2, 2008
Bala
Copperbox revision 213.
I've resolved the problems with the Abc pretty printer that I let slip in in the last couple of commits. In short I changed the tune element to be header+body rather than a it being misnamed body within AbcInternals.hs, but didn't cascade the updates that this introduced properly.
I've resolved the problems with the Abc pretty printer that I let slip in in the last couple of commits. In short I changed the tune element to be header+body rather than a it being misnamed body within AbcInternals.hs, but didn't cascade the updates that this introduced properly.
Friday, August 1, 2008
Bala
Copperbox revision 211.
Some work on the Abc backend.
This is essentially a checkpoint commit - now that there are sets of datatypes for the different backends there is no need to have beaming elements in the ScScore datatypes (beaming is only relevant to Abc). So I'll remove them next.
Some work on the Abc backend.
This is essentially a checkpoint commit - now that there are sets of datatypes for the different backends there is no need to have beaming elements in the ScScore datatypes (beaming is only relevant to Abc). So I'll remove them next.
Bala
Copperbox revision 210.
Rather than use the 'Poly' Score datatypes, I've decided to define individual sets of data types for each backend (LyScoreDatatype.hs contains the LilyPond ones). This is to make some things more explicit - especially the type of a polyphonic segment - at the expense of generality.
Rather than use the 'Poly' Score datatypes, I've decided to define individual sets of data types for each backend (LyScoreDatatype.hs contains the LilyPond ones). This is to make some things more explicit - especially the type of a polyphonic segment - at the expense of generality.
Subscribe to:
Posts (Atom)
Blog Archive
About Me
- Stephen Tetley
- 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.