Cristián Huepe, Marco Colasso and Rodrigo F. Cádiz
This page accompanies the paper of the same title (American Control Conference, 2012) and its extended version (Chapter 7 of Controls and Art, Springer, 2014). It runs the flocking model and the three sound mappings described there, in the browser, so that the examples in the figures can be seen and heard rather than read. Section and equation numbers follow the chapter.
The chapter starts from an observation about music: to be interesting, it needs both order and disorder, coherence and decoherence, structures that consolidate and collapse. Groups of agents following decentralized control rules show the same interplay. They can reach consensus and move as one, or act independently. The question is what happens when one is mapped into the other: which mappings let a listener hear the collective state of a flock, and which produce musically interesting results.
The model is the Vicsek model. N point-like agents move at a fixed common speed v0 in a two-dimensional square box of side L with periodic boundary conditions. Their only interaction is alignment: at every step each agent steers toward the mean heading of all agents within a radius R, with some noise.
Ang{·} gives the angle of a vector, Vel[·] the unit vector along an angle, Zi is the set of agents within distance R of agent i, and ξi is a random number uniformly distributed in [−1/2, 1/2]. For low noise the agents converge to a common heading; for high noise they point in random directions. The polarization order parameter measures which:
It is 0 in the disordered state and 1 in the polarized flocking state. In both phases agents gather into clusters that keep splitting and merging, with more large clusters at low noise. Clusters do not influence each other until they come closer than R.
Each agent drives one sinusoidal generator, Ai(t) sin[ωi(t) t]. Every mapping produces a normalized frequency ωi between 0 and 1 and an amplitude Ai; a final stage maps ωi linearly or exponentially onto a chosen range of audible frequencies. The three approaches differ in where ωi comes from.
Each figure of the chapter shows five panels for one approach: snapshots of the disordered (a) and ordered (b) states, the spectrograms of their sound (c, d), and the spectrogram of a run in which the noise is lowered so that the system goes from disorder to order (e). The buttons below start those runs with N = 30 agents and the noise values quoted in the text. Each takes 15 seconds, the length of the printed spectrograms.
The state of each agent is tied directly to its sound: the x coordinate of agent i is its frequency ωi. (In the full system the y coordinate sets the rate of an amplitude modulation; as in the chapter's example, the amplitude is kept constant here.)
The individual dynamics of each agent can be followed, and the two phases are easy to tell apart, but clusters leave no trace in the sound and the result quickly becomes monotonous.
Here the sound variable is decoupled from the instantaneous state of the flock. Each agent carries a frequency ωi(t) and a randomly chosen preferred frequency ωi0 in [0, 1] that stays fixed during the run. The frequency follows a consensus protocol with the agents inside a sonic interaction range RS > R:
Si holds the ñi agents with ‖xj − xi‖ < RS. β1 sets how fast each frequency converges to its target; β2 sets the weight of the preferred frequency against the neighbors'. An isolated agent returns to ωi0; agents that flock together long enough end up almost in unison. The amplitude makes interacting agents more audible:
Listen for what happens when a cluster splits: the agent that leaves jumps back to its preferred frequency very quickly, while the larger cluster drifts slowly to its new mean. In the transition run, frequencies converge and diverge repeatedly as clusters merge and split.
The third approach imagines a friction-like process in which agents produce sound as they "rub" against each other, as in a rotating motor whose pitch depends on the relative speed of its parts. The frequency of each agent is proportional to its speed relative to the mean velocity of its neighbors within RS:
This is 0 when an agent moves exactly with its neighbors and 1 when it moves against them. The amplitude is that of Eq. (7.6).
Ritmos Circadianos (Cádiz, 2012) is a piece for the Logos Foundation's Man and Machine Robot Orchestra, generated in real time from a Vicsek simulation with twelve agents, one per robot instrument, using the coupled oscillators approach. It lasts 10 min 24 s: 26 sections of 24 s each, ten bars at 100 beats per minute, by analogy with a 24-hour circadian cycle. Each agent's ωi is quantized to MIDI notes within its instrument's range; its distance to the center of the space sets its loudness; and its state rescales the periods of up to three superimposed pulses, so that agents close to the mean heading play regular patterns and agents far from it play irregular ones.
Table 7.1 lists the model parameters of each section. Click a row to put the twelve-agent flock in that state and hear its coupled-oscillator frequencies as sine tones.
| § | r | ηp | ηa | β1 | β2 | Instrumentation |
|---|
All three mappings let a listener tell order from disorder. The two that use indirect measures of the dynamics, the coupled oscillators and the physical friction, give the more interesting and appealing results: their sound depends only on encounters between agents, not on where the agents are. The chapter suggests natural extensions that were out of reach of the original real-time tools, among them a Kuramoto model coupling the phases of neighboring agents, and treating a cluster as an elastic membrane.
What comes from the chapter and what does not. From the text: the model and Eqs. (7.1) to (7.7), N = 30, the noise values of every example, RS = 2R, β1 = 0.78, β2 = 0.30, the 15 s spectrograms, the 700 Hz floor of the friction example, and Table 7.1. Read off the MaxMSP panel in Fig. 7.2: R = 0.1, 30 frames per second, the 200 to 5000 Hz range with exponential scaling for the coupled oscillators, and Amin = 0.1. Chosen here because the chapter does not state them: the box side (L = 1), the speed (0.2 box sides per second), linear scaling for the direct and friction examples (judged from the printed spectrograms), and noise η expressed as a fraction of a full turn, so that the heading perturbation is 2πη ξ. Equation (7.4) is advanced once per frame. Fig. 7.1 is recomputed at the density of the sound examples and over the full noise range, so its horizontal axis is not the printed one.
C. Huepe, R. F. Cádiz and M. Colasso, "Generating music from flocking dynamics," Proc. American Control Conference, Montréal, 2012, pp. 4339–4344. doi:10.1109/ACC.2012.6315529
C. Huepe, M. Colasso and R. F. Cádiz, "Generating music from flocking dynamics," in A. LaViers and M. Egerstedt (eds.), Controls and Art, Springer, 2014, pp. 155–179. doi:10.1007/978-3-319-03904-6_7