Binary Scale Encoding and Computable Musical Brightness

How representing scales as 12-bit integers turns emotional character into a quantity a machine can calculate.

The Representation

A musical scale in 12-tone equal temperament can be represented as a 12-bit binary integer. Each bit position corresponds to a semitone in the chromatic scale. If the pitch is in the scale, the bit is 1. If not, it is 0. The root is always bit 0 (the lowest bit), so all scales are odd numbers.

This maps every possible combination of pitches within an octave to a unique integer from 0 to 4095. There are exactly 4096 possible scales (the full power set of 12 pitch classes), and every one has a unique decimal number.

Example: C Major (Ionian) Pitches:   C  .  D  .  E  F  .  G  .  A  .  B
Binary:    1  0  1  0  1  1  0  1  0  1  0  1
Reading right-to-left: 101010110101
Decimal: 2741

The major scale is 2741. Always. In any key. The number identifies the interval structure, not the transposition. Every scale you can construct in 12-tone equal temperament has its own number, from the chromatic scale (4095) to a single note (1).

Modes as Bit Rotation

The modes of a scale are produced by rotating the binary representation. Each mode is a cyclic permutation of the same bit pattern. For the seven diatonic modes, this gives seven different integers, all derived from the same parent pattern:

ModeBinaryDecimalBrightness Score
Lydian101011010101277339
Ionian (Major)101010110101274138
Mixolydian011010110101171737
Dorian011010101101170936
Aeolian (Minor)010110101101145335
Phrygian010110101011145134
Locrian010101101011138733

This ordering — Lydian, Ionian, Mixolydian, Dorian, Aeolian, Phrygian, Locrian — is the universally recognized brightness ordering of the diatonic modes. Lydian is the brightest. Locrian is the darkest. Every musician and theorist agrees on this ordering. The question is whether a machine can derive it.

The Brightness Metric

Define the brightness score of a scale as the sum of the bit positions of its active bits (counting from 0 at the root). For a scale with pitch classes at positions p₀, p₁, ... pₙ, the brightness score is simply p₀ + p₁ + ... + pₙ.

Example: Lydian Active bit positions: 0, 2, 4, 6, 7, 9, 11
Brightness score: 0 + 2 + 4 + 6 + 7 + 9 + 11 = 39
Example: Locrian Active bit positions: 0, 1, 3, 5, 6, 8, 10
Brightness score: 0 + 1 + 3 + 5 + 6 + 8 + 10 = 33

When you sort the seven diatonic modes by their brightness score, you get the exact brightness ordering that musicians have recognized by ear for centuries: Lydian (brightest) through Locrian (darkest). The sum of bit positions — a trivial arithmetic operation — reproduces a judgment that previously required trained musical intuition.

This is not a coincidence. The brightness score measures the total intervallic reach of a scale — the aggregate distance each pitch ventures from the root. A bright scale has its pitches pushed higher (sharper) within the octave. A dark scale has its pitches pulled lower (flatter). The sum of positions captures this directly.

Dorian as the Structural Center

The brightness scores of the seven diatonic modes are 39, 38, 37, 36, 35, 34, 33. Dorian sits at 36 — the median, with three modes brighter and three darker. Its interval pattern (W H W W W H W) is a palindrome: invert it and you get the same scale back. It is the only diatonic mode that is its own mirror.

This makes Dorian the structural center of diatonic scale space — not Ionian. Ionian's status as the "default" mode is a convention of Western tonal music, reinforced by centuries of pedagogy. But from the perspective of the encoding, Dorian is the neutral point: neither bright nor dark, perfectly symmetric, the balance between the two extremes. Any system that uses the brightness axis as a control surface — moving toward brighter or darker scales based on some input signal — would naturally use Dorian as its origin, not Ionian.

Why This Matters

Before this encoding, "brightness" was a qualitative judgment. You could say Lydian is brighter than Dorian, but a machine could not compute that relationship. It had no formal basis for comparing the emotional character of two arbitrary scales.

With the binary encoding and the brightness metric, a machine can:

Given any scale (expressed as an integer), compute its brightness score. Given a desired brightness level, find scales that match. Given two scales, determine which is brighter by arithmetic comparison. Navigate smoothly through scale space from bright to dark by following the brightness gradient. Do all of this across all 4096 possible scales, not just the handful that have traditional names.

This turns musical brightness from a subjective quality into a computable quantity. A machine can now select a scale by how bright or dark it is, because brightness is a number derivable from the scale's integer representation.

The Courage Axis

Brightness is one emotional dimension. The Chloe framework defines a second axis: courage. Where brightness measures the overall sharpness or flatness of a scale's intervals relative to the root, courage captures a different quality — the sense of stability, tension, or fear conveyed by the scale's intervallic structure.

