Skip to content

The Machine · Control

The system

The one signal every element listens to, whatever drives it. Everything is said early and many times, so no element ever depends on a message it might miss.

Overview

How it works

Every element listens to this one signal, so building any element here means building this too. It is one way to meet the principles, not a rule for anyone else, and the technologies are choices for this attempt.

How control reaches the elementsA computer sends MIDI over USB to a bridge. The bridge broadcasts to addresses. Four elements listen: two share an address and play in unison, one is switched off and is silent. No element sends anything back.COMPUTERplays the MIDIUSBBRIDGEone ESP32, broadcastingto addressesELEMENTAddress 1ELEMENTAddress 2ELEMENTAddress 2same address: plays in unisonELEMENTAddress 3switched off: silenceEach element: its own battery and ESP32, address set on the element. Nothing is sent back.
How the signal reaches the elements. Modeled on stage lighting, where every fixture has its own power and an address, and only listens. The bridge never knows which elements exist.
  • One transmitter, many listeners. A small board called the bridge is the only thing that transmits. Whatever drives it, a computer sending MIDI or a console of buttons, plugs into it. Every element has a board of its own, an ESP32 (a small, inexpensive computer with a radio), that only listens over ESP-NOW, a mode of that radio that sends short messages to every board in range without joining a network. Nobody replies and nobody confirms.
  • Everything early, everything often, nothing only once. About fifty times a second the bridge sends a short message. Each one carries the current time and a rotating share of everything the elements need: the tempo, what each element should be doing, the rhythms they play, and any single hits due in the next second. A lost message is replaced by the next copy a fraction of a second later.
  • Every element keeps its own copy. It plays from its own clock, so a gap in the signal doesn't interrupt it. An element switched on mid-piece is playing in time within about a fifth of a second.
  • The transmitter doesn't know who is listening. It sends to numbers, not to elements. A missing element is silence; two elements set to the same number play in unison. There is no pairing, handshake or session to set up, which rules out Bluetooth MIDI and network MIDI.

Every element

  • Standalone: self-contained, sharing nothing with the rest of the ensemble.
  • Wireless: no cables to the transmitter or to any other element.
  • Only listens: hears the signal and never transmits.
  • Its own power: the shared power-tool battery, so packs swap between elements.

Adding or removing any element has no effect on the signal or on the rest of the performance. Every element resets itself: technicians bring it out, switch it on and walk away, and anything that winds down, drops or runs out restores itself. Frames and structure for this attempt are aluminum extrusion.

Numbers and groups

Each element has a number from 1 to 64, set on the element itself with a switch a technician can read. Every message says which numbers it is for, so one element, a group such as all the drums, and everyone are all the same thing. Groups are kept on the show computer, so regrouping never touches an element. An element with several parts that need their own tempo, like a frame of three pellet drums, takes three numbers in a row.

The live sequencer

In the Live sequencer, a viewer's rhythm goes to the show computer, which keeps it within what that element can do and sends it out from the next bar line like any other part. A viewer can only change the rhythm of the element they chose. Nothing on stage talks back.

Timing

  • One clock for everyone. Each element compares the time written in every message with the moment the message arrived, and keeps its own clock matched to the bridge's. Every element hears the same message at the same instant, so they agree with each other to within a millisecond. Two hits start to sound smeared at around ten milliseconds apart.
  • Through the gaps. The clocks on these boards drift by around a millisecond a minute, so an element keeps good time through several seconds of silence.
  • The sound lands on the beat; each element works out when to act. Instructions name the moment a sound should happen. Only the element knows how long its mechanism takes, so it works backward from its own measured delay. The cannon hears “chime 3 on beat 130” a second ahead, turns toward chime 3, and fires 0.15 seconds before the beat so the strike lands on it.
  • Rhythms, not streams of notes. Each element is given a short loop of steps, like one row of a drum machine, and plays it bar after bar. Changes start at the next bar line. An element skips any step it physically can't make, such as a note that comes before the cannon has reloaded.
  • Free and locked. Free, an element plays its loop at its own tempo and tuning, drifting against the rest. “Locked from beat 129, with four beats to get there” is sent well ahead. Elements that strike jump onto the shared grid on that beat. Elements that move, like the Click or the gantry pendulum, can't jump: during the four beats they quietly speed up or slow down until they line up, silent, and become audible exactly on beat 129. “Free from beat 300” lets them drift apart again, each from where it is.

Safety

