Piano, guitar, violin, drums, guzheng, harp — all done. I thought that was the end of it.
Valeriy & Sandrone:Paper Crown and Wooden Sword
After I finished the harp — one of the performance animations I'm building for MusicDoll — I wrote a piece claiming the harp was the most complicated instrument in history: forty-seven strings, all exposed; a body that turns around two pivot points; seven pedals under your feet. At the time I genuinely thought that was the ceiling.
Then I started on the accordion.
The accordion has two hundred and twenty-five buttons, more than the harp has strings. And that isn't even the worst of it. The harp at least stands still: set it down and every string stays where it is. The accordion doesn't. It moves on its own.
Two keyboards, a bellows in the middle, and two hands.
1. The right hand: one note, three places to press
The piano keyboard is one row, one key per semitone. The accordion's right hand is five rows of buttons, stacked at a slant. Inside one column, three of the rows sit a semitone apart; move one column to the right and you jump three semitones.
What makes it worse is that the fourth and fifth rows mirror the first two. Any given note sits on at least three buttons. On a piano, you see a C and there is exactly one C. On an accordion, you see a C and first have to decide which row's C to use.
A note is no longer a position. It's a set of positions, each of which needs a finger, and the fingers still have to stay out of each other's way.
Five rows on the right, where the same note shows up again and again.
2. The left hand: one button is an entire chord
The left hand doesn't even look like a keyboard. Six rows, twenty columns, a hundred and twenty buttons. Each row does one job: counterbass, fundamental bass, major chord, minor chord, dominant seventh, diminished seventh.
Press one and you might get a single note, or a whole chord. The major button gives you three notes; the dominant seventh gives you four. A midi file writes those notes one at a time, so you have to work backwards: given this group of notes, which button did the left hand press?
And the left hand only has four fingers. The thumb sits under the hand strap and doesn't play. Four fingers for six rows and a hundred and twenty buttons. The right hand gets five fingers for five rows; the left hand gets four for six.
Six rows on the left, one job per row. Whether a press gives a note or a chord depends entirely on which row it lands in.
3. The body moves, the bellows breathes
On other instruments the keys are dead. On the accordion they're alive.
Piano, guitar, harp — the body doesn't move. The accordion's two keyboards sit on two separate boxes with the bellows in between. You pull one side out and push it back, the other box travels with it, and the two keyboards keep shifting relative to each other.
Which means the position of every button in the world is a curve that changes over time. While a finger holds a button down, that button is still moving with the bellows. The finger can't just press and stay there; it has to ride along, or it slides off.
Nor is the bellows just a box that expands. Pressing a button only opens a small valve; what actually sets the reeds ringing is the air the bellows pushes through. Volume, timbre and attack are largely not in the fingers — they're in the left arm. The bellows is a dozen-odd folds, and when it opens every fold has to rotate; the whole run bends too.
Reversing is messier still. In real playing, when the bellows runs out you push it back, and the turn points follow the phrases, not a metronome. At the turn the airflow breaks and the sound changes, and the left arm has to prepare in advance.
At first I only got the open and close running on a six-second triangle wave: the bellows move while there are notes and freeze when they stop. That counts as "it moves", nowhere near "it breathes".
When the bellows opens, every fold turns, and the whole run bends.
4. Three straps tying a person to a moving instrument
An accordion only plays while it's hanging on you. Two shoulder straps run over the shoulders and hold the whole instrument against your chest. The third is the left-hand strap, across the back of the left hand — the one the left thumb sits under, as mentioned earlier.
Those three straps carry load. The instrument weighs over ten kilos and the shoulder straps hold all of it. More to the point, the straps pin the body down, so that when the left hand pulls, the bellows actually opens. Without them, pulling drags the whole accordion along and no air moves. The left-hand strap handles the other end: it presses your palm onto the button board, so the pull runs through the back of the hand into the instrument while the fingers stay free to move from button to button.
In software, all three have to be solved, one at a time. Both ends are pinned to something that moves — one to the shoulder, the other to the box that travels with the bellows — and the part in between is soft: it sags, it bends, it has to wrap around the body. You can't pose that with a chain of bones. So you give it a spline, lay the strap along the spline, pin both ends, and let the spline follow the shoulder and the instrument. That's what Spline IK is. The moment the bellows moves, the three splines' endpoints all change, the splines get re-solved, and the leather laid on top gets re-solved with them.
Even if an animator wants to cut corners, the two straps on the body can be skipped. The left-hand one can't. It ties the left hand to the button board; without it the left hand can't push the bellows and press buttons at the same time, and the moment the strap goes slack the hand slides off the buttons.
There's a harder constraint as well. Leather doesn't stretch. Fix the length and you've put a limit on the instrument: how far it can get from the body is now the strap's decision. The straps also can't sink into a shoulder or into the box, so every frame gets re-solved.
The real trouble is that the straps close a loop. The body moves, the straps tighten, the instrument follows, the instrument moving deforms the straps, and the deformed straps decide where the instrument may go next. Earlier sections were about the hand following the instrument. Here it flips: even how far the instrument may travel is something you have to ask the straps.
The three straps are tinted red: two over the shoulders, one across the back of the left hand.
5. Two hands, two clocks
The timeline for a piano animation basically revolves around the two hands. The accordion adds a second clock: the bellows.
The right hand plays melody, the left hand plays bass and chords, and the left arm is pushing and pulling the bellows the entire time. No matter how dense the right hand gets, the left hand can't stop and the air can't break. When a chord goes down, the fingers can hold still, but the left arm is still moving and the bellows is still opening. So "holding" is a less stable state on the accordion than on the piano: the buttons move, the wrist moves, the bellows moves.
Every note also has to be split into press, hold and release. The denser the notes, the more those states get squeezed, until all that's left is the touch itself. On a piano what gets squeezed out is expression; on an accordion what gets squeezed out is the fit between fingers and buttons. Slow down and the bellows carries your fingers away.
And a note has more than one way to be pressed. The fingering that saves effort here can leave you unable to reach the next one. This frame is legal; two hundred milliseconds later it may not be, because the buttons have travelled with the bellows.
6. So what actually makes it hard
The harp has more strings, more pivots, more pedals — but its body is fixed. With the accordion, the body itself moves, and so does the thing that makes the sound. The harp was about making a still instrument complicated; the accordion is about making a moving instrument whole. And that moving instrument hangs off a person, with three bending straps in between.
This build is basically finished now. The hands follow the moving keyboard, the bellows opens and closes with the notes, the turns follow the phrases, the left hand's four fingers find their way across six rows — all of that is solved. Then I moved it from Blender into Unreal, thinking a new engine and one more import would be the end of it. Instead the rig was more or less rebuilt from scratch: when the bellows opens, two keyboards, two hands and three straps all move in the same frame, and if any one of them is a little off, a hand slides off a button or a strap sinks into a shoulder. The hard part was that every one of those had to be dialled in again, and no clever shortcut could save any of it. During the port it really did nearly break me.
So I can say it now: the accordion is the most complicated instrument I have ever built, bar none. The harp comes second.
In a while I'll put out a demo video running in Unreal — you can judge for yourself whether it plays like a person. And if you think something out there is more complicated, name it.