Hackpact documentation (week 2)

Following on from week 1 of my hackpact hacks, here’s


I had this feeling that a nice visualisation of polyrhythmic structure would be to plot patterns in a spiral. I finally got it to work, and here’s the first few results, rendered with cairo in Haskell:

{red blue orange purple, yellow brown pink}

[red blue orange purple, yellow brown pink]

{orange tomato, blue ~ purple ~ ~}

{orange yellow, blue green ~}

Where colours co-occur, they’re mixed, thanks to the lovely Haskell Colour library.

I was surprised by the rhythmic gestalt these give. In retrospect I realise that Mick Grierson would not be surprised at all by this, and neither would John Whitney. Now I’m a spiral lover too.

I’ll release the code along with the rest of my pattern library next week.


Played around with spiral rendering, but came to conclusion that the spiral mapping itself was beautiful and not the patterns I’m trying to visualise, because just about anything you put into it looks good.  Although you can see the pattern length in the spiral, if you mix different pattern lengths into a polyrhythm, it’s very difficult to perceive more than one pattern length, one comes across more strongly than the others.  Perhaps a peano weave would be better, but I think I’ve gone far enough with this, back to music tomorrow.


My lack of headphones bit me so I couldn’t make music tonight.  Instead I played with context free art, which I’ve been meaning to do for years.  No great masterpieces, but healthy, grammatically constrained fun.



Ok back to music finally.  I’m going to try to add a function to my pattern library before making a quick screencast of the first time I use it to make music patterns.  This time I made a ‘breakbeat’ function, which takes a pattern of integers and uses it to trigger playback positions in another pattern.  I also found a bug which breaks things at the end.  I could add exception handling so these bugs wouldn’t break everying, but hey, it’s good to livecode on the edge.


Added a couple of things:

  • stuff to my ghci interface so I can plug one active pattern into the composition of another.
  • an ‘onsets’ function that turns a pattern into a pattern of bools, true for the first beat of a phrase.

Used these things together to apply functions to effects that are responsive to the sound sample pattern. It takes me a while to work out how to do it, and the end result isn’t particularly musical. I’ll be playing around with this some more, but in the spirit of showing the first time I use a function to make sound, here’s the screencast.

(or it will be once the vimeo flash conversion finishes)


Implemented and played around with bpm patterns. Also implemented simple ‘tween’ pattern for linearly tweening between two values over a given period.

Screencast of first uses here and

Like yesterday’s, not particularly musical…


Did some good live coding practice for Sunday’s gig in Plymouth with Dave. We didn’t record anything though. Instead for hackpact I made a swirly processing patch while thinking about pattern visualisation.


  1. Looks like Fermat’s spiral, or the arrangement of seeds in a sunflower.

    Can you turn it around? Can you listen to a particular spiral?
    I wonder what the sunflower arrangement sounds like.

Leave a Reply

Your email address will not be published. Required fields are marked *