Melodic Development

EDM.9f: every strudel transform is a 300-year-old composition technique

You’ve been composing classically. Every transform you’ve used since EDM.5—.rev(), .fast(), .slow(), .off(), .add(note())—has a name in composition textbooks. Centuries-old names. Bach used them. Mozart used them. You’ve been using them on phonk beats. This lesson connects the two worlds.

what you already know

s(), note(), stack(), cat(), setcpm(35), mini-notation (~ * [] <> / @), .gain(), .pan(), .lpf(), .lpq(), .attack(), .decay(), .sustain(), .release(), .room(), .size(), .delay(), .delaytime(), .delayfeedback(), .distort(), chord notation [c3,eb3,g3], progressions with <>, .every(), .sometimes(), .jux(), .off(), .rev(), .fast(), .slow(), .add(note()), .superimpose(), arrangement with cat() and gain automation, scales, modes, chords, intervals, non-chord tones, diatonic harmony, ii–V–I, cadences, form, and the phonk palette from EDM.4–9d.

00The Motive

Four notes. That’s all you need. A motive is the smallest meaningful musical idea—a few notes with a shape. Hit play:

a 4-note motive

C up to Eb—minor 3rd. Back down to D—a step. Up to G—perfect 4th. Four notes. A shape: rise, dip, leap. That shape is the DNA. Everything in this lesson grows from it.

motive

The smallest meaningful melodic idea. Three to seven notes, usually. A motive has a distinctive shape—defined by its intervals and rhythm. Everything in a composition can grow from this seed. Beethoven’s Fifth Symphony grows from 4 notes. Your EDM.9c monster grew from n("0(3,8)").

tweak it

Write your own 4-note motive. Pick any 4 notes from C minor (C, D, Eb, F, G, Ab, Bb). The intervals between them define its character. Replace the notes in the editor and listen. Keep the one you like—you’ll need it later.

01The Reveal

Five operations you already know. Five names that have been in music theory textbooks for centuries.

Retrograde = rev

The motive, then its mirror. Original in center. Reversed copy panned right:

motive + retrograde

The reversed version plays G D Eb C—same notes, backward. In classical music, this is called retrograde. Bach used it in fugues. You’ve been using .rev() since EDM.5.

Augmentation = slow, Diminution = fast

Same motive at three speeds. Original, stretched, compressed:

original, augmented, diminished

Cycle 1: original (1 cycle). Cycles 2–3: augmented—stretched to 2 cycles with .slow(2). Cycle 4: diminished—compressed to half a cycle with .fast(2). Same motive at three speeds. Augmentation stretches time. Diminution compresses it. Composers have used both since the 14th century.

Transposition = add(note())

Same shape, different starting pitch. The motive at three pitch levels:

original, up a 4th, up a 5th

Original. Then transposed up a perfect 4th (5 semitones). Then up a perfect 5th (7 semitones). Same shape, different starting point. This is transposition—and when you repeat a motive at different pitch levels in sequence, that’s called a sequence. It’s how melodies move through chord changes.

Canon = off

The motive starts. A quarter-cycle later, a copy starts a fifth higher. Two voices, staggered:

canon at the fifth

Two voices playing the same thing, offset in time. That’s a canon—one of the oldest forms of counterpoint. “Row, Row, Row Your Boat” is a canon. .off() has been creating canons since EDM.5.

the classical toolkit

Five operations. Five words from music theory textbooks. Retrograde (.rev())—play backward. Augmentation (.slow())—stretch in time. Diminution (.fast())—compress in time. Transposition (.add(note()))—shift pitch. Canon (.off())—delayed copy. You’ve been using all of them. The Monster from 9c IS motivic development—a seed transformed by operations until it becomes something complex.

strudelclassicalwhat it does
.rev()retrogradeplay backward
.slow(N)augmentationstretch in time
.fast(N)diminutioncompress in time
.add(note(N))transpositionshift pitch
.off(t, fn)canondelayed copy
.jux(fn)inversion (spatial)mirror in stereo
.superimpose(fn)counterpointsimultaneous voices

02Development

Take the motive. Transform it once per bar across an 8-bar phrase. The harmony underneath is the phonk progression. Each bar uses the same 4-note shape, bent to fit:

motivic development — 8 bars

Bar 1: the motive, original. Bar 2: transposed to Ab. Bar 3: transposed to Bb. Bar 4: transposed to G. Bar 5: retrograde. Bar 6: retrograde, transposed down. Bar 7: another transposition. Bar 8: wider intervals, resolving up to C5—octave above where it started. Each bar uses the same shape, transformed. The melody develops through the harmony.

motivic development

Transforming a motive across a phrase or piece. State it, transpose it, reverse it, stretch it, compress it. The listener hears unity (same shape) and variety (different presentations). This is how composers build large structures from small seeds. A 4-note motive can generate an entire symphony.

tweak it

Take your own 4-note motive from Section 0. State it in bar 1. Transpose it to the next chord in bar 2. Retrograde in bar 3. Resolve in bar 4. Replace the melody line in the editor above. Keep the pad underneath—just change the notes inside the <> brackets on the melody line.

rabbit hole — Bach’s Art of Fugue

One subject, infinite transformations

