Sanic Boom

Scales

Using scale degrees for easier transposition

Use scale degrees instead of absolute note names. This makes it easy to transpose melodies and work within a musical key.

Basic Usage

Instead of writing specific notes like C4 E4 G4, use numbers 1-7 representing scale degrees:

[1 3 5] |> scale(C, major) |> saw   // Plays C4 E4 G4
[1 3 5] |> scale(C, minor) |> saw   // Plays C4 Eb4 G4
[1 3 5] |> scale(G, major) |> saw   // Plays G4 B4 D5

The numbers represent:

DegreeName
1Root (tonic)
2Second
3Third
4Fourth
5Fifth
6Sixth
7Seventh

Available Scales

Common Scales

  • major — The major scale (W-W-H-W-W-W-H)
  • minor — Natural minor (W-H-W-W-H-W-W)

Modes

  • dorian — Minor with raised 6th
  • phrygian — Minor with lowered 2nd
  • lydian — Major with raised 4th
  • mixolydian — Major with lowered 7th
  • aeolian — Same as natural minor
  • locrian — Diminished mode

Other Scales

  • pentatonic — 5-note scale (1 2 3 5 6)
  • blues — Blues scale
  • chromatic — All 12 semitones

Root Notes

Use any note as the root:

  • Natural notes: C, D, E, F, G, A, B
  • Sharps: C#, D#, F#, G#, A#
  • Flats: Db, Eb, Gb, Ab, Bb

Examples

// C major triad
[1 3 5] |> scale(C, major) |> saw

// A minor arpeggio
[1 3 5 3] |> scale(A, minor) |> sine

// Full C major scale
[1 2 3 4 5 6 7] |> scale(C, major) |> triangle

// Same melody in different keys
let melody = [1 3 5 3 1]
play melody |> scale(C, major) |> saw
play melody |> scale(G, major) |> saw
play melody |> scale(D, minor) |> saw

Transposing Made Easy

The real power of scales is easy transposition:

let melody = [1 3 5 6 5 3 1]

// Play in C major
play melody |> scale(C, major) |> saw

// Same melody, now in F major - just change the root!
play melody |> scale(F, major) |> saw

// Now in D minor
play melody |> scale(D, minor) |> saw

On this page