treibhaus

2017-11-24 - posted in: creative-coding, autonomous-agents, swarm-behavior, music, sound-art,

Another work exploring autonomous agents and swarm behavior. This is the re-recording of a live performance at Wow! Signal. Bees and robots exhibit different behaviors of attraction and repulsion.

The software I wrote for the performance was a combination of Electron and p5js. I decided to code a custom desktop application to be able to use a MIDI controller and interface my code with the audio done in Max. True, I could have arrived at the same result in Processing more straightforwardly, but it was fun exploring Electron a bit more, which I consider one of the most productive software environments out there at the moment.

The audio projection was a simple 4 channel quadrophonic setup realized with an Ambisonic encoder.

Code

The paths were rendered just using Perlin noise…

1
2
3
4
5
6
7
8
9
10
11
12
13
this.points.push(p.createVector(0, Math.round(p.random(0, p.height))));

let xOff = p.random(0, 100);
for (let i = 1; i < numPoints; i++) {
  this.points.push(p.createVector(
    p.width * i / (numPoints - 1),
    p.constrain(this.points[i - 1].y + Math.round(p.map(p.noise(xOff), 0, 1, -50, 50)),
      0,
      p.height)
    )
  );
  xOff += 0.05;
}

and then

1
2
3
4
5
for (let i = 0; i < numPoints; i++) {
  // ...
  p.curve(this.points[i - 1].x, this.points[i - 1].y, this.points[i].x, this.points[i].y,
  this.points[i + 1].x, this.points[i + 1].y, this.points[i + 2].x, this.points[i + 2].y);
}

Video FX Setup w/Seriously

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const seriously = new Seriously();

// ...

sourceCanvas = p.createCanvas(p.windowWidth, p.windowHeight);
sourceCanvas.id('#sourceCanvas');

seriouslySource = sourceCanvas._seriouslyObj = seriously.source('#sourceCanvas');    
seriouslyTarget = seriously.target('#destination-canvas');
seriouslyTarget.width = p.width;
seriouslyTarget.height = p.height;

// ...
glitch = seriously.effect('tvglitch');
glitch.distortion = 0;
glitch.scanlines = 0;
glitch.lineSync = 0;

glitch.source = seriouslySource;

seriouslyTarget.source = glitch;

seriously.go();

and map some MIDI input to it:

1
glitch.distortion = glitch.scanlines = glitch.lineSync = p.map(message[2], 0, 127, 0, 1);