Thursday, July 31, 2014

majalan

Copperbox revision 3222.

I've made Part a concrete object, this is so it can be decomposed into multiple event lists, e.g. one for intro, one for chorus, etc.

Parts are expected to be played by one instrument or player e.g. a drum part might have multiple instruments, but often a part will have just one instrument e.g. a bass line.

Wednesday, July 30, 2014

majalan

Copperbox revision 3221.

I've removed skipping from Arpa, the combinator library for arpeggiator patterns. Allowing skipping meant there was an implementation leak in the API, plus I now feel skipping should be providence of beat patterns (via rests).

majalan

Copperbox revision 3220.

I've fixed a bug in building beat patterns - using foldr built them backwards so I've switch to foldl'.

Also I've added some more primitives empty, basic and aribtrary - next I need some proper combinators (not primitives).

majalan

Copperbox revision 3219.

I've added the module Majalan.Base.BeatPattern - this is the first draft of a combinator library for generating beat patterns.

Tuesday, July 29, 2014

majalan

Copperbox revision 3218.

I've added the first draft of Majalan.Base.Arpa - a combinator library to generate arpeggiator patterns.

Using it quickly announced that I need a similar library to make beat patterns.

Monday, July 28, 2014

majalan

Copperbox revision 3217.

I've implemented Chains and changed clickTrack to use a Chain.

Chains are potentially a very handy abstraction for building sequencers, arpeggiators and other automatic instruments.


majalan

Copperbox revision 3216.

I've improved the algorithm that builds an ImpulseMap from a Timeline. I've also removed the duplication of User context in the Advance object.

These improvements are a prelude to adding Chains - an abstraction Wumpus had for stepping through point sequences. Chains in Majalan will step through Impulse Maps.

Sunday, July 27, 2014

majalan

Copperbox revision 3215.

I've added timeline animation to make a click track. Currently the implementation is a bit weak and it needs improving.

Saturday, July 26, 2014

majalan

Copperbox revision 3214.

I've re-implemented the Timeline object. The new version is faster and has fewer error states that have to fall back on default values.

Friday, July 25, 2014

majalan

Copperbox revision 3213.

I've back out the changes that added Timeline to Context. I now feel only Score should have access to Timeline.

Once I add Timeline to Score, I can implement a placement API for parts that uses symbolic positions (bar and beat number) rather than absolute onset times. Putting tempo and time signature back into event lists simplifies them and better allows for polyrhythms. Inheriting tempo and time signature from a global immutable timeline restricted polyrhythmic parts.


Thursday, July 24, 2014

zcsv

Copperbox revision 3212.

More work on the CSV reader, separated out FieldReader into its own module.

Wednesday, July 23, 2014

zcsv

Copperbox revision 3211.

I've made a new implementation CSV parsing with a separate scanner that handles escaping (and line breaks) according to RFC 4180.

Tuesday, July 22, 2014

majalan

Copperbox revision 3210.

I've added Timeline into the Context which is threaded through all the monads (Advance, EventList, Score..).

Because the global timeline allows tempo and time signature changes, Context no longer supports a simple API to get quarter_note_length (quarter_note_length is now dependent on position in the score). Thus, the note lists used by Demo02 and Demo03 are broken again, pending a rethink.

majalan

Copperbox revision 3209.

Work towards a global metrical timeline. Both Ableton Live and Garage Band have metrical time lines - graphically it seems a good abstraction for synchronizing tracks.

If I add it properly to Majalan (currently it is just a standalone module under test) I'll have to remove BPM from the Context. BPM will still be accessible to individual event lists but it will be read-only and derived from the global timeline.


Monday, July 21, 2014

majalan

Copperbox revision 3208.

I've added Context back to the Advance object and for consistency added it to the EventList object.


majalan

Copperbox revision 3207.

I've changed Context to allow user context and removed tuning pitch and amplitude which were mostly superfluous (and added complexity).

For the moment, I've removed Advance's dependency on Context. This simplifies Advance and its current API doesn't need it, but it might be the wrong decision (as a comparison Wumpus threaded Context through everything but then Context was much more important).

As I'm undecided about objects depending on Context, both note lists and thus Demo02 and Demo03 are all currently broken.

majalan

Copperbox revisions 3205 & 3206.

Minor refactoring.

I've changed the name of Majalan.Base.NoteList to Majalan.Base.Advance so that it doesn't steal a name that is better used for a notelist. Majalan.Base.Advance provides some of the primitives to build custom notelists.

