home/ atoms/ strudel-scale

scale() interprets n() numbers as degrees within a named musical scale

The scale() function interprets the numbers in an n() pattern as scale degrees within a named scale, specified as “Root:mode” (e.g. “C:major”, “C:minor”, “D:dorian”). Degree 0 is the root, 1 the second scale step, and so on; numbers beyond the scale length wrap into higher octaves. So n(“0 1 2 3”).scale(“C:major”) plays C D E F. Available modes include major, minor, dorian, mixolydian, and pentatonic variants, and the scale itself can be patterned with angle brackets to shift key or mode per cycle. This decouples melodic shape (the number sequence) from harmonic context (the scale), so you can transpose or change mode without touching the rhythm, and it constrains note choices to consonant pitches — useful when improvising live.

Examples

n(“0 2 4”).scale(“C:minor”).sound(“piano”) // C minor diatonic steps n(“0 1 2 3 4 5 6 7”).scale(“C:major”).clip(1).sound(“piano”) n(“0 2 4”).scale(“<C:major D:major>/4”) // alternates key every 4 cycles

Assessment

Write a pattern that plays the first five notes of D minor using scale(). Then, keeping the same number pattern, change the mode to dorian and identify which notes differ and why.

“Another way to sequence notes is from a _scale_. A scale is a series of notes, ordered by pitch”
corpus · music-code-strudel-worksheet-lucy-cheesman-peckham-digital · chunk 4
“interpret `n` as scale degree”