Archive for the 'Quartz Composer' Category

17
Sep

Quartz Composer: Building on the Spiral ideas

Playing around with the spiral ideas from my last post, I came up with this composition, which I think is kind of cool:

16
Sep

Quartz Composer iterators

So I’ve been playing with Quartz Composer on and off for a while now, and have been using it to create cusomt visual patches for use with the excellent VDMX VJ software for doing live visual projections with my band.

Coming to QC from other languages (in my case C#, Ruby and JavaScript for the most part), there are a few gotchas… or perhaps my brain is slow to adapt. Anyway, one of these has to do with the Iterator and Iterator Variables patches.

So, the way this works, is you create an Iterator patch (think “for loop” if you are familiar with C-style languages). The Iterator patch is a “macro patch”, which means that it contains other patches. Within the Iterator patch (right-click and select “Edit Macro Patch…”) you create an Iterator Variables patch, which provides your current index, the number of iterations, and a “Position” output that doesn;t quite do what I thought it might:

So you can think of this as:



for (CurrentIndex = 0; CurrentIndex < Iterations; CurrentIndex++) {
    // Why is this (Iterations – 1) ?
    // I think it’s crazy too, but in Quartz,
    // the Current Position goes from 0 to 1
    CurrentPosition = CurrentIndex/(Iterations - 1);
}

I’ve attached a Quartz Composer patch that demonstrates the behavior visually, and shows how to use the iterator and iterator variables patches to draw a set of spheres arranged in a circle about the origin:

IteratorExample.qtz