Bach’s final work. Unfinished. Fourteen fugues and four canons, all built from one subject—a single melodic idea in D minor. Every technique in this lesson appears: retrograde, augmentation, diminution, inversion, stretto (overlapping canons with tighter and tighter entries). The most extreme motivic development ever written.

The subject

D, A, F, D, C#, D, E, F, G, F, E, D. That’s it. Twelve notes. From these twelve notes, Bach generated over an hour of music. Each fugue transforms the subject differently. Some stretch it to twice its length. Some compress it. Some play it backward. Some play it upside down. Some combine three or four transformations at once.

A simplified version of the subject, then its retrograde:

fugue subject + retrograde

First cycle: the subject. Second cycle: retrograde. Same notes, reversed. Bach wrote entire fugues where the subject appears in both directions simultaneously. The same operation as .rev().

Why it matters

Bach proved that constraint breeds creativity. One motive. A handful of operations. Infinite music. That’s the same principle behind live coding—start with a seed, transform it, let the system generate complexity. The tools are different. The thinking is identical.

03Melodic Development

A phonk track where the lead melody is built entirely from motivic development of a 4-note seed. The motive plays as a canon (.off() creates a fifth above, delayed). Every 4th cycle it retrogrades (.every(4, rev)). The same 4 notes, endlessly developed by the transforms. Classical composition through live coding.

// TITLE: melodic development

The motive loops twice per cycle: C Eb D G C Eb D G. The .off(1/4, add(note(7))) creates a canon—a copy a fifth higher, delayed by a quarter cycle. .every(4, rev) retrogrades the whole thing every 4th cycle. Delay smears the notes across time. The pad sweeps underneath. The same 4 notes, endlessly developed by the transforms you’ve had all along.

compose
  1. Write your own 4-note motive and replace the melody. Change both note() patterns on the lead line (the last note() in the stack). Keep the .off() and .every()—they’ll transform whatever you write.
  2. Add an augmented shadow voice. After the .every(4, rev) line, add .superimpose(x => x.slow(2).gain(0.2)). A stretched ghost of the motive plays underneath.
  3. Try periodic transposition. Replace .every(4, rev) with .every(3, x => x.add(note(5))). Every 3rd cycle, the motive jumps up a perfect 4th.
  4. Share it. You just did motivic development. The same 4 notes, transformed by operations with 300-year-old names.
what you earned
conceptmeansstrudel
motivesmallest meaningful melodic idea — a few notes with a shapenote("c4 eb4 d4 g4")
retrogradeplay the motive backward.rev()
augmentationstretch the motive in time.slow(2)
diminutioncompress the motive in time.fast(2)
transpositionshift the motive to a different pitch level.add(note(5))
canondelayed copy — same melody offset in time.off(1/4, add(note(7)))
motivic developmenttransforming a motive across a phrase or piecestate, transpose, reverse, stretch, compress
sequencesame motive repeated at different pitch levels.add(note(N)) applied progressively
the bridge

Every strudel pattern transform maps to a classical composition technique. .rev() = retrograde. .slow() = augmentation. .fast() = diminution. .add(note()) = transposition. .off() = canon. .jux() = spatial inversion. .superimpose() = counterpoint. The tools changed. The thinking didn’t.

Next: The Set. Everything combined. A 2–3 minute piece.

listening

Tracks that demonstrate this lesson’s concepts.

artisttrackwhy
Lena RaineCeleste: First Steps (2018)(VGM) emotional minimalism, motif as narrative
Koji KondoZelda: Main Theme (1986–2023)(VGM) one motif developed across 35 years and 20+ games
BeethovenSymphony No. 5 (1808)(classical) four notes developed across four movements
J DillaWorkinonit (2006)(hip-hop) the loop as motive, developed through chopping and filtering
history

The idea that a whole piece can grow from a small seed — a motive — is one of the most powerful concepts in music. It connects Beethoven to hip-hop to generative code.

Beethoven’s Fifth (1808)

Four notes: G G G Eb. Short-short-short-long. Beethoven built an entire symphony from this cell. The motive appears transposed, inverted, augmented, diminished, fragmented, and recombined across four movements. The first movement alone contains over 200 statements of the motive in various forms. This is motivic development at its most extreme — total unity from minimal material.

The Art of Fugue (1742–1749)

Bach’s final major work uses a single subject (D minor, simple and vocal) as the basis for 14 fugues and 4 canons. Each piece transforms the subject through retrograde, inversion, augmentation, diminution, stretto (overlapping entries), and combinations thereof. The final fugue, which introduces Bach’s own name as a counter-subject (B-A-C-H in German note names = Bb-A-C-B), breaks off mid-measure — he died before completing it. The work is a catalog of every motivic transformation technique and reads as a textbook written in music.

Hip-hop and the loop as motive

In sample-based hip-hop, the loop IS the motive. A 2-bar soul sample, chopped and rearranged, becomes the harmonic and melodic seed of the entire track. DJ Premier’s production for Gang Starr layers the same sample at different chop points — motivic development through sampling. Madlib’s Madvillainy (2004) applies the same principle: each beat is a motive (sampled loop) developed through filtering, pitch-shifting, and rearrangement.

Sources: Hopkins, The Nine Symphonies of Beethoven (1981); Hofstadter, Gödel, Escher, Bach (1979); Yearsley, Bach and the Meanings of Counterpoint (2002); Schloss, Making Beats (2004).

→ explore the full timeline