Stopping

Two kinds: quiet, which is musical (stop making sound, finish resetting, rest), andall-stop, the emergency (stop moving now, the safest way that element can).

  • Stop is never one message. While the stop button is down, every message the bridge sends carries it, fifty a second. An element stops on the first one it hears.
  • Silence means stop. An element that hears nothing for about two seconds winds down safe and quiet on its own. If every stop message were lost, it would still stop, because losing every message looks exactly like silence.
  • Stop stays stopped. An element stopped this way waits until the bridge's activate button is held down. A transmitter that hangs, repeating the same message over and over, counts as silence.
  • The bridge starts stopped. After switching on, it sends stop until someone activates it.
  • Every element has its own stop switch, hit by the technician before lifting it. It cuts power to the moving parts directly.
  • Moving parts stay gentle. Rotating elements are balanced, slow and guarded, and hinged parts latch in every position.

The status light

Elements can't report a fault over the radio, so each shows its state on one colour light, with the same meaning on every element.

The lightIt means
Slow blue breathingOn, hearing no transmitter
Dim greenHearing the transmitter
Dim green, a white flick on every beatLocked
Steady amberResetting itself
Slow amber blinkBattery low
Solid redStopped
Red blinks in groupsA fault: the count is its number in that element's own list
Fast white flashingAsked to show which one it is

Every fault stops the moving parts and holds. Once the cause clears, the element tries one slow reset of its own, and if that fails it stays put until it is switched off and on.

Approaches

Control can be wired or wireless, and there are several ways to do each. We started with ESP-NOW broadcast: the radio is already on the board every element uses, nothing has to join or pair, any element can appear or vanish without the transmitter noticing, and every element hears each message at the same instant. Its weak spot is a crowded room, which is why everything is said early and many times. The others would work too; each trades something.

Wireless

ESP-NOW broadcastWhere we started

TimingLands in a few milliseconds, at the same instant on every element.

Free: the radio is already on the board every element uses. Nothing joins or pairs, so elements come and go unnoticed. Messages are never confirmed, and a full room's phones crowd the same band, which is why everything is said early and often.

A Wi-Fi network, sending to a group address

TimingTens of milliseconds, and uneven. Group messages go out at Wi-Fi's slowest speed and are never resent.

Every element has to join a network run by a router, and the router becomes one box whose failure silences everything.

sACN or Art-Net over Wi-Fi

TimingAs uneven as any Wi-Fi network.

The lighting world's way of sending DMX over a network, so a lighting desk could run the show. Same router problem, and it carries settings only, with no way to say “at beat 130”.

Wireless DMX (CRMX, W-DMX)

TimingSettings refresh up to about 44 times a second, so a hit can wobble by up to about 23 ms.

Built for stages and very robust. Each receiver is linked to its transmitter once, costs far more than an ESP32, and carries settings only.

Bluetooth LE advertising

TimingMessages at least 20 ms apart, each pushed back by up to a further 10 ms at random.

Connectionless and on the same chip, but tiny messages and uneven timing. Bluetooth 5's periodic advertising removes the random delay, and is worth trying on newer ESP32 chips.

nRF24 radio modules

TimingWell under a millisecond on air, with acknowledgements switched off.

Very cheap and simple, but an extra module on every element, in the same crowded band. Clone modules vary a lot.

802.15.4 broadcast, the radio under Zigbee and Thread

TimingA few milliseconds.

Built into the ESP32-C6 and H2. Plain broadcast fits the rules; Zigbee and Thread themselves don't, since devices join a network. Slower than ESP-NOW, in the same band.

A sub-GHz data radio (433, 868 or 915 MHz)

TimingA few milliseconds.

Modules such as the RFM69 or CC1101 pass through a crowd better, in a quieter band. An extra module per element, and the allowed band depends on the country.

Cheap 433 MHz transmitter and receiver pairs

TimingSlow, and noisy.

The doorbell kind, pennies each, with no error checking and very little data. Enough for a single “go”, not for a clock.

LoRa

TimingTens to hundreds of milliseconds per message.

Kilometers of range a stage doesn't need, and too slow for fifty messages a second. Some countries also limit how often it may transmit.

A wireless click track

TimingEven, and nearly instant.

An in-ear monitor transmitter, with a receiver on each element. Proven on stage, since musicians play to clicks this way, but a receiver per element costs far more, and a click carries time, not instructions.

Light: infrared or visible flashes

TimingInstant.

