BEEP BOOP
Public beta

A beat in 40 bytes

Beep Boop prints a beat as a paper receipt with a code on it. Point a phone at the code and the beat opens on the keys. No server holds it and no account is asked for, because the whole beat is inside the code: 40 bytes.

Fig. 1
The boom bap beat as 40 bytes, in hexadecimal: 01 00 03 A2 30 10 08 01 00 01 02 01 00 01 02 01 00 01 00 01 00 01 00 A2 20 08 08 00 00 AB AA 00 00 00 00 00 00 00 00 A8. Seven bytes of header (version, kind, tempo in two bytes, swing, steps, voices), sixteen bytes naming each voice's kit and sound, sixteen bytes of step bits, two a voice, and one check byte.HEADER7 BYTES01VERSION00KIND03TEMPOA230SWING10STEPS08VOICESEIGHT VOICES: KIT, SOUND16 BYTES01KICK0001SNARE0201CLAP0001HAT0201OPEN0001TOM0001RIM0001PERC00SIXTEEN STEPS A VOICE, A BIT A STEP16 BYTESA2KICK2008SNARE0800CLAP00ABHATAA00OPEN0000TOM0000RIM0000PERC00CHECK1 BYTEA8CRC
The boom bap beat, byte by byte, in hexadecimal. The filled cells are the steps that sound: kick, snare and hat.

What a beat is

A drum beat on Beep Boop is a short list of facts. A tempo. A swing setting. Eight voices, each with one of eight sounds chosen. And for each voice, sixteen steps that are on or off. That is all a friend's phone needs to play the same beat.

None of it is sound. The sounds are already in every copy of the app, so the code only has to name them.

The 40 bytes

Fig. 1 is the boom bap beat from its pattern page, exactly as the app writes it.

The fields of a version 1 beat, in order, with their sizes.
FieldBytesHolds
Version11. A reader refuses a version it does not know.
Kind10 for one beat.
Tempo2BPM times ten, so 93 BPM is 930, written 03 A2.
Swing10 to 100. Here 48, written 30.
Steps116, written 10.
Voices18.
Voice list16Two a voice: the kit, then the sound chosen on that voice.
Step bits16Two a voice: sixteen steps, one bit each.
Check1A sum over the 39 bytes before it.

Seven, sixteen, sixteen and one make 40. A beat with four voices would be 24.

One bit a step

The steps are the heart of it. A step is on or off, which is one bit. Sixteen steps are sixteen bits, which is two bytes. Step 1 is the highest bit of the first byte.

Fig. 2
The kick's two step bytes, A2 and 20, written as sixteen bits. A 1 is a step that sounds: steps 1, 3, 7, 11.BYTE A2BYTE 20101000100010000012345678910111213141516
Two bytes, sixteen bits, sixteen steps. Step 1 is the highest bit of the first byte. The kick plays steps 1, 3, 7, 11.

Eight voices of sixteen steps are 128 bits, and those sixteen bytes hold every hit in the bar. The rest of the code only says how fast and with which sounds.

From bytes to a code

The 40 bytes are written as 54 letters and digits that are safe in a web address, and set after the address the receipt prints. The whole link, https://beatmaker.au/b/ and the 54, is 77 characters. As a printed code it is 37 squares on a side.

Because it is an ordinary web link, the phone's own camera reads it. With Beep Boop installed, the link opens the app with the beat on the keys. Without it, the link opens a page on the web.

A code is not to be trusted

Anyone can make a code, so the reader treats one as a stranger's input. Three rules hold.

What does not fit

A drum beat fits because a drum step has no other property: it has no length and, on Beep Boop, one loudness. A melody needs more, a note's row, its length and its accent, and is written in a second version of the format at two bytes a note. A whole track with many bars grows past what a small printed code can hold, and travels as a short code with the track kept on a server.

Sources

More sheets

  1. Ghost notes and accents on drumsLoud and quiet strokes in one bar.
  2. Sample-accurate timing on an iPhoneSteps counted in samples, and how that was measured.
  3. What syncopation isThe weight off the beat, on sixteen steps.
  4. The audio thread never waitsNo allocation, no lock, one queue.
  5. PatternsDrum patterns drawn on sixteen steps.
  6. Tempo by genreBPM for twelve genres, on one scale.