I've also split Processor out from Event.

Sunday, July 20, 2014

majalan

Copperbox revisions 3203 & 3204.

I've simplified  the Score object so it now tracks parts by an internal id rather than a user supplied enum type (which clogged up the type signatures).

Parts are now preserved in the score output to Csound as well.


bala - package cull

Copperbox revision 3202.

I've culled a number of redundant packages from the bala top level directory:

bala/HNotate
bala/M2
bala/Neume
bala/Variant
bala/ZMidi
bala/ZWav
bala/bala-core
bala/fmss
bala/haddock
bala/jerry-osc
bala/jerry-supercollider
bala/micro-ochre
bala/monad-redux
bala/neume-core
bala/neume-extra
bala/new-neume
bala/orca-ix
bala/orchsyn
bala/pdss-core
bala/slac
bala/tactus
bala/tonos
bala/zsnd-basic
bala/zsnd-core
bala/zsnd-symbolic
bala/zsyn

Some of the remaining packages are also redundant, but for the moment their source can stay in Copperbox.

majalan

Copperbox revisions 3200 and 3201.

I've deleted the original majalan (revision 3200) and renamed the fork majalan3 to majalan (revision 3201).

Saturday, July 19, 2014

ochre-lang

Copperbox revision 3199.

I've "finished" the implement of local functions, although I suspect it my harbor bugs due to alpha renaming. The trivial test case works, but that isn't saying much.


Friday, July 18, 2014

ochre-lang

Copperbox revision 3198.

Work towards adding local function definitions - approximately lambdas but they must be named.

The implementation is only partially complete as it has been a lot more work than I expected as most of the machinery was in place already (it's almost same as super-call inlining).

Wednesday, July 16, 2014

ochre-lang

Copperbox revision 3197.

I've fixed a long standing bug in trait flattening where trait composition was not finding the "combined difference" of two traits instead it was only finding the difference of the left trait (as per the difference operator on Haskell's Data.Map).

Also, I've made the compiler write to file as the final step rather than write to debug. Implementing this makes Ochre seem like a real compiler.


Tuesday, July 15, 2014

ochre-lang

Copperbox revision 3196.

I've rewritten the Compile module so that the main compilation function compileProgram is in a more step-by-step form. This has allowed me to add debug output for every step.

ochre-lang

Copperbox revision 3195.

Work towards simplify the compile steps. Ideally the function compileProgram in the Compile module should read as step-by-step instructions showing the compiler works.

Monday, July 14, 2014

ochre-lang

Copperbox revision 3194.

I've removed the Reporting module.

ochre-lang

Copperbox revision 3193.

Initial work adding compiler debug output in the style of GHC's -ddump-pass. I expect this will supersede the Reporting module at some point.

ochre-lang

Copperbox revision 3191.

I've added IO to the Compiler monad. This means module loading can be done in the Compiler monad rather than the OchreIO monad in ModuleIO. This should lead to simplifications in the ModuleIO and Compile modules as the OchreIO monad can be removed.


Update - Copperbox revision 3192.

ModuleIO now uses the Compiler monad.

Sunday, July 13, 2014

ochre-lang

Copperbox revision 3190.

I've added a checker for unbound variables and unrecognized prim-ids just before the final transltion to Csound. At this point all free variables should have been bound by the introduction of init declarations and unrecognized opcodes are either typing mistakes or method calls with missing definitions (and hence haven't been inlined).


Saturday, July 12, 2014

ochre-lang

Copperbox revision 3189.

I've fixed mistakes in the ExpandMain and InlineSuper modules, stopping them re-initialize the fresh variable counter. This was re-generating already used names in an expression. Also I've improved let-linearization which was stopping demo 4 (which uses super calls) working.

That said, I'm not entirely convinced I'm inlining super calls correctly - I have a feeling they should be inlining in concert with inheritance flattening.

Friday, July 11, 2014

ochre-lang

Copperbox revision 3188.

I've changed all the modules that used throwError from the Compiler monad module to use Reporting functionality instead.

Thursday, July 10, 2014

ochre-lang

Copperbox revision 3187.

I've changed Reporting to use a Parsec-Token style module. I'm not sure this is really warranted but it should be easily extensible if the need arises.

Also I've changed FlattenTraits to run in the Compiler monad. Previously it had been throwing a system error rather than use the error reporting in Compiler monad.

Wednesday, July 9, 2014

