1.4 Swarm Synth Lab

1.4.3 Magnetic Field

Magnetic Field

Drag the three sliders; boids, speed, force and lines bottom right; the picture (grid, arrows, lines) and the sound layers A, B, C at the bottom. Touch to start the sound.

Watch on YouTube (5 min)

The swarm as a magnetic field, seen and heard.

The picture. Every boid is a small magnet pointing the way it flies: one pole at its head, the other at its tail. The field of all of them is added up over the whole stage, and thin grey lines follow it, evenly spaced, the way iron filings show a magnet's field. A line keeps to the field around it: sometimes it connects two boids, sometimes it passes between them, sometimes it is pulled somewhere else entirely. Nothing in the drawing is placed by hand; every line is where the field puts it.

The field itself can be shown too: the fine grid on which it is computed, and on it small red arrows, each pointing the way the field points at that spot, longer and redder where it is stronger. The lines follow the arrows. Grid, arrows and lines are switched on and off at the bottom of the stage, just above the sound; at the start all three are on.

Magnetic Field, the picture: one boid is a small magnet; the fields of several boids add up, and the lines connect them, pass between them, or are pulled away; a flock flying one way becomes one large magnet whose lines sweep across the stage
Magnetic Field, the picture: one boid is a small magnet; the fields of several boids add up, and the lines connect them, pass between them, or are pulled away; a flock flying one way becomes one large magnet whose lines sweep across the stage

Scattered, the boids fill the stage with small eddies, a knot of lines round each of them. When they gather into a flock and fly the same way, their small magnets add up to a large one, and long lines leave its front and sweep round to its back. Whenever the boids turn, split or join, the whole field rearranges itself.

The sound. It comes from the same field as the lines, never from the sliders directly. It has three layers, each switched on or off at the bottom of the stage; it starts with A and C.

Magnetic Field, the sound: A, the slider lines are wires struck by the changing field; B, every field line is a string; C, a line that leaves one boid for another plucks
Magnetic Field, the sound: A, the slider lines are wires struck by the changing field; B, every field line is a string; C, a line that leaves one boid for another plucks

A — wires. The three slider lines are wires stretched across the stage. As the field moves, the magnetic flux through each short piece of a wire changes, and the change induces a voltage in it, as in a guitar's pickup. The current in the field pushes the wire, and the wire rings as a string. Its tension is its slider: moving a slider retunes its wire. A boid crossing a wire gives a short pulse; a large flock passing over gives a long, strong swell. Where nothing moves, nothing changes, and there is no sound.

B — field lines. Every grey line is a string. Its pitch comes from its length and from the strength of the field along it, as a string's from its length and its tension: short, taut lines sound high, long ones low. A line sounds when it moves — when the boids around it move and change its shape. So a scattered swarm makes a bright, restless cloud, and a flock lowers and calms it. The lines sound even while they are hidden: they are the field's, not the drawing's.

C — reconnection. Every line knows the two boids it connects. When a line keeps one end and its other end leaves one boid for another, the field has reconnected — in real magnetic fields this is where energy is released — and the line gives a short, bright pluck an octave above its own string. Reconnections come thickest when flocks loosen, split and regroup.

Playing it. The three sliders set the radii of separation, alignment and cohesion, as in every version of Swarm Synth. A small panel at the bottom right sets the number of boids, their speed and force, and how close the field lines lie. With a Korg nanoKONTROL2 connected, the controller button lets it be played as the Processing program is: the radii and speed on the faders, the weights, force, lines and number of boids on the knobs, the three sound layers and grid, arrows and lines on its buttons (in Chrome, Edge or Firefox; Safari has no MIDI).

  1. 1.4.3.1 Magnetic Field 1.1
  2. 1.4.3.2 Magnetic Field 1.3