Needs a clear line of sight to every element, and stage lights and sunlight get in the way.

Sound in the room

TimingLate by about 3 ms for every meter between the speaker and the element.

Elements that literally listen is an appealing idea, but the delay grows with distance, and the music itself is in the way.

Wired

DMX512 over cable

TimingSettings refresh up to about 44 times a second, so a hit can wobble by up to about 23 ms.

The stage-lighting system Control is modeled on: fixtures with their own power and an address, which only listen. Cheap and robust, but every element needs a cable.

An RS-485 bus, with our own messages

TimingFast and even, and nothing gets lost.

The wiring underneath DMX: one pair of wires chained from element to element, cheap and long-reaching. It could carry this exact design over a cable.

MIDI cable

TimingAbout a millisecond per note, and notes queue up when many go at once. Its clock is 24 pulses per beat.

Every piece of music gear speaks it, but it can only say “now”, so nothing is sent ahead. Cables chain through each instrument, with 16 channels to share.

An audio click or timecode over cable

TimingVery even.

Simple, and standard in theatre, where timecode travels as sound. It carries time only.

Ethernet with precise time

TimingClocks agree to well under a microsecond.

What professional audio networks use. A cable and a network switch port per element, and a more complex board.

Every element stands alone, with no cables to the rest of the ensemble, so this attempt leaves the wired approaches aside; another attempt could choose one. The messages don't care what carries them, so a fixed installation could run the same design over a cable.

Elements

Shared code

The same code runs on every element: the radio, the clock, the rhythms, locking and drifting, stopping and the status light. Each element adds only what is its own:

  • what each of its notes means: a chime, a slide position, a drum
  • how long each note takes from command to sound, measured on the bench
  • what it can't do, such as how quickly it can repeat
  • how it goes quiet, how it stops in an emergency, and how it resets itself
  • its list of faults
  • for elements that move, a sensor that reads where in its swing or turn it is

Lapless Steel is the natural first element to run it.

Wiring an element

What every element needs to listen, before its own mechanism goes in. Be exact here: this is the power and the stop.

KindPartQtyEach
BoughtESP32-S3 development boardThe same board everywhere, so spares swap and every pin number on this page holds.1$6.00
BoughtBattery adapter for the shared power-tool platform1$10.00
BoughtBlade fuse holder and fuseSized a little above the element's largest normal current.1$2.00
Bought5 V step-down converterPowers the board and the light.1$4.00
BoughtLatching stop button, emergency-stop style, with a spare contactRated above the element's motor current. Each recipe also offers a plain two-pole power switch in its place.1$8.00
BoughtMomentary push button, normally openThe test button, so a technician can check the element without a laptop.1$1.00
BoughtLogic-level MOSFET module, or a relay moduleThe one switch every motor and solenoid goes through. It must switch fully from a 3.3 V pin.1$2.00
BoughtRGB LED, common cathode1$0.50
Bought220 Ω resistors3$0.05
Bought6-way DIP switchSets the element's number.1$0.50
Bought10 kΩ resistor1$0.05
Bought100 kΩ and 15 kΩ resistorsOne of each, to read the battery.1$0.10
Total$34.30
  1. 1

    Fit the fuse right after the battery adapter, before anything else.

    TrickyA power-tool pack can deliver tens of amps into a short. The fuse is what stops a pinched wire from becoming a fire.

  2. 2

    Run the 5 V converter from the fused supply, and power the board and the light from it.

  3. 3

    Run the supply for the moving parts through the stop button, then through the MOSFET or relay, so either one cuts it.

    TrickyThe stop button must break the power itself, not only tell the board. A program that hangs can't ignore a switch that has cut the power.

  4. 4

    Drive the MOSFET from one pin, with the 10 kΩ resistor from its gate to ground.

    TrickyWithout the resistor the pin floats while the board starts, and motors can twitch.

    CheckHold the board's reset button: nothing can move.

  5. 5

    Wire the stop button's spare contact to an input pin, so the board knows it has been pressed.

    CheckPress it: the light turns solid red.

  6. 6

    Wire the test button from GPIO 14 to ground, using the board's own pull-up. A short press plays each of the element's notes once. Held for two seconds, it redoes what the element can learn by itself, such as homing. It works only while the element is resting, and a stop always wins.

    CheckType status into the console: it says the test button is up, and down while you hold it.

  7. 7

    Wire the status light, each colour through a 220 Ω resistor to its own pin.

    CheckThe blink example lights each colour in turn.

  8. 8

    Wire the six DIP switches to six pins, using the board's own pull-up resistors. Read as a binary number, plus one, they give 1 to 64.

    CheckThe board prints its number when it starts.

  9. 9

    Read the battery: 100 kΩ from the fused supply to one of GPIO 1 to 10, and 15 kΩ from that pin to ground. The S3's other analog pins can't be trusted while the radio is on.

    TrickySwapped, the two resistors put nearly the whole battery voltage on the pin, and that destroys it.

    CheckA full pack, about 21 V, reads about 2.7 V at the pin.

  10. 10

    Load the shared listening code, with this element's own part added.

    CheckWith the bridge running, the light breathes blue, turns dim green once it hears the bridge, and flicks white on every beat once locked.

