Sunday, September 30, 2012

majalan

Copperbox revision 2855.

The demo now emits a valid Csound csd file.

As I hadn't tested the output before, there were quite a lot of minor errors in the pretty printing (wrong argument orders, floats that should be ints...). Hopefully these are all found and fixed.

majalan

Copperbox revision 2854.

I've changed the Event type so it is a function from start x duration to an opaque event object. This makes it syntactically similar to the latest Gen representation. 

majalan

Copperbox revision 2853.

I've made Gen tables a newtype wrapping a constructor function. This gives a useful distinction between their definition (the values for envelope shape or whatever) and their instantiation (size, index number for instrument and activation time).

Again the type is still opaque - there is no introspection only construction.

Wednesday, September 26, 2012

majalan

Copperbox revision 2852.

I've changed f-tables (gens) making them opaque commands rather than functions that return an introspective GenTable.

There doesn't seem to be much of a need for introspective GenTable object, as it doesn't seem to support useful manipulation (there isn't a reasonable way to halve or double the resolution of tables, though there can be for specific table instances). So it seems better to have a command to write table instantiation in the score.

Sunday, September 23, 2012

majalan

Copperbox revision 2851.

I've added Writer monad style event list building to the Event module. This means more of the implementation can be hidden, which should allow some tidying up.

majalan

Copperbox revision 2850.

I've added a module IncDoc that wraps HughesPJ's Doc and allows textual inclusion of whole files. This means Majalan can use predefined orchestras or the output from Ochre.

Saturday, September 22, 2012

majalan

Copperbox revision 2849.

I've reworked the Event module so it can make good, nicely formatted event lists - sorted and printed with columns and carry (dot in Csound).

Sunday, September 16, 2012

majalan

Copperbox revision 2848.

I've restarted work on Majalan (more accurately I'm starting afresh but keeping the name). The idea is less to make an EDSL score language than to make a kit which composition / instrument specific score languages can be made from.

All the previous code has been thrown out - I'm usually reticent to garbage collect Copperbox, but really I ought to do this more.

Friday, September 14, 2012

ochre

Copperbox revision 2847.

I've reworked the phantom type layer to appear simpler and more idiomatic. In truth the implementation is a bit of a sleight of hand to make the types seem more conventional than they are, but for now I am happy with it.

Wednesday, September 12, 2012

ochre

Copperbox revision 2846.

I've added another couple of granular synthesis opcodes. The types of the phantom type layer really need revising as they are too cryptic - fortunately I have tomorrow off as a holiday to do this.

Tuesday, September 11, 2012

ochre

Copperbox revision 2845.

I've added two fof granular synthesis opcodes and a little bit more Haddock documentation.

Monday, September 10, 2012

ochre

Copperbox revision 2844.

I've added Haddock docs and improved the types of the Zak opcodes.

Intentionally I've made the API a bit more restrictive than the Csound one. In Csound it seems like you can change Zak ports at k-rate, but idiomatic code never does this so I've ruled it out.

Sunday, September 9, 2012

ochre

Copperbox revision 2843.

I've filled out the translation to Csound - currently there are no incomplete pattern matches. By necessity there are plenty of error throws that catch bad syntax, hopefully it is hard to create bad syntax in the first place.

Now I'll have to polish up the opcodes and start writing examples...

ochre

Copperbox revision 2842.

I've split the Csound module into separate modules for syntax and translation. This means I can keep the syntax code tidy whilst working out the translation and I don't get overwhelmed by compiler warnings.

ochre

Copperbox revision 2841.

Some work on the translation to Csound. A lot of work still needs to be done on this - it has always been incomplete, plus it wasn't really updated when the division between expressions and values was extended making functions, binary applications etc. as values rather expressions.

Saturday, September 8, 2012

ochre

Copperbox revision 2840.

I've changed to monad state to count according to rate so you get a1, a2, i1, i2, k1 rather than a1, a2, i3, i4, k5. This makes the generated code a bit more idiomatic.

Friday, September 7, 2012

ochre

Copperbox revision 2839.

I've added phantom opcodes for zak patching. This has indicated that the current "type system" provided by the phantom types is not accurate (nor is it systematic, but that's another matter). It will need a re-think...


Thursday, September 6, 2012

ochre

Copperbox revision 2838.

I've extended constant folding to all the (effectful) expression constructors. Previously the multiple binding constructors Let2, Let3, Let4 were not handled.

Wednesday, September 5, 2012

ochre

Copperbox revision 2837.

I've improved constant folding. The code is now a bit more repetitive, but it is otherwise nicer - the previous code wasn't so clever even though it tried to be. 

Tuesday, September 4, 2012

ochre

Copperbox revision 2836.

I've changed the syntax so it has a constructor for relational expressions. Previously the cond part of if-then-else had 3 values for relational operator and left and right values, this was to stop instances like the following:

if 1 then true-stmts else false-stmts

Seemingly this is invalid Csound which apparently only supports genuine conditional expressions in the cond part, so the previous syntax enforced three part cond expressions. However it was difficult to work with this in practice and we should either be able to eliminated the conditional altogether by constant folding or translate it to a proper conditional during the final translation.

Note - constant folding has been disabled in order to get the current code to compile.


Monday, September 3, 2012

ochre

Copperbox revision 2835.

instr101 in DemoMon is now compiling again. Plus I've removed some of the cruft in Prim.hs (there is still more to go...)

Sunday, September 2, 2012

ochre

Copperbox revision 2824.

I've changed the internal syntax to use two-level syntax - effectful expressions and pure values - from the start.

Previously, the initial syntax was a single expression type that was transformed into K Normal form but this put a lot of typing burden on the compiler and prevented me having ugens polymorphic on signal rate. Also the phantom typed layer essentially built two-level expressions anyway.

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.