Music Theory Engine — Process-Oriented
This skill is a process guide, not a knowledge dump.
It teaches you how to research the right theory for each task,
not memorize everything upfront.
Core Principle
Real composers don't memorize all theory — they research what they need for each piece.
Your workflow for any composition task:
1. RESEARCH → What does this genre/style actually sound like?
2. ANALYZE → What patterns, chords, rhythms define it?
3. EXTRACT → What are the 2-3 key principles I need?
4. COMPOSE → Apply those principles to create something new
5. EVALUATE → Does it sound right? Does it match the reference?
Phase 1: RESEARCH — Finding the Right Reference
How to Research a Genre or Style
When asked to compose in a genre you need to understand better:
Search for theory analysis of that genre:
- Search the web:
"{genre}" chord progressions analysis
- Search the web:
"{genre}" song structure common patterns
- Search the web:
"{genre}" rhythm patterns drum programming
- Search the web:
"{genre}" bass line techniques
Find specific reference songs the user mentions or that define the genre:
- Search the web:
"{song name}" chord progression key BPM
- Search the web:
"{song name}" music analysis breakdown
- Look for sites like Hooktheory, Chordify, Ultimate Guitar for real analyses
Find Strudel/TidalCycles examples in that style:
- Search the web:
site:strudel.cc "{genre}" OR "{style}"
- Search the web:
TidalCycles "{genre}" pattern example
- Search the web:
strudel music pattern "{genre}"
Read the DAW's existing presets for genre hints:
- Read
src/constants/generationPresets.ts for genre-specific defaults
What to Extract from Research
For each genre/style, identify these 5 elements:
- Key/Scale: What key and scale is most common? (e.g., minor pentatonic for blues)
- Chord Language: What chord types and progressions define it? (e.g., 7th chords for jazz)
- Rhythmic Feel: Straight 8ths? Swing? Syncopated? What's the drum backbone?
- Texture: Sparse or dense? What instruments? What register?
- Form: How long are sections? What's the energy curve?
Phase 2: ANALYZE — Extracting Patterns from References
Chord Progression Analysis Process
When you find a reference song's chords:
- Identify the key — what note feels like "home"?
- Convert to Roman numerals — this reveals the pattern independent of key
- In C major: C=I, Dm=ii, Em=iii, F=IV, G=V, Am=vi, Bdim=vii°
- In C minor (natural): Cm=i, Ddim=ii°, Eb=III, Fm=iv, Gm=v, Ab=VI, Bb=VII
- Important: In practice, minor keys use V (major) from harmonic minor for dominant function. In C minor: G major (V), not Gm (v). The raised 7th (B natural) creates the leading tone → tonic resolution.
- Identify the function of each chord:
- Tonic (I/i, vi/VI, iii/III): stability, home
- Subdominant (IV/iv, ii/ii°): movement, departure
- Dominant (V, vii°): tension, wants to resolve to tonic
- Note the voicing — are chords simple triads or extended (7ths, 9ths)?
- Note the rhythm — how many beats per chord? Any syncopation?
Melody Analysis Process
When analyzing a reference melody:
- Identify scale degrees used — mostly pentatonic? Full diatonic? Chromatic passing tones?
- Map the contour — does it arch up then down? Descend? Oscillate?
- Identify the motif — what's the smallest repeating melodic idea (2-4 notes)?
- Note rhythmic patterns — long notes on strong beats? Syncopation?
- Check chord-tone alignment — are chord tones on strong beats?
Rhythm Analysis Process
- Identify the pulse — where do you tap your foot?
- Map the kick pattern — where are the bass drum hits?
- Map the snare/clap — typically beats 2 & 4 (backbeat) or elsewhere?
- Map the hi-hat/ride — what subdivision? (8ths, 16ths, triplets?)
- Identify ghost notes — soft hits between main beats
- Note swing amount — straight, light swing, hard swing?
Phase 3: EXTRACT — Distilling Principles
The "2-4 Principles" Rule
For any composition task, distill your research into 2-4 key principles (default: 3).
More than 4 leads to overconstrained, mechanical output. Fewer than 2 is too vague.
Simple genres (punk, ambient) may need only 2. Complex genres (jazz, progressive) may need 4.
Example: Lo-Fi Hip-Hop
- Jazz-influenced chords (7ths, 9ths) with Dorian color
- Laid-back drums (slightly behind the beat, ghost notes, 70-90 BPM)
- Sparse, pentatonic melody with lots of space and reverb/delay
Example: EDM Drop
- Four-on-the-floor kick with off-beat hi-hats at 128 BPM
- Minor key, simple progression (often just 2 chords), heavy bass
- Energy contrast: stripped breakdown → full drop
Example: Jazz Ballad
- Extended harmony (maj7, m9, 13) with smooth voice leading
- Rubato/free timing feel, brushes on drums, walking or pedal bass
- Melody uses chromatic approach tones, telling a story with dynamics
Output: Composition Brief
After research and extraction, write a brief BEFORE composing:
Genre: Lo-Fi Hip-Hop
Key: C Dorian (C D Eb F G A Bb)
BPM: 82
Feel: Laid-back, nostalgic, warm
Principle 1: Chord voicings — Cm9, Fm9, Dm7b5, G7b9 (i-iv-iiø-V7 in C minor, jazz extensions)
Principle 2: Rhythm — Boom-bap kick pattern, ghost snares, lazy hi-hats at 0.2-0.4 velocity
Principle 3: Texture — Rhodes/piano chords, sparse pentatonic melody, sub bass, vinyl crackle feel
Reference: Nujabes "Feather", J Dilla "Donuts"
Phase 4: COMPOSE — Applying Principles
Construction Order
Build from the ground up, each layer informed by research:
- Harmonic foundation — chord progression (from analyzed patterns)
- Rhythmic foundation — drum pattern (from genre research)
- Bass — follows chords, uses genre-appropriate movement
- Melody/lead — uses extracted scale, respects contour principles
- Texture/atmosphere — pads, effects, fills (from reference analysis)
Key Constraints (Always Apply)
These are universal — not genre-specific:
- All pitched parts must be in the same key — verify scale compatibility
- Bass notes land on chord roots at strong beats — minimum harmonic anchor
- Bass register: octave 2-3 (MIDI 36-71). Octave 1 (MIDI 24-35) is too low for most speakers
- Velocity must vary — no flat velocity; use 0.3-0.9 range with natural variation
- Drums: 0.3-0.9 (ghost notes low, accents high)
- Pads/chords: 0.3-0.5 (sit back in the mix)
- Melody: 0.5-0.8 (expressive, varied)
- Leave space — rests are musical; don't fill every beat
- Sound sources: every pitched
note() needs .s("instrument"). For drums, use s("bd sd hh").bank("KitName")
- Time signature matters: default is 4/4 (4 beats per cycle). For 3/4 waltz, use 3-beat patterns. For 6/8, subdivide accordingly
Strudel Syntax Essentials (Minimum Viable)
Only the syntax you need to know to output patterns:
note("c4 e4 g4") // named notes (sharps: cs4, flats: eb4)
s("bd sd hh").bank("RolandTR808") // drum sounds
stack(part1, part2, part3) // layer simultaneously
note("c4 [d4 e4] f4 g4") // subdivide: d4+e4 share one beat
note("c4@2 e4 g4") // c4 held for 2 beats
note("c4 ~ e4 ~") // ~ = rest
note("[c3,e3,g3]") // comma = chord (simultaneous notes)
.velocity("0.7 0.5 0.8") // per-note dynamics
.lpf(800).room(0.3) // filter, reverb
.fast(2) / .slow(2) // speed transform
Critical Strudel gotchas:
<a b c> = alternation (one per cycle, rotating) — NOT a chord!
[a,b,c] = chord (simultaneous) — use commas
[a b c] = subdivision (squeeze into one beat) — no commas
- Sharps:
cs4 fs4 (NOT c#4) — Strudel uses s suffix
- Flats:
eb4 bb4 (NOT e-flat4) — Strudel uses b suffix
For advanced Strudel syntax, search the docs:
- Search the web:
strudel.cc documentation {specific feature}
Key Transposition Process
When transposing to a different key:
- Calculate the interval in semitones (e.g., C→Eb = +3)
- Shift every note name by that interval
- Be consistent with enharmonic spelling: in flat keys use flats (eb, bb), in sharp keys use sharps (cs, fs)
- Verify: after transposition, check all notes still belong to the target scale
Phase 5: EVALUATE — Quality Check
After composing, verify against your 2-4 principles:
- Does it match the genre feel? — Compare against research/reference
- Are the chords voiced correctly? — Check intervals, no wrong notes
- Does the rhythm groove? — Imagine it playing; does the kick/snare pattern feel right?
- Is it musical? — Space, dynamics, contour — not just "correct notes"
- Would the user recognize the genre? — If asked for lo-fi, does it sound lo-fi?
- Does the code run? — If Strudel evaluation fails, read the error, fix syntax, re-evaluate
If any check fails, go back to the relevant phase and refine.
When You Don't Know Something
Don't guess — research.
| Situation |
Action |
| Don't know the genre's typical chords |
Search the web: "{genre}" common chord progressions |
| Don't know the right scale |
Search the web: "{genre}" scales modes used |
| Don't know the drum pattern |
Search the web: "{genre}" drum pattern programming |
| Don't know the BPM range |
Search the web: "{genre}" typical BPM tempo |
| User references a specific song |
Search the web: "{song}" chords key BPM analysis |
| Don't know a Strudel feature |
Search the web: strudel.cc {feature name} |
| Not sure about a voicing |
Reason from intervals: root + intervals in semitones |
The MIDI pitch table is the ONE thing worth memorizing:
Middle C = c4 = MIDI 60. Each octave = 12 semitones. Sharps use s (not #): cs4, fs4.
Related Skills
- strudel-maestro — How to write Strudel patterns (syntax, prototyping, refinement)
- compose — Full song composition workflow that orchestrates this skill and strudel-maestro
1---2name: music-theory-engine3description: Process-oriented music theory skill for AI-assisted composition in ACE-Step-DAW. Instead of dumping all theory upfront, this skill teaches Claude HOW to research, analyze, and apply music theory for a specific composition task. Invoke when composing, arranging, or analyzing music.4---56# Music Theory Engine — Process-Oriented78> This skill is a **process guide**, not a knowledge dump.9> It teaches you how to research the right theory for each task,10> not memorize everything upfront.1112---1314## Core Principle1516**Real composers don't memorize all theory — they research what they need for each piece.**1718Your workflow for any composition task:1920```211. RESEARCH → What does this genre/style actually sound like?222. ANALYZE → What patterns, chords, rhythms define it?233. EXTRACT → What are the 2-3 key principles I need?244. COMPOSE → Apply those principles to create something new255. EVALUATE → Does it sound right? Does it match the reference?26```2728---2930## Phase 1: RESEARCH — Finding the Right Reference3132### How to Research a Genre or Style3334When asked to compose in a genre you need to understand better:35361. **Search for theory analysis** of that genre:37 - Search the web: `"{genre}" chord progressions analysis`38 - Search the web: `"{genre}" song structure common patterns`39 - Search the web: `"{genre}" rhythm patterns drum programming`40 - Search the web: `"{genre}" bass line techniques`41422. **Find specific reference songs** the user mentions or that define the genre:43 - Search the web: `"{song name}" chord progression key BPM`44 - Search the web: `"{song name}" music analysis breakdown`45 - Look for sites like Hooktheory, Chordify, Ultimate Guitar for real analyses46473. **Find Strudel/TidalCycles examples** in that style:48 - Search the web: `site:strudel.cc "{genre}" OR "{style}"`49 - Search the web: `TidalCycles "{genre}" pattern example`50 - Search the web: `strudel music pattern "{genre}"`51524. **Read the DAW's existing presets** for genre hints:53 - Read `src/constants/generationPresets.ts` for genre-specific defaults5455### What to Extract from Research5657For each genre/style, identify these 5 elements:58- **Key/Scale**: What key and scale is most common? (e.g., minor pentatonic for blues)59- **Chord Language**: What chord types and progressions define it? (e.g., 7th chords for jazz)60- **Rhythmic Feel**: Straight 8ths? Swing? Syncopated? What's the drum backbone?61- **Texture**: Sparse or dense? What instruments? What register?62- **Form**: How long are sections? What's the energy curve?6364---6566## Phase 2: ANALYZE — Extracting Patterns from References6768### Chord Progression Analysis Process6970When you find a reference song's chords:71721. **Identify the key** — what note feels like "home"?732. **Convert to Roman numerals** — this reveals the pattern independent of key74 - In C major: C=I, Dm=ii, Em=iii, F=IV, G=V, Am=vi, Bdim=vii°75 - In C minor (natural): Cm=i, Ddim=ii°, Eb=III, Fm=iv, Gm=v, Ab=VI, Bb=VII76 - **Important**: In practice, minor keys use V (major) from harmonic minor for dominant function. In C minor: G major (V), not Gm (v). The raised 7th (B natural) creates the leading tone → tonic resolution.773. **Identify the function** of each chord:78 - **Tonic** (I/i, vi/VI, iii/III): stability, home79 - **Subdominant** (IV/iv, ii/ii°): movement, departure80 - **Dominant** (V, vii°): tension, wants to resolve to tonic814. **Note the voicing** — are chords simple triads or extended (7ths, 9ths)?825. **Note the rhythm** — how many beats per chord? Any syncopation?8384### Melody Analysis Process8586When analyzing a reference melody:87881. **Identify scale degrees used** — mostly pentatonic? Full diatonic? Chromatic passing tones?892. **Map the contour** — does it arch up then down? Descend? Oscillate?903. **Identify the motif** — what's the smallest repeating melodic idea (2-4 notes)?914. **Note rhythmic patterns** — long notes on strong beats? Syncopation?925. **Check chord-tone alignment** — are chord tones on strong beats?9394### Rhythm Analysis Process95961. **Identify the pulse** — where do you tap your foot?972. **Map the kick pattern** — where are the bass drum hits?983. **Map the snare/clap** — typically beats 2 & 4 (backbeat) or elsewhere?994. **Map the hi-hat/ride** — what subdivision? (8ths, 16ths, triplets?)1005. **Identify ghost notes** — soft hits between main beats1016. **Note swing amount** — straight, light swing, hard swing?102103---104105## Phase 3: EXTRACT — Distilling Principles106107### The "2-4 Principles" Rule108109For any composition task, distill your research into 2-4 key principles (default: 3).110More than 4 leads to overconstrained, mechanical output. Fewer than 2 is too vague.111Simple genres (punk, ambient) may need only 2. Complex genres (jazz, progressive) may need 4.112113**Example: Lo-Fi Hip-Hop**1141. Jazz-influenced chords (7ths, 9ths) with Dorian color1152. Laid-back drums (slightly behind the beat, ghost notes, 70-90 BPM)1163. Sparse, pentatonic melody with lots of space and reverb/delay117118**Example: EDM Drop**1191. Four-on-the-floor kick with off-beat hi-hats at 128 BPM1202. Minor key, simple progression (often just 2 chords), heavy bass1213. Energy contrast: stripped breakdown → full drop122123**Example: Jazz Ballad**1241. Extended harmony (maj7, m9, 13) with smooth voice leading1252. Rubato/free timing feel, brushes on drums, walking or pedal bass1263. Melody uses chromatic approach tones, telling a story with dynamics127128### Output: Composition Brief129130After research and extraction, write a brief BEFORE composing:131132```133Genre: Lo-Fi Hip-Hop134Key: C Dorian (C D Eb F G A Bb)135BPM: 82136Feel: Laid-back, nostalgic, warm137138Principle 1: Chord voicings — Cm9, Fm9, Dm7b5, G7b9 (i-iv-iiø-V7 in C minor, jazz extensions)139Principle 2: Rhythm — Boom-bap kick pattern, ghost snares, lazy hi-hats at 0.2-0.4 velocity140Principle 3: Texture — Rhodes/piano chords, sparse pentatonic melody, sub bass, vinyl crackle feel141142Reference: Nujabes "Feather", J Dilla "Donuts"143```144145---146147## Phase 4: COMPOSE — Applying Principles148149### Construction Order150151Build from the ground up, each layer informed by research:1521531. **Harmonic foundation** — chord progression (from analyzed patterns)1542. **Rhythmic foundation** — drum pattern (from genre research)1553. **Bass** — follows chords, uses genre-appropriate movement1564. **Melody/lead** — uses extracted scale, respects contour principles1575. **Texture/atmosphere** — pads, effects, fills (from reference analysis)158159### Key Constraints (Always Apply)160161These are universal — not genre-specific:162163- **All pitched parts must be in the same key** — verify scale compatibility164- **Bass notes land on chord roots at strong beats** — minimum harmonic anchor165- **Bass register**: octave 2-3 (MIDI 36-71). Octave 1 (MIDI 24-35) is too low for most speakers166- **Velocity must vary** — no flat velocity; use 0.3-0.9 range with natural variation167 - Drums: 0.3-0.9 (ghost notes low, accents high)168 - Pads/chords: 0.3-0.5 (sit back in the mix)169 - Melody: 0.5-0.8 (expressive, varied)170- **Leave space** — rests are musical; don't fill every beat171- **Sound sources**: every pitched `note()` needs `.s("instrument")`. For drums, use `s("bd sd hh").bank("KitName")`172- **Time signature matters**: default is 4/4 (4 beats per cycle). For 3/4 waltz, use 3-beat patterns. For 6/8, subdivide accordingly173174### Strudel Syntax Essentials (Minimum Viable)175176Only the syntax you need to know to output patterns:177178```javascript179note("c4 e4 g4") // named notes (sharps: cs4, flats: eb4)180s("bd sd hh").bank("RolandTR808") // drum sounds181stack(part1, part2, part3) // layer simultaneously182note("c4 [d4 e4] f4 g4") // subdivide: d4+e4 share one beat183note("c4@2 e4 g4") // c4 held for 2 beats184note("c4 ~ e4 ~") // ~ = rest185note("[c3,e3,g3]") // comma = chord (simultaneous notes)186.velocity("0.7 0.5 0.8") // per-note dynamics187.lpf(800).room(0.3) // filter, reverb188.fast(2) / .slow(2) // speed transform189```190191**Critical Strudel gotchas:**192- `<a b c>` = **alternation** (one per cycle, rotating) — NOT a chord!193- `[a,b,c]` = **chord** (simultaneous) — use commas194- `[a b c]` = **subdivision** (squeeze into one beat) — no commas195- Sharps: `cs4` `fs4` (NOT `c#4`) — Strudel uses `s` suffix196- Flats: `eb4` `bb4` (NOT `e-flat4`) — Strudel uses `b` suffix197198For advanced Strudel syntax, **search the docs**:199- Search the web: `strudel.cc documentation {specific feature}`200201### Key Transposition Process202203When transposing to a different key:2042051. Calculate the interval in semitones (e.g., C→Eb = +3)2062. Shift every note name by that interval2073. Be consistent with enharmonic spelling: in flat keys use flats (eb, bb), in sharp keys use sharps (cs, fs)2084. Verify: after transposition, check all notes still belong to the target scale209210---211212## Phase 5: EVALUATE — Quality Check213214After composing, verify against your 2-4 principles:2152161. **Does it match the genre feel?** — Compare against research/reference2172. **Are the chords voiced correctly?** — Check intervals, no wrong notes2183. **Does the rhythm groove?** — Imagine it playing; does the kick/snare pattern feel right?2194. **Is it musical?** — Space, dynamics, contour — not just "correct notes"2205. **Would the user recognize the genre?** — If asked for lo-fi, does it sound lo-fi?2216. **Does the code run?** — If Strudel evaluation fails, read the error, fix syntax, re-evaluate222223If any check fails, go back to the relevant phase and refine.224225---226227## When You Don't Know Something228229**Don't guess — research.**230231| Situation | Action |232|-----------|--------|233| Don't know the genre's typical chords | Search the web: `"{genre}" common chord progressions` |234| Don't know the right scale | Search the web: `"{genre}" scales modes used` |235| Don't know the drum pattern | Search the web: `"{genre}" drum pattern programming` |236| Don't know the BPM range | Search the web: `"{genre}" typical BPM tempo` |237| User references a specific song | Search the web: `"{song}" chords key BPM analysis` |238| Don't know a Strudel feature | Search the web: `strudel.cc {feature name}` |239| Not sure about a voicing | Reason from intervals: root + intervals in semitones |240241**The MIDI pitch table is the ONE thing worth memorizing:**242Middle C = `c4` = MIDI 60. Each octave = 12 semitones. Sharps use `s` (not `#`): `cs4`, `fs4`.243244---245246## Related Skills247248- **strudel-maestro** — How to write Strudel patterns (syntax, prototyping, refinement)249- **compose** — Full song composition workflow that orchestrates this skill and strudel-maestro