This is a port of a Pd patch by Martin Brinkmann that in turn is a port of a Reaktor ensemble by lazyfish. I wrote this SuperCollider patch in 2006 and recently revisited the code, added a preset system and made it run under the current SuperCollider version 3.4.
Though there are a lot of things that could be improved. The graphical interface is particularly rough and ugly.
Attached is the code and a short MP3 with example sounds.
Today I cleaned up and finished a class belonging to my redSys quark. The class can read and write bitmap images (.bmp files). To get it run the following command in SuperCollider...
Quarks.install("redSys");
It's a fairly slow and useless class but well, it can generate images relatively fast. And saving to disk is also quite quick. But avoid drawing the images to screen. The built-in makeWindow method is very slow as it goes through width*height number of pixels and draws a rectangle for each using Pen.
This is a hack from 2007. It was done in CocoaCollider, but now I updated it using the standard SCNSObject in SuperCollider. It works by talking to Google Earth via AppleScript.
There are two ways to run AppleScripts from within SuperCollider. One is to construct a string with osascript -e and a unixCmd, the other is creating a cocoa NSAppleScript object with the SCNSObject cocoa binding class. The later method is slightly more involved but runs way faster.
//--unixCmd version
"osascript -e 'tell application \"Finder\" to activate'".unixCmd;
"osascript -e 'tell application \"TextEdit\" to activate'".unixCmd;
//--NSObject version - this only work on old OSX SuperCollider versions
a= SCNSObject("NSAppleScript", "initWithSource:", ["tell application \"Finder\" to activate"]);
a.invoke("executeAndReturnError:", [nil], true);
a.release;
SCNSObject.dumpPool; //should be 0
SCNSObject.freePool; //free stray objects if any left
Also, I've attached a simple class that wraps the functionality. It's called RedEarth.
An ecosystem as described in Gary William Flake's book - "The Computational Beauty of Nature" (page 191). I started coding it 1.5 years ago but never finished it until today.
If e has three or more neighbours that are plants, then e will become a plant at the next time step (assuming it isn't trampled by a herbivore or carnivore).
For every herbivore, h (in random order):
Decrease energy reserves of h by a fixed amount.
If h has no more energy, then h dies and becomes an empty space.
Else, if there is a plant next to h, then h moves on top of the plant, eats it, and gains the plant's energy.
If h has sufficient energy reserves, then it will spawn a baby herbivore on the space that it just exited.
Else, h will move into a randomly selected empty space, if one exists, that is next to h's current location.
For every carnivore, c (in random order):
Decrease energy reserves of c by a fixed amount.
If c has no more energy, then c dies and becomes an empty space.
Else, if there is a herbivore next to c, then c moves on top of the herbivore, eats it, and gains the herbivore's energy.
If c has sufficient energy reserves, then it will spawn a baby carnivore on the space that it just exited.
Else, c will move into a randomly selected empty space that is next to c's current location. If there are no empty spaces, then c will move through plants.
The rules are fairly simple but the result is complex. Carnivores feed on herbivores that in turn feed on plants. Populations grow, get overpopulated and die out just like in nature. The SuperCollider code is a bit cryptic using a lot of nested arrays for efficiency reasons but near the top, there are user settings to play with.
This is something I originally wrote for the article Audiovisuals with SC and now rewrote as separate classes. There are four classes all implementing the same system slightly differently. Two for graphics (Whitney, Whitney2) and the other two for patterns (Pwhitney, Pwhitney2).
The principle for this system is described by John Whitney in his book Digital Harmony (1980) and reimplemented musically by Jim Bumgardner in his Whitney Music Box (2006). The idea is simple but complex patterns arise - both in graphics and in harmony/rhythm. The innermost ball moves at a certain speed, the ball next to it doubles that speed and the ball next to that triples the speed etc. There's a sound played for each ball as it passes through 0. Each ball's sound plays at a different frequency mapped to some scale, overtone series or something else.
Another very old SuperCollider class I never got around to publish. It's called Pfork and makes it possible to blend or fade out patterns in other ways than plain [volume] crossfading. It was originally written for the installation Intelligent Street (in SC2) where it was used as a way of creating new music styles from a mix of multiple other styles.
Here's one example of slowly zeroing out amplitudes in a 16 step pattern. frac is a value slowly changing from 1.0 to 0.0 and indicates how many values to zero out. The fork pattern is [3, 1, 2, 0]. This pattern decides which indices to zero out and in which order. So here index 3 is first in the fork pattern and will thereby be seen as the least important in the original pattern. All indices 3 will be zeroed out first. After that all indices 1 and so on. The last indices zeroed out (i.e. kept until frac is almost 0.0) are the indices 0 - ie the first beat out of 4 in the original amplitude step pattern.
This ASCII printout should help visualise what is happening...
Two SuperCollider classes I wrote long ago (Nov. 2008) after a technique described by Godfried Toussaint in his paper 'The Euclidean Algorithm Generates Traditional Musical Rhythms'www-cgrl.cs.mcgill.ca/~godfried/publications/banff.pdf
Also, see ruinwesen.com/blog?id=216 for another implementation with some great demos. And Bjorn Westergard has a SuperCollider demo (archive.org).
Lots of typical patterns in say techno music can be described like this using only two numbers (relation).
Bjorklund is now available as a SuperCollider quark. Install it via the following commands...
Quarks.install("Bjorklund");
//and recompile
Below is some example SuperCollider code with resulting output as MP3. The hihat plays a 9/16 rhythm throughout and the snare plays 3 different ones... 5/8, 15/16 and 3/8.