2 Reference

2.4 Sound — what makes a sound

The target is that what you see is what you hear: no flock (scattered, or jammed) → silence, scattered notes or a crackle; one big flock flowing as a wave → a continuous hum. Five sources make every sound, each from a relation between boids; all are sine waves, nothing is sampled, and nothing sounds by itself (radii 0 = silence).

Source When it sounds Pitch Length and loudness
Drone — one per flock, up to 4 (2.4.1) while a flock exists (after 0.5 s) height of the flock's centre: bottom 55 Hz → top 220 Hz (two octaves; the octave control moves it, 2.4.1). Four partials: an aligned flock is harmonic (1, 2, 3, 4 ×, clear), a disordered one bell-like (1, 2.76, 5.4, 8.9 ×, clashing) continuous; fades in and out over about 1/3 s. Loudness = the flock's share of all boids; brightness = how stretched it is
Ping (2.4.1) the moment a flock becomes highly ordered (0.85) 4 × the flock's pitch one note, rings 1.2 s
Encounter notes (2.4.2) two boids enter each other's separation radius the flock's pitch × a partial chosen by height on screen (high = high partial); on its harmonics when the flock is ordered, slightly free otherwise very short: 0.08 s inside a flock, 0.4 s outside. Loudness = the pair's relative speed. At most 24 per second. Fade out as a boid trembles
Trembling crackle (2.4.3) a boid pushed back and forth by its neighbours: its direction turns back more than 2.5 times a second 4 × the pitch of an encounter note there: too short to be heard as a pitch a 3 ms grain (a tick) per turn-back, so faster trembling crackles faster; louder from 2.5 to 7 turn-backs a second
Beat (key k, 2.4.5) a flock's centre crosses a line of the invisible grid the flock's 1st, 3rd and 8th partial a short hit; a compact flock hits tight, a spread one longer and softer

Drone, notes and crackle can each be muted while playing (d e j, on the controller strip 6); these are for playing only and never written into a score.

2.4.1 Macro — every flock sings

The four largest established flocks each get a drone voice: four sine partials forming one timbre. A voice fades in at its flock's own pitch when the flock forms, follows it, and fades out (~2 s) when the flock dissolves or merges away. With no flocks there is no drone.

Flock measure Sound Mapping
centroid height pitch 55 – 220 Hz, exponential; top of screen = high. Jumps when the flock wraps across the top/bottom edge
centroid left/right pan −0.8 – 0.8, equal-power
polarization harmonicity partial ratios glide from bell-like (1, 2.76, 5.40, 8.93) to harmonic (1, 2, 3, 4)
size loudness 0.5 × flock size / all boids: the whole swarm as one flock is the loudest
elongation brightness upper-partial falloff 0.15 – 0.8

Ping: when a voiced flock's polarization rises above 0.85, a soft sine sounds two octaves above that flock's pitch (30 ms attack, 1.2 s release); it re-arms below 0.70.

Octave: the whole register — drones, pings, notes, crackle and beat — moves by whole octaves, −2 … +2 (MIDI knob 6, score cue octave). It jumps rather than glides, and the notes keep their relation to the drone. Notes above 18 kHz are left out: two octaves up, the crackle would alias.

2.4.2 Micro — encounter notes

2.4.3 Trembling — the crackle

Boids that stay where they are and tremble (jammed at high separation, knots, a swarm circling in place) crackle instead of ringing clear notes, which would not fit the picture. A boid's direction, averaged over 0.1 s, is compared with the 0.1 s before; turning back by more than 90° means its neighbours pushed it back. The rate of these turn-backs (smoothed over about 1 s) separates the states cleanly:

State Turn-backs per second and boid Crackle
flowing flocks and waves 0 none
roaming freely 0.2 – 0.9 none
evenly spread, trembling softly (separation 125) 3.4 – 3.8 soft, 400 – 460 grains/s
jam, knots, circling in place 5.3 – 6.5 strong, 630 – 800 grains/s

2.4.4 Macro tunes micro

2.4.5 The beat — flocks crossing a grid

Can a swarm keep time? Yes — if the flocks fly straight. An invisible grid (every 120 px at Full HD: 16 columns × 9 rows; a row line runs through the centre of the stage) lies over the stage. When the centre of an established flock crosses a grid line, a short sine hit sounds. An aligned flock flying straight at a steady speed crosses evenly spaced lines at even intervals: a regular beat, emerging from the flock's own motion. No clock is involved (logic first).

Lineage: lines in space that sound when crossed run through the whole series. In Swarm Synth I and II (2018) a boid crossing a line of a grid retuned layered sines or struck a note; IV had four horizontal “sine strings”, where a boid crossing a string retuned that string's sine. V takes the same idea to the level of the flock: a whole flock crossing a grid line strikes a short sine, and a straight-flying flock crosses lines at even intervals, which gives rhythm. As the beat grid, IV's lines are back with a new function.

Flock Beat Detail
lines across its main direction main beat alternating low / middle sine hit (1st / 3rd partial of its drone)
lines along its main direction high hits high sine (8th partial); heading sets the main beat : high ratio (polyrhythm)
speed tempo speed 3 ≈ 70 – 90 BPM, speed 5 ≈ 140 BPM (grid 120)
size loudness share of all boids
compactness tightness compact = short, sharp hit; spread = longer, softer
its drone tuning every hit is a partial of the flock's own drone: the beat is the flock's chord, struck
several flocks several pulses slightly different tempi drift in and out of phase

2.4.6 Steady flight is the key: max force

With a high max force (IV's 1.0), boids inside flocks turn about 40° per frame, the flock's centre moves unevenly, and the beat is irregular (interval variation 40 – 120%). With a low max force the flight is smooth and a straight-flying flock gives a metronomic beat: at 0.15, intervals 0.78, 0.78, 0.78, 0.80 s at speed 3; 0.42, 0.42, 0.43 s at speed 5. The default, 0.3, lies in between (2.2.3). The beat still breaks when a flock turns, merges or splits — grooves with breaks. A score that wants a steady beat therefore sets a low force; it is a score line, so each piece chooses its own flight.

2.4.7 The built-in synthesizer

The sound is made by a small synthesizer inside the sketch rather than by a library, so that the same sound goes to the speakers (preview) and into the video (render), sample-exact and in lockstep with the frames.