a Newton’s cradle that plays music
Lift a ball, let it go, and the far one kicks out. In kinetic chime nothing scripts that. It comes from five pendulums and a single rule for how they collide.
by Azalea Cyber Development ·
Lift a ball on a Newton’s cradle, let it go, and the ball at the far end kicks out. Lift two and two kick out. It has stayed on desks for decades because it looks like a trick and is not one. When we built kinetic chime we set one rule: the trick had to come from the physics, not from an animation that already knows what is supposed to happen.
five pendulums that only meet when they touch
The cradle is five pendulums. Each ball knows two things about itself, the angle of its string and how fast that angle is changing. Every step, gravity pulls each ball back toward hanging straight down, a little drag slows it, and it moves. That is all a pendulum is.
Nothing in the code says that when one ball hits the row, the last one flies out. The balls do not know about each other at all until they touch.
a collision is a velocity swap
When two neighbouring balls overlap while moving toward each other, the simulation resolves the impact. The balls weigh the same, and when two equal masses collide almost perfectly elastically, they very nearly trade velocities. The moving ball stops, and the one it hit leaves with its speed.
Put five in a row and the rest follows. The first ball hands its speed to the second, which is already touching the third, and so on down to the fifth, which has nothing in front of it and swings out. Lift two, and two balls’ worth of momentum travels down the line, so two leave the far end. The famous behaviour is not written anywhere. It falls out of the rule.
Getting a whole chain to settle cleanly takes care. Every frame runs four small physics steps, and inside each step the contacts are checked and resolved up to six times, stopping early once nothing overlaps. After each impact the balls separate at 99.6 percent of the speed they met at. That is why the cradle clacks back and forth for a long time, and also why, with a little drag, it does come to rest in the end, the way a real one does.
a note for every gap
A real cradle clicks. Ours rings, and the decision that mattered most was what picks the note. The answer is the gap. Each of the four gaps between the five balls is tuned to its own note, and a note sounds only at the instant two balls meet fast enough to count as a strike, never while they rest against each other, because resting balls are not being struck.
So when momentum travels down the row, the gaps are struck one after another, in order, and a single swing arrives as a short run of notes instead of one click. The music is not a soundtrack laid over the swing. It is the swing, read out loud.
Each strike is synthesized as a struck metal bar, a stack of partials at inharmonic ratios, 1 : 2.76 : 5.4 : 8.93 for chrome, with the higher ones fading faster. That is what makes it sound like metal rather than a pure tone.
the frame had to fit the swing
One lesson came from getting the geometry wrong. On a real cradle the frame sits just outside the path of the balls. Our first version let the outer balls swing far enough to pass straight through the uprights. The fix was to set the swing limit and the width of the frame together, so a ball can only ever be pulled as far as the frame has room for.
looks that change the sound and nothing else
The cradle comes in five materials and four tunings. Each material carries its own voice as well as its own shine: brass rings longer and warmer, obsidian rings short and dark, and cut glass is nearly pure. Every one of them swings, collides and settles identically, so no finish plays better than another.
paid for what you start
Kinetic chime pays Drops for swings you start, not for strikes. A cradle can ring on its own for a long while, and a toy that paid per strike would be paying you to leave a tab open. Paying for the swing you began keeps the reward attached to something you actually did. Kinetic chime is one of the dopa+ toys.
the toys in this piece
keep reading
- nothing you hear is a recordingEvery pop, snap, whir and chime in dopa is made in your browser at the moment you cause it. Here is why, what it costs, and how a few of them work.
- the fluid in liquid is realDrag through liquid and the colour follows, curls and keeps moving. None of it was animated in advance. This is the simulation underneath.
Spotted something wrong, or want to know more? support@dopasim.com