Sound

Each element's sound reaches the sound system without breaking the standalone, wireless rule: a pickup on each element sending its sound wirelessly, microphones in the room catching the acoustic sound (rotating elements carry it around the room), or a mix of both.

The first test

The bridge, plus two listeners standing in for elements, and a logic analyzer to see how closely they agree.

KindPartQtyEach
BoughtESP32-S3 development boardThe same board as the bridge, and the one that goes in every element. These two don't need the antenna socket.2$6.00
BoughtRGB LED, common cathodeThe status light, one per listener.2$0.50
Bought220 Ω resistors6$0.05
BoughtBreadboards and jumper wires2$3.00
BoughtUSB cables to fit the boards2$3.00
SalvagedSmall USB power bankLets a listener walk around the room. Any phone power bank will do.2·
Total$25.30

Tools

  • USB logic analyzer, 8 channels, with the free PulseView software
  • Tape measure
  • A phone that can stream video
  • A few people to stand between the boards
  1. 1

    Wire an RGB LED to each listener board as on the bridge: red, green and blue each through a resistor to GPIO 6, 7 and 15.

    CheckThe board's blink example lights each colour in turn.

  2. 2

    Load the bridge with a program that sends a message every 20 milliseconds carrying its time and a tempo of 120 beats per minute, and the listeners with one that keeps a clock from those messages and flashes on every beat. Then press activate.

    CheckBoth listeners flash white on every beat, dim green in between.

  3. 3

    Clip the logic analyzer to each listener's beat pin, GPIO 16, and record a minute.

    TrickyJoin the analyzer's ground to both boards' ground, or the readings are noise.

    CheckThe two pulses land within a millisecond of each other, beat after beat.

  4. 4

    Walk one listener across the room and back, noting its missed-message count every few meters.

    CheckThis is the room's baseline.

  5. 5

    Repeat with people standing between the bridge and the listener, and a phone streaming video beside it.

    TrickyThis is the test that matters. A full room loses far more messages than an empty one, because bodies absorb this radio band and phones crowd it.

  6. 6

    Unplug the bridge.

    CheckThe listeners keep flashing on the beat for about two seconds, then turn slow blue.

  7. 7

    Plug it back in, press activate, then press stop.

    CheckBoth listeners turn red at once, and stay red until activate is pressed.

  8. 8

    Switch one listener off and on while the other runs.

    CheckWithin a fraction of a second it is flashing on the beat again, in step with the other.

Proving it

These prove the system before any real instrument exists, with simple stand-ins: an ESP32, an LED, a buzzer. The first test above is the first of them.

  1. 01

    One element hears the signal and plays on command.

  2. 02

    Two elements on different numbers. Switch one off and on mid-piece, with no effect on the other or on the transmitter.

  3. 03

    An element switched on mid-piece picks up where the piece is within moments.

  4. 04

    Unplug the bridge: every element goes safe and quiet.

  5. 05

    Elements running free, then all locking on one beat with no audible smear.

  6. 06

    A turning or swinging element lining up silently and coming in on the beat.

Tuning

Tuning

How long silence lasts before going quiet
Start at two seconds. Longer rides out radio dropouts; shorter stops sooner when the signal is truly gone.
How far ahead, how many copies
Start at one second ahead and five copies over half a second. If the crowded room loses whole half-seconds at a time, spread the copies wider. If it loses almost nothing, fewer will do.
Messages per second
Start at fifty. Fewer leaves more room for everything else on the channel; more lets an element that has just been switched on catch up faster.

Variations

The Click leading
Instead of the Click following the shared clock, the clock could follow the Click, if something on the controller's side watches it swing.