ochre-lang

Copperbox revision 3186.

Initial work adding the infrastructure for better (read longer, more verbose...) error reporting and logging.

Tuesday, July 8, 2014

algorave

The Algorave in Leeds at Enjoy Project Space last night was fantastic. Kudos to all the coders/ravers but especially to Renick Bell - it was very inspiring to see Haskell used to make really good music.

ochre-lang

Copperbox revision 3185.

I've added a demo that tests the module system.

At the moment it doesn't compile but already it has identified a bug in normalizing traits (fixed) and reinforced that I should make improving error messages a priority.

Monday, July 7, 2014

ochre-lang

Copperbox revision 3184.

I've added a Main module so Ochre can be run from the command line.

Friday, July 4, 2014

ochre-lang

Copperbox revision 3183.

I've implemented modules and import chasing (so far untested).

This means that all the major pieces of the compiler are now in place, even if some bits are untested and one of the current tests shows some bits don't work.

ochre-lang

Copperbox revision 3182.

Initial work implementing modules in the parser and top-level syntax.

Although some placeholder code has been in for modules for quite a while, all the real work was outstanding. I've now changed the parser so it will parse the Main module with an Orchestra spec and library modules without one.

Getting the compiler to chase imports needs implementing.




Thursday, July 3, 2014

ochre-lang

Copperbox revision 3181.

I've fixed a bug in ToplevelTrans where it was throwing an error if free variables were encountered in expressions (and hence method bodies). We want free variables here as we can now bind them at orchestra definition time (late binding).

I've also fixed a bug in the parser where it didn't recognize Pfields in InitDecls. Pfields are forbidden in method bodies because they are anti-modular (i.e. positional rather than named).


ochre-lang

Copperbox revision 3180.

I've fixed the problems I alluded to in the last message - Instruments in the intermediate representation no longer have instrument_number so they don't have to be assigned an initial, unresolved (-1).

Also, I've implemented init-decls from the Orchestra spec which should late bind free variables in an instrument. This is supposed to be Ochre-lang's innovative feature, unfortunately it isn't working yet. I'll have to re-introduce something to debug-print the compiler steps so I can find out what is going wrong.






ochre-lang

Copperbox revision 3179.

I've finally worked on the super-call inlining code. At the moment it doesn't quite work as there are a couple of standout bugs, fixing them suggests some rethinking, so I'm committing the "code so far".

I also have a more over-arching worry that super-inlining and inheritance flattening should be done at the same time, but investigating this will have to wait.

Wednesday, July 2, 2014

ochre-lang

Copperbox revision 3178.

I've simplified identifiers - now there are just two: Ident and VarId. PrimId has been removed. I've also added if-then-else blocks to the do syntax.

Things are now sufficiently tidy, so next I'll finally try to tackle super-inlining.



ochre-lang

Copperbox revision 3176.

I've added initialization expressions to the orchestra syntax - these will allow i-rate variables to be defined and p-fields to be accessed.

P-fields are positional so they are not modular - if a trait tried to use a p-field, it wouldn't know what the p-field pointed to until final composition. Semantically this is wrong - traits should reference named (free-) variables which are closed when the final orchestra is defined, initialization expressions in the orchestra definition allow this.

At the moment initialization expressions have only been added to the front-end, they need adding to the back-end just before final translation to Csound.

Edit - Copperbox revision 3177.

I've added the file InitialExpr.hs that was missing in the last commit, plus some work on the pretty printer.

Tuesday, July 1, 2014

ochre-lang

Copperbox revision 3175.

More preliminary work before I implement inlining for super-calls.

I've had to take modules a bit more seriously. I was going to leave them until after I'd implemented super inlining, but the simple scheme I had where the intermediate layer only considered instruments demanded by the orchestra spec isn't going to work. Because the super calls of an instrument might resolve to an instrument not in the orchestra spec all instruments in a module need translating upto super-inlining.

ochre-lang

Copperbox revision 3174.

More preliminary work prior to implementing super-call inlining.

I've added a SuperCall constructor to the Expr data type in the intermediate syntax. Because I'll need alpha renaming, super-call inlining will have to work on the intermediate syntax.

ochre-lang

Copperbox revision 3173.

Some minor tidying before I implement super-class method calls.

Calls to super will be inlined, so it looks like they'll have to be resolved on the intermediate syntax where we have alpha renaming. I've added the field instr_superclass to Instrument in expectation of this.

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.