Friday, November 30, 2012

zmidi-core

Copperbox revision 2901.

I've made the parser error tolerant when it is out-of-step with Running Status data - yesterday it was throwing a fatal error at this point in the code. Some of the code has been tidied up, although the documentation needs improvement before it is released on Hackage.

Thursday, November 29, 2012

zmidi-core

Copperbox revision 2900.

Running Status support now appears to be implemented - a pattern match case that throws an error needs improving and the code needs proper testing.

Wednesday, November 28, 2012

zmidi-core

Copperbox revision 2899.

Initial work on supporting Running Status. This is mostly pertinent to the parser, though the syntax and writer have been modified. The parser doesn't work at the moment... 

Tuesday, November 27, 2012

zmidi-core

Copperbox revision 2898.

I've added a hack to the pretty printer than stops high ASCII chars (164 and above) causing a runtime error when trying to print them to stdout. The hack simply rewrites the string changing chars greater than 163 to #.

Monday, November 26, 2012

ochre

Copperbox revisions 2896 and 2897.

I've changed the module hierarchy - the Phantom folder is now called Language. This is a more neutral name so code for building orchestras (which makes no use of phantom types) can go alongside the code for building instruments (which does use phantom types).


Sunday, November 25, 2012

ochre

Copperbox revision 2895.

Work towards global statements for init, zakinit, etc. Most of the code is in place, but I'm not too keen on the module organization.

ochre

Copperbox revision 2894.

I've changed the envelope representation so it works list a snoc-list, previously it was a Hughes list built with mappend.

Saturday, November 24, 2012

ochre and om-shell

Copperbox revision 2893.

I've added functions in the style of the vector-space library to "scalar multiply" a signal by and I-rate constant (or add an I-rate constant, or divide by one). Using these new operators has increase the succinctness of the FM gong instrument.

Friday, November 23, 2012

ochre

Copperbox revision 2892.

I've fixed identical bugs in alpha conversion and beta reduction where compound values (like BinOp and RelOp) were not being properly traversed.

Thursday, November 22, 2012

ochre

Copperbox revision 2891.

Redundant variable elimination now working. Redundant variables are eliminated by constant folding, beta reduction and let-elimination working in concert.

Wednesday, November 21, 2012

ochre

Copperbox revision 2890.

I've fixed yesterday's bug which turned out to be a problem with Alpha renaming. This has revealed that constant folding is not as aggressive as it should be, on we go...

Tuesday, November 20, 2012

ochre

Copperbox revision 2889.

Ochre needs the Assoc compiler pass which linearizes nested LetSig definitions, Id' taken it out for a while mistakenly thinking it didn't. Unfortunately it is somehow not working...

Monday, November 19, 2012

ochre and om-shell

Copperbox revision 2888.

I've changed the letSig family of functions to lower case letsig. This is entirely cosmetic but having camel case keywords in the the embedded language seemed horrible when I thought about it. updateSig will need changing too, but I'm stuck for a better name...

Sunday, November 18, 2012

new release - zmidi-core-0.5.0

Copperbox revision 2887.

I've made a new release of zmidi-core for Hackage. This improves the Haddock documentation, an reorders the constructors of the MidiVoiceEvent constructors so the follow the order of the tag bit in binary MIDI files.

zmidi-core

Copperbox revision 2886.

I've improved the Haddock docs for zmidi-core - when I last built them all modules reported 100% doc coverage.

Saturday, November 17, 2012

zmidi-core

Copperbox revision 2885.

Work on improving the parser.

Some of the changes are a bit gratuitous so I will have to test them tomorrow, but they do make the code cleaner and they make it clear that MidiVoiceEvent, MidiSysCommonEvent and MidiSysRealTimeEvent don't need fallback constructors. MidiMetaEvent needs a fallback constructor (MetaOther) as not all possible meta events are enumerated; but MidiVoiceEvent etc. are fully enumerated - if the parser has a pattern match failure for these productions it means that the code is wrong elsewhere.

Wednesday, November 14, 2012

new release - zmidi-core-0.4.0

Copperbox revision 2884.

I've put a new release of zmidi-core on Hackage - version 0.4.0.

This has better handling of "unrecognised" Meta events in the parser, plus a new Meta Event MidiPort. I think VoiceEvent should probably have a similar "unrecognised" catch all constructor so there might be another release at the weekend.


Tuesday, November 13, 2012

zmidi-core

Copperbox revision 2882.

I've reactivated zmidi-core to look at the robustness of the parser. Currently it throws errors in some places where it could easily recover. It would be nice if MIDI event "packets" carried their length "on the outside" - this would make it easy to tolerate errors (chunk the input as per size, parse the chucks, flag up what fails to parse); unfortunately packet size is dependent on knowing something about the event so I doubt I can make the current parser fully tolerant.


Copperbox revision 2883.

Added MidiPort meta event.


Monday, November 12, 2012

om-shell and ochre

Copperbox revision 2881.

The FM gong example now works. It has signal update (reusing variables), envelopes and I-rate declarations - so this is quite an advance.

Sunday, November 11, 2012

ochre

Copperbox revision 2880.

I've implemented "top level" I-rate variable declaration to instruments. The syntax for this was added last week, but I forgot to implement it in the builder code. I've also started to look at encapsulating "envelopes" in a separate type, though this half-baked at the moment.


ochre

Copperbox revision 2879.

I've added error handling to the Orch monad. Signal dereferencing can (unfortunately) generate run time errors rather than type errors, so I'm trapping bad cases in the monad rather using error.
 

Saturday, November 10, 2012

ochre

Copperbox revision 2878.

I've implemented safer casting for signals - signals can only be upsampled rather than downsampled. New shorthand operators for casting combination of signals (addition, multiplication...) have been added to alleviate some of the syntactic burden of typing signals with their rates (audio, control, init).

Wednesday, November 7, 2012

ochre

Copperbox revision 2877.

I've renamed PExpr to InstCode and removed the synonym M. This is to remove the emphasis that instrument bodies are expressions and to stop the association where effectful code was monad-like. As InstCode is not a functor let alone a monad, it seemed a bad idea to pun between monads and effects.

Tuesday, November 6, 2012

ochre

Copperbox revision 2876.

I've changed the opcode wrappers so they can compile again. The next step is to see how the Phantom layer can be simplified again.

Monday, November 5, 2012

ochre

Copperbox revision 2875.

I've started simplifying the phantom type layer. Initially I'm making PValue simpler as it shouldn't need variable supply. When I've checked this I'll go back and look at the naming schemes.

Currently the DemoMon example doesn't compile - changing the phantom types cascades changes to dozens of opcode wrappers, which are outstanding.

ochre

Copperbox revision 2874.

I've renamed the compiler monad from Mon to Compiler. This is a prelude to changing the phantom type layer where I may want a monad (if I do Mon will be a good name). I don't think values need name supply in the phantom layer, if so then I should be able to simplify it quite a bit.

Sunday, November 4, 2012

ochre

Copperbox revision 2873.

I've added signal update and immutable top-level declarations that can't be let-eliminated or constant folded. The former allows the Csound optimization of minimizing variable declarations, the latter allows more readable generated code as i-rate declarations can be preserved.

Both implementations are hacks as I envisaged implementing them differently when I started designing Ochre. I'll probably have to rethink the Phantom layer somewhat as Signals now have a specific meaning to Ochre which the old code in the Phantom layer doesn't properly respect.


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.