In the pedagogical framing used in Chloe, this is presented through the metaphor of a frog crossing a stream on stepping stones. The twelve semitones are twelve evenly spaced stones spanning the octave. The frog chooses which to land on and which to skip — that choice defines the scale. A bright scale means wide leaps; a dark scale means small steps close to the root. The environment the frog travels through — sunlit meadow, shadowy forest, deep underwater cave — reflects the emotional character of the scale. The frog doesn't carry the emotion; the landscape does. Brightness and courage are independent: a scale can be dark yet brave (solid, evenly spaced stones in a shadowy place) or bright yet unsettled (wide leaps across precarious gaps in open light).

Together, brightness and courage define a two-dimensional emotional coordinate system for scales. Any scale can be plotted on this plane, giving it a position in emotional space that a machine can reason about.

Sparsity, Ambiguity, and Listener Participation

A heptatonic scale specifies seven of twelve possible pitches. It tells the listener almost everything — there is little room for the ear to wonder what comes next. A tritonic scale specifies three. The remaining nine positions are gaps, and the listener's brain fills them in unconsciously based on expectation, context, and internal state.

This means sparse scales are not simply "simpler" versions of dense ones. They are more ambiguous, and that ambiguity is musically active. The same three notes — say, C, E, and G — played over a drone could sound like the bright, stable core of Ionian to one listener, or the open, reaching quality of Lydian to another. The difference is not in the scale. It is in which missing pitches the listener's brain supplies. A relaxed mind might fill in the comfortable intervals of a major scale. An alert or searching mind might hear the raised fourth of Lydian. The tritonic asks a question; the listener's brain state answers it.

From the perspective of the binary encoding, this maps directly onto a computable property. Any scale can be compared against the seven diatonic modes by counting shared pitches (a bitwise AND followed by a popcount). A sparse scale that shares its pitches equally with multiple modes is formally ambiguous — it belongs to the neighborhood of several modes at once. A tritonic might be equidistant from Lydian, Ionian, and Mixolydian. This is not a failure of classification. It is a description of the scale's inherent openness to interpretation.

For applications in neurofeedback and adaptive music, this property is significant. Sparse, ambiguous scales do not impose a single emotional reading on the listener. Instead, they create space for the listener's own state to determine what is heard. A system selecting scales in response to brainwave data can use sparsity as a tool — offering open, participatory tonal material when the goal is to let the listener's internal state express itself, and denser, less ambiguous material when the goal is to push the listener toward a specific emotional target.

Applications

The practical consequence of having a computable emotional coordinate system for scales is that any system which needs to select or generate tonal material based on a desired emotional quality can now do so through arithmetic rather than through lookup tables or trained models.

This has direct applications in algorithmic composition, adaptive game audio, music therapy, neurofeedback systems that use tonal stimuli, and any context where a machine needs to choose musically appropriate material in real time based on a target emotional state.

It also makes the full 4096-scale space navigable. Traditional music theory names and uses a few dozen scales. The binary encoding with emotional coordinates makes all 4096 accessible, comparable, and traversable — including the thousands that have no traditional name but do have computable emotional properties.

The Chloe Scale Explorer

These ideas were developed independently and implemented in the Chloe Scale Explorer, an interactive browser-based application first committed to a public GitHub repository circa 2017. Chloe allows users to browse, listen to, and compare all possible scales in 12-tone equal temperament, organized by their binary encoding and sorted by brightness.

The application has gone through three major versions. The current version, Chloe 3, includes live audio synthesis, an AI-assisted exploration mode, environmental emotional framing for each mode, and the full 4096-scale enumeration with brightness sorting.

The earlier versions are also available: Chloe 1 and Chloe 2.

Prior Art and Independent Development

The representation of scales as 12-bit binary integers and the enumeration of the full 4096 power set have been described by multiple authors independently. The concept has roots in pitch-class set theory going back to Allen Forte's work in 1973. Ian Ring published an essay describing binary scale encoding on his website ianring.com, with the earliest verifiable web archive capture dating to 2017. The academic paper "A Classification of Musical Scales Using Binary Sequences" by Podlipniak and others explores related binary representations in a formal mathematical context.

The Chloe Scale Explorer was developed independently circa 2017, as evidenced by its public GitHub commit history. The specific contributions of Chloe include: the brightness-as-sum-of-bit-positions metric for automated sorting of modes by emotional character; the courage axis as a second independent emotional dimension; the environmental/metaphorical pedagogical framing (the brave frog); and the complete interactive audio implementation allowing users to hear any of the 4096 possible scales.

The core claim is not priority on the binary representation itself, but on the insight that the representation makes musical emotional character — specifically brightness — into a computable quantity, and the implementation of a complete system built on that insight.