BEEP BOOP
Public beta

A kick drum is twelve numbers

Beep Boop's drums are not recordings. There is no file of a kick anywhere in the app. Each of its 64 drum sounds is a short row of numbers, and the engine makes the sound from them, fresh, every time a step plays.

Fig. 1
The first 300 milliseconds of Beep Boop's first kick. Its pitch starts at 259 hertz and falls to 49, most of the way in the first 22 milliseconds. Its loudness fades over 0.38 seconds. A burst of filtered noise at the start fades in 7 milliseconds.01002000100 MS200 MS300 MSHZPITCH: 259 HZ, FALLING49 HZLOUDNESSNOISE
The first kick, ROUND. The black line is its pitch, which drops from 259 Hz to 49. The grey line is its loudness. The orange is the click of noise at the front.

Two ways to build a kit

A drum machine gets its sounds in one of two ways. It can play back recordings, called samples. Or it can make each sound from simple parts when it is needed, which is synthesis. Roland's TR-808 made its sounds this way in 1980, with circuits. Beep Boop does it with arithmetic.

Synthesis has two uses here. A sound that is numbers can be changed while it plays: the TONE and DECAY knobs move those numbers. And the numbers are small. The whole kit of 64 sounds is under 4,000 bytes. One second of recorded sound at the phone's rate is about fifty times that.

The parts of a drum

Every drum on the panel is built from the same two parts.

Each part fades at its own speed. A drum is a mix of the two, and the kind of drum is decided by the mix. A kick is nearly all tone. A hat is all noise.

The twelve numbers

This is the first kick, called ROUND, as it is written in the kit.

The twelve numbers of the kick called ROUND, and what each one does.
NumberROUNDWhat it does
Tone49 HzWhere the pitch settles.
Pitch drop210 HzHow far above that it starts: 259 Hz.
Pitch decay0.022 sHow fast the pitch falls.
Tone decay0.38 sHow fast the tone fades.
Tone level1.00How much tone is in the mix.
Noise level0.50How much noise.
Noise decay0.007 sHow fast the noise fades: here, a click.
Filter1,800 HzWhere the filter sits.
Resonance0.7How sharply the filter rings.
KindBandWhich part of the noise is kept: low, band or high.
Bursts0Extra bursts of noise, 10 ms apart. A clap has three.
Level0.95The loudness of the whole sound.

Fig. 1 draws the first four over time. The pitch falls from 259 Hz to near 49 in a few hundredths of a second, and that fall is what the ear hears as the thump. The tone then rings on for a third of a second. The click of noise at the front lasts 7 milliseconds and gives the beater its edge.

Three more numbers follow the twelve, and most sounds leave them at zero. They tear a sound apart, sweep its pitch, or restart it many times a second, and they make the stranger sounds on the dial: GLITCH, TAPE STOP, RISER, STUTTER.

The same parts, other drums

Where punch comes from

It is tempting to make a drum hit harder by turning it up. That does not work. Every voice ends in a soft limiter with a ceiling just under full scale, so a louder level only pushes the sound into the limiter and comes out as distortion.

Punch is shape. It comes from how far the pitch drops and how fast, from the length of the tone against the length of the noise, and from where the filter sits. To make a kick hit harder, start its pitch higher and let it fall faster.

Limits, and one mistake

Numbers can be wrong in ways a recording cannot, so every number has a range and a test holds the kit inside it. The tests also make every one of the 64 sounds on a Mac and fail on a sound that is silent, one that passes full scale, or one that never ends.

One range was learned the hard way. The noise filter is stable only while its frequency and its resonance stay in a certain relation. A bright filter with little resonance crossed that line, and the arithmetic ran away to values that are not numbers at all, in a few milliseconds. The first hats did this with TONE turned most of the way up. A reviewer found it, and the engine now holds the filter inside the safe bound whatever the knobs ask.

On Beep Boop

Each of the eight voices, KICK, SNARE, CLAP, HAT, OPEN, TOM, RIM and PERC, has eight sounds, and the window names the one chosen. TONE and DECAY reshape it as it plays.

Sources

More sheets

  1. The audio thread never waitsNo allocation, no lock, one queue.
  2. An instrument in SwiftUIOne accent, five layers, nothing unneeded.
  3. Sample-accurate timing on an iPhoneSteps counted in samples, and how that was measured.
  4. A beat in 40 bytesTempo, swing, eight voices and a check byte.
  5. PatternsDrum patterns drawn on sixteen steps.
  6. Tempo by genreBPM for twelve genres, on one scale.