Skip to main content

Scale Awareness

Optional song-level scale validation and channel locks help keep notes in key. Desktop MIDI step entry can also use this metadata for snap/filter behaviour.

This page is part of the Language Reference. The Game Boy Tutorial builds a complete song without requiring scale locks.

Declare a scale

scale C major warn
# scale A minor error
# scale F# dorian off
ModeBehaviour
warn (default)Out-of-lock notes produce warnings
errorOut-of-lock notes produce errors
offKeep scale metadata for UI/MIDI; disable diagnostics

Channel locks

When scale is declared, restrict a channel with lock=...:

LockAllowed degrees
lock=scaleAny note in the scale
lock=root+fifthDegrees 1 + 5
lock=chord1 + 3 + 5
lock=chord71 + 3 + 5 + 7
lock=octavesRoot only (all octaves)
chip gameboy
bpm 140
scale C major warn

inst lead type=pulse1 duty=50 env=gb:12,down,1
pat melody = C5 E5 G5 C6
seq main = melody

channel 1 => inst lead seq main lock=scale
play

lock without a song-level scale is a parser error.

See also