← All posts

Understanding Bluejay's 128-byte melody budget

· bluejay · technical · deep dive · rtttl

Where does the "62 notes" figure come from? A look at how Bluejay actually stores a melody, why the limit exists, and how to spend those bytes wisely.

You'll see "62 notes" thrown around a lot when people talk about Bluejay melodies, including all over this site. But that number is a rule of thumb, not a hard count. The real limit is 128 bytes, and understanding how those bytes get spent will help you fit more song than you'd expect.

Let's open the hood.

Why 128 bytes?

Bluejay stores the startup melody in a small reserved region of the ESC's flash memory — 128 bytes, set aside specifically for this. The firmware code that reads and plays it is tiny (under 200 bytes total including the playback logic), which is the whole point: it has to fit alongside the actual motor-control firmware on a chip with very little space to spare.

128 bytes isn't much. For comparison, this sentence is about 128 bytes. So the melody format has to be extremely compact.

How a note becomes bytes

Bluejay doesn't store your RTTTL text directly. When you write a melody through the configurator, the RTTTL string gets compiled into a compact binary form. Each note becomes roughly two bytes: one encoding the pitch (which note, which octave) and one encoding the duration (how long it rings).

So 128 bytes ÷ 2 bytes per note ≈ 64 notes. Knock a few off for the format's metadata header (the first handful of bytes describe tempo and defaults) and you land at the familiar ~62 playable notes.

That's where the number comes from. It's not a note counter in the firmware — it's a byte budget, and notes happen to cost about two bytes each.

What costs extra

Not every note costs exactly two bytes. A few things nudge the cost:

  • Rests (p) cost the same as notes — about two bytes. A song full of dramatic pauses spends real budget on silence. Worth it for the Imperial March; wasteful for a busy chiptune.
  • The header (tempo, default duration, default octave) is fixed overhead, paid once.
  • Notes that match the defaults are cheaper to express in the source RTTTL (no duration or octave prefix needed), which is why the converter picks sensible d= and o= defaults — it's literally saving bytes.

That last point matters. If your song mostly uses quarter notes in octave 5, setting d=4,o=5 means those notes need no prefix at all in the string. Set bad defaults and every note carries an explicit duration and octave, bloating the string. The converter chooses the most common duration and octave as defaults automatically.

How to spend the budget well

Given 62-ish notes per motor, here's where the budget goes furthest:

  1. Pick a short hook. 62 notes is roughly 15–30 seconds depending on tempo. That's one good hook, not a whole song. Trying to cram in more just means everything gets cut off. Our fit-a-song guide covers cropping.
  1. Let the bass be sparse. On a four-motor quad, your bass motor often doesn't need 62 notes — a walking bass line might only use 20. That's fine. Each motor has its own independent 128-byte budget, so a sparse bass doesn't "give" its leftover bytes to the busy melody motor. Don't try to balance them; just let each be what it needs.
  1. Use rests deliberately. Silence is expressive but it's not free. A few well-placed rests make a song breathe; a rest after every note doubles your byte cost for no musical gain.
  1. Don't fear repetition. Repeated notes cost the same as varied ones. A four-note ostinato repeated is just as cheap as four different notes. This is why minimalist hooks (Jaws, Inception) fit so easily.

The per-motor independence

The single most misunderstood thing: each ESC has its own 128 bytes. A four-motor quad has 512 bytes of total melody storage, but you can't pool it. Motor 1 can't borrow motor 3's unused budget. So when the converter reports "58 notes on motor 1, 22 on motor 2", that's fine — each is independently under its own 62-note ceiling.

This is also why polyphony works the way it does: each motor is a separate, independent voice with its own budget, played in sync. It's less "one big song split four ways" and more "four tiny songs playing together".

The takeaway

"62 notes" is a helpful shorthand, but the real constraint is 128 bytes per ESC, spent at roughly two bytes per note or rest. Once you think in bytes, you stop fighting the limit and start arranging for it — which, conveniently, is exactly what makes motor music sound good. The constraint is the feature.

← All posts