Thursday, July 31, 2008

Bala

Copperbox revision 209.

I've changed the LilyPond backend to use the PolyScore datatypes. While there is still a lot to do, it is producing output again.

Wednesday, July 30, 2008

Bala

Copperbox revisions 207 & 208.

Revision 207 - more work towards viable support for polyphony. My current thinking is to sequence all the measures in a pending worklist (represented by the new ADT OnsetQueue) then regroup them into PolyUnits - polyphonic lines that are printed together on the same staff.

In Abc, a PolyUnit has to be a measure long and are represented by voice overlays. In LilyPond, a unit can be of variable length and a separated with the (\\) operator.

Revision 208 - all translation steps for scores now implemented in ToPolyScore. Currently it only translates into measure length 'PolyUnits'.

Tuesday, July 29, 2008

Bala

Copperbox revision 206.

There were problems with polyphony in the last commit that I didn't spot at the time - I've now improved things in the Score rendered but disabled polyphony in the LilyPond renderer.

I've added a LilyPond sample - polyphony.ly - which illustrates what the design choices are for the renderers.

Bala

Copperbox revision 205.

Its a bit messy as I had to change things that I thought work working properly, but the new LilyPond back end now renders polyphony.

Monday, July 28, 2008

Bala

Copperbox revision 204

Work on the ToScore renderer. Making it less imperative and hopefully more readable.

Sunday, July 27, 2008

Bala

Copperbox revisions 202 & 203.

I've reorganized the Perform directory. The original code that worked in one step (EventTree -> Midi, EventTree -> LilyPond, ...) is now in the Original folder. The new code that will supersede it at some point is split into various folders.

Saturday, July 26, 2008

Bala

Copperbox revision 201.

I've added the new LilyPond backend. It takes an ScScore syntax tree and outputs it as LilyPond.

Although it is incomplete at present - it doesn't yet render polyphony, I think it does live up to the expectation that generating LilyPond in two steps (EventTree -> Score, Score -> LilyPond) is more comprehensible than EventTree -> LilyPond.

Copperbox at 200

Copperbox revision 200.

I've closed down Cil Pickle my other Google project and moved the code into Copperbox.

It's a dead end as far as I'm concerned, but the code might as well 'live on' - if it cautions someone else about going down that particular dead-end that it will have had a useful afterlife.

Bala

Copperbox revision 199.

Major renaming in the Output modules LilyPondInternals and AbcInternals. I was getting frustrated with qualified imports and name clashes so I've given the types in both modules rather long winded names. The naming should now be more systematic as well.

Friday, July 25, 2008

Bala

Copperbox revision 198.

I've changed the type signature of the Perform type class to make the types that the Score render can handle more general. Doing this cascades changes to various modules.

Bala

Copperbox revision 197.

Small changes - added a new smart constructor to Duration that builds a Duration from a Ratio (accounting for dotting if it can).

Some changes to the Score representation - this will probably change quite a bit with the next round of work, so I am check-pointing it now.

Thursday, July 24, 2008

Bala

Copperbox revision 196.

The score renderer now supports single staff polyphony - that makes it capable of handling all the trees in Trees.hs.

Wednesday, July 23, 2008

Bala

Copperbox revision 195.

The Score renderer now does chords, grace notes and multiple parts. Of the seven event trees in Trees.hs that's six of them. It doesn't yet do tree 7 - which is single staff polyphony in LilyPond (and voice overlay in Abc).

Bala

Copperbox revision 194.

I've added a new representation Score. This is an experiment to see whether it makes rendering simpler.

Score is an explicit intermediate form (like GHC's core or Yhc.Core). My idea is that it will be easier to render to this - sort out things like barlines and staff grouping, then render to Abc or LilyPond as a last step hopefully without much processing.


Also added a couple more samples. One is a tab that can be read by the TabApp - TabApp works as a proof of concept unfortunately the ouput isn't pretty.

Tuesday, July 22, 2008

Bala

Copperbox revision 193.

The Midi, Abc and LilyPond renderers now all uses a new Monad PerformM (which is a wrapper over StateT over Reader).

This means that the state (e.g bar count in Abc as the rendering progresses) is now separate from the initial configuration supplied by the user (e.g. default note length for rendering Abc) .

Bala

Copperbox revision 192.

Various minor changes - a checkpoint commit before I do some more revision on the renderers.

Added more named elements to Pitch - PitchNames i.e. pitches without octave information. These are needed for Keys which I've added to Scale. I'm not sure that the Key datatype in Scale is the right representation, but the named elements (c_major, d_sharp_minor, etc) are very useful to have as defaults to pass to the renderers.

Monday, July 21, 2008

Bala

Copperbox revision 191.

Added new examples in the file BalaExamples/Trees.hs.

These examples should exercise all the capabilities of the EventTree and Performance (list of EventTrees) datatypes - sequential notes, chords, grace notes, mutliple staff 'parallelism' and same staff parallelism.

Quite a bit is still to be done in the renderers - Midi doesn't do grace notes, Abc doesn't do parallelism.

Also I've made the examples and runtest.sh test script generate their output in the folder BalaExamples/out - things were getting messy.

Bala

Copperbox revision 190.

I've changed the renderers to use the PPrint combinator rather than <+>. I hadn't realized <+> stops line breaking and as I was folding long chains with it, I was getting very long lines.

Ideally I should print out notes in groups corresponding to bars - this is partially done (well hacked together) for Abc, but I should do it for LilyPond as well. It would make the output a lot more readable.

Also deleted the old PreformMidi module from the Midi modules - its replacement is in the Perform directory.

Sunday, July 20, 2008

Bala

Copperbox revision 189.

I've added a sample application that parses ascii guitar tabs and renders them to Midi.

Bala

Copperbox revision 187.

Big improvements to Abc and LilyPond output. Now, all three output formats Abc, LilyPond and Midi share the same typeclass 'Perform' for interpreting pitches and rests.

Abc - barline handling is now implemented in the Abc output (Abc needs manual placement of barlines which is an unfortunate complication).

LilyPond - chords now work better with relative pitch naming.

Copperbox revision 188.

Deleted the file EventQueue.hs - it should have been deleted before but it was mysteriously hanging on at the top level of the repository.

Saturday, July 19, 2008

Bala

Copperbox revisions 185 & 186.

More tidying up of the Perform modules.

Revision 186 gives the Midi output modules the same structure as Abc and LilyPond modules.

Bala

Copperbox revisions 183 & 184.

More tidying - moved the import modules for Bala.Base and Format.Midi one level higher up in the folder hierarchy so they can be imported without double barrelled names. Revision 183 missed one of the cascade changes that this brought about so that was corrected in 184.

Bala

Copperbox revision 182.

Minor update to the LilyPond rendering. This is a checkpoint before I look at revising all of the renderers: MIDI, LilyPond and Abc.

Friday, July 18, 2008

Bala

Copperbox revision 181.

The LilyPond renderer now uses the output representation rather than the Sym representation.

Bala

Copperbox revision 180.

Changed RenderAbc to use the new Abc output format - its definitely simpler to use.

Added an equivalent set of modules for outputting LilyPond in the same style.

Thursday, July 17, 2008

Bala

Copperbox revision 179.

Added a new output representation for Abc. This one is patterned after the Text.XHTML library in the hierarchical libraries - with a phantom type layer to have comparable 'typefulness' to the SymAbc representation.

Unlike SymAbc it doesn't generate abstract syntax, instead it goes almost* straight to the pretty printers Doc type. While this makes it more limited than SymAbc it does represent Abc with workable types - SymAbc's types were too big to program with.

--

* The new library has a skeleton syntax layer above the Doc type, but this seems unnecessary and may be removed in due course.

Sunday, July 13, 2008

Bala

Copperbox revision 178.

Some work on the Abc renderer. Unfortunately the types of the 'sym' representation are becoming prohibitive to get the renderer working, I need to do something to reduce them.

Bala

Copperbox revision 177.

Bala - moved the MeterFraction data type from SymBase to Base.Meter and tidied up the Base.Meter module a bit. This had a cascade of changes to other modules where they had to import the right module for MeterFraction.

Saturday, July 12, 2008

Bala

Copperbox revision 176.

Mostly changes to the SymAbc representation. The datatypes module is now organised following the categories of the Abc standard 2.0 draft, although for my purposes I'm only interested in the parts that are readily supported - plus voice overlays which are supported in abcm2ps but note abc2ps. Voice overlays are necessary to get a equivalent to LilyPond's single staff polyphony.

The Abc renderer hasn't progressed much as Abc format needs to put in barlines (LilyPond sets the by default). I'll have to work out what to do for this.

Friday, July 11, 2008

Bala

Copperbox revision 175.

Various minor revisions, mostly to get meter fractions working better. Plus initial work on a renderer for Abc format.

Thursday, July 10, 2008

Bala

Copperbox revision 174.

The example tune Bulgarian6 now outputs a LilyPond score along with a MIDI file.

The number of Field classes in SymAbc has been reduced. Having lots of classes means lots of constraints in type signatures, so reducing the number of them is worthwhile.

Bala

Copperbox revision 173.

Changed the EventTree representation from a snoc list that was counter-intuitive to traverse to a sequence with 'grammatical elements' . An explanation is probably clearest with examples:

A chord <> - this is a sequence of five elements (<) is BeginPar ('begin parallel' - chords are parallel sequences of notes, (>) is EndPar.

Similary the note c with two grace notes before it is - { e d } c. ({) is BeginPre - 'begin prefix' - grace notes are played respective to the note they precede rather than to global time, and (}) is EndPre.

Left to right traversal of this representation is much more obvious, plus because it is built on Sequence from the hierarchical libraries adding to the right end is supported.

Wednesday, July 9, 2008

Bala

Copperbox revision 172.

I've changed the Sym representations so that context is only a parameter on lists and not all the elements. This reduces some of the burden of the type signatures. Also I've done some renaming - the prefix Sym on the classes has been shortened to just C.

Tuesday, July 8, 2008

Bala

Copperbox revision 171.

The LilyPond renderer can now do durations and rests. That's the good news.

The bad news is that it needs a very silly type class - LyRenderable - to help it interpret rests on notes in the input tree. How to interpret the input tree in a satisfactory way is going to take some thought.

Also the representation of durations in Bala.Base has changed - dotting is now cached which means that double dotting works as expected:

dot $ dot quarter == dotdot quarter

Monday, July 7, 2008

Bala

Copperbox revision 170.

Added a LilyPond render like the MIDI renderer. It is very unpolished - currently it only handles pitches, rather than notes with durations, but as the cliche goes "It's a start".

Sunday, July 6, 2008

Bala

Copperbox revision 169.

The MIDI renderer can now handle rests and is parametrizable over the typeclass Renderable - so it can rendering is polymorphic.

Bala

Copperbox revision 168.

Added a new MIDI renderer. It is a big improvement on the old one as I've worked out how to handle note splitting properly (i.e. turning a note into a note-on and a note-off).

Friday, July 4, 2008

Bala

Copperbox revision 167.

Updated Duration - it is now a newtype and not a type synonym. Also there was a name clash with Meter which also defined a Duration type- Meter's has been removed. Meter itself is pretty run down and is due for some work (or removal).

The textual representation of MIDI used by MidiPrint now tracks global (cumulative) time rather than just delta time. While this information doesn't appear in MIDI files it is simple to synthesize and obviously useful.

Thursday, July 3, 2008

Bala

Copperbox revision 166.

Added a new module to Bala.Base - Duration.

Durations are just the `Ratio` type. The module exports named instances whole, half, quarter, etc. (American naming) and breve, minim, crochet, etc. (English naming), plus some operations dotting and calculating time values.

Bala

Copperbox revision 165.

Improvements to the MIDI library. The Data.Binary parser is now essentially the same as the Parsec parser, they just use different primitives. Haddock documentation has been added to the datatypes.

From being an ugly duckling, the code in the MIDI library now at least looks polished.

Wednesday, July 2, 2008

Bala

Copperbox revision 164.

Added an alternative MIDI parser written with Parsec rather than Data.Binary. It is much cleaner than the existing parser, which got rather messy as I hunted a nasty bug.

Renamed OnsetQueue to EventQueue - the queue should track 'global time' and not 'onset time' so the previous name was misleading.

Bala

Copperbox revision 163.

Added a new module OnsetQueue to Bala.Perform.

This is part of the work I've been doing on MIDI output. OnsetQueue represents events to be added to the MIDI stream at a future time. For example, if you have a high level representation of a note with a duration - if you render it to MIDI it will become a note-on at the current time onset, plus a note-off some time later. The onset queue stores these pending events to be queued later.

At present it doesn't recalibrate the onset time of the still outstanding events on a dequeue (the `upto` operation), this is most-likely wrong and no doubt will be apparent when I get more of the MIDI output code running.

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.