Inspiration
On 15 January 2015, the Swiss National Bank suddenly removed the floor that had pinned the franc to the euro. In minutes the franc jumped by more than 10%. Companies that had tried to protect their assets with euros, because the two currencies had always moved together, found that their insurance stopped working overnight. It was a true trading market storm.
We wanted to get creative in the storm and make that moment something you can hear. People notice a sour chord instantly, much faster than they spot a broken correlation on a chart. So we set out to explore a new world: one where machines don't exchange numbers but music, and where the finance itself becomes a composition.
What it does
Storm Chorus is an intelligent system of four MacBooks: a swarm of actors working towards a common goal, protecting a UK company that owes Swiss francs through a replay of January 2015.
- Each Mac is an adviser that makes decisions independently. All four run identical maths and differ in one thing only: how much history they trust (their memory, from 2 hours to 5 days).
- Each adviser plays a chord in A major. The chord's root shows its strategy, and how clean it sounds shows how well its hedge is working. When the hedge fails, the chord detunes and gains clashing notes and noise.
- The Macs aren't networked. They talk through a physical language that encodes digital information: each Mac sends its score and strategy as a short melody of plucked notes, and the others decode it through their microphones.
- Each Mac senses the room, analyses what it hears, and responds to the real world by moving its strategy towards whichever adviser is doing best. The room goes from harmony (calm market), to dissonance (the storm), to unison (the swarm agrees on the strategy that weathers the storm).
- It stays resilient when communications fail. A Mac that can't hear the others keeps hedging and playing on its own. If a Mac goes silent, the others mark it lost and carry on.
How we built it
Data. We downloaded 1-minute EUR/CHF, EUR/GBP and GBP/CHF prices for January 2015 from Dukascopy, dropped the filler rows recorded while markets were closed, and resampled to 2-hour bars. The replay runs from 12 to 22 January and stops before the European Central Bank's announcement, when the euro broke away too.
Finance. The exposure S is the pound value of a franc, and the hedge F is the pound value of a euro. Each adviser estimates its hedge ratio from exponentially weighted statistics of log returns:
$$h_t = \frac{\sigma_{SF}}{\sigma_F^2}, \qquad \lambda = 0.5^{1/H}, \qquad H = 2^{\text{dial}} \text{ bars}$$
Here σSF is the weighted covariance of franc and euro returns, σF² is the weighted variance of euro returns, and λ sets how quickly old data is forgotten.
Its score is the hedge effectiveness over the last two trading days, the same yardstick for everyone:
$$E = 1 - \frac{\operatorname{var}(r_S - h_{t-1}\, r_F)}{\operatorname{var}(r_S)}$$
Each adviser uses the previous bar's hedge ratio, so it never sees the future.
Composition. Each strategy is a chord in A major, so moving between strategies always stays in key. As the score E falls, the third and fifth detune by up to 30 × (1 − E) cents, which creates audible beating. Below 0.7 a semitone clash fades in, below 0.4 a tritone, and below 0.2 filtered noise. Loudness stays constant, so failure sounds wrong, not louder.
A physical language. Each 40-bit packet (sender, score, strategy, CRC-8 check) is written in base 14 and played as 11 plucked notes from A major, between 2 and 8 kHz, above the chords. The Macs take turns to "sing", and every Mac lines up its turns with the melody it hears from the lowest channel. A high-frequency 16-tone FSK modem (14–19 kHz) is kept as a fallback, and every Mac always decodes both, so the encoding and comms never depend on a single channel.
Starting together without a network. Any Mac can start the room with a 4-beat count-in of clicks. Every Mac detects it and starts its replay on beat 4. Running Macs also announce their position, so a Mac that missed the count-in can join late.
Independent decisions. Every 2 seconds, each adviser looks for the best-scoring adviser it can hear and moves halfway towards its strategy, but only once a fresh packet confirms the lead. After a move it checks whether the gap to the leader shrank. If not, it moves back and ignores that leader for a while. When nobody is worth following, a struggling adviser sometimes explores a nearby strategy, so the swarm doesn't simply herd.
Demo storm. On the real data the euro genuinely stopped hedging the franc: every strategy scores near zero for days after the crash. For the demo we keep the real calm and the real crash, then replace the aftermath with a seeded simulation, so the strategies split clearly and converge within the replay.
Stack: Python (FastAPI, NumPy, pandas, sounddevice) for the finance, synth and modems. React + Vite + TypeScript for each Mac's page, where the chord is drawn as a glowing orb whose note-stars drift apart as the hedge fails and turn gold when the room converges. We tuned the swarm with an offline simulation and a strategy sweep tool, then ran it on real MacBooks talking to each other through their speakers and microphones.
Challenges we ran into
- Our first data choice failed our own test. With 15-minute bars, the euro–franc link after the crash was so weak that every strategy scored under 0.07, so there was nothing to converge on. Switching to 2-hour bars made the strategies genuinely different.
- High-pitched data tones were painful in a room. Many people can hear 14–19 kHz. We rebuilt the link as a melody in the key of the piece, so the data became part of the music.
- Stale news in the storm. A packet takes over a second to play, so on the shock bar, advisers were chasing a leader whose score had already collapsed. Requiring a fresh packet to confirm a leader fixed it.
- Convergence that never arrived. Moving 20% towards the leader never reached one chord before the replay ended. 50% did, in every simulated run.
- Keeping sounds out of each other's way. The noise layer leaked into the data band, so we built a 6-stage filter. The melody notes also triggered the count-in detector until it required three of four click partials to rise together.
- From simulation to a real room. Speakers, microphones and echoes in a real room behave nothing like a clean simulation. Getting four real MacBooks to hear each other, start together and stay in time took plenty of tuning on the day.
- Laptop restrictions. Blocked downloads and a security tool blocking our frontend build tooling meant finding workarounds early.
What we learned
- How cross-hedging works, and why it fails exactly when you need it most. In January 2015 the euro really did stop protecting the franc.
- The physics of dissonance: two nearly matching pitches beat, and anyone can hear that wobble.
- How to turn sound into a working data link: encoding, turn-taking, timing and error checking.
- That swarm actors with no central boss can still reach a common goal, and that following the leader too eagerly is its own risk.
- How to work as a team of four with a single shared spec, separate lanes, and AI agents writing code that we reviewed.
What's next
- Smarter swarm behaviour (particle swarm optimisation) instead of simply stepping towards the leader.
- More strategy dimensions than memory length, and ways to keep diversity in the swarm.
- Using the MacBook lid angle as a physical "risk appetite" dial, so the system senses even more of the physical world.
- Longer warm-up data, so the slowest strategies settle properly before the replay.
Built With
- css3
- fastapi
- github-actions
- html5
- matplotlib
- node.js
- numpy
- pandas
- portaudio
- pytest
- python
- react
- sounddevice
- svg
- typescript
- uvicorn
- vite
- websockets