How it thinks: progressions are seeded from idiom-specific templates (classical cadences, pop loops, ii–V–I jazz cells, 12-bar blues, modal vamps) then mutated by a tonal-function Markov walk (tonic → subdominant → dominant tendencies), with probabilistic secondary dominants and modal-interchange borrowed chords layered on top. Melody is generated per chord from a weighted pool of chord tones, scale tones, and occasional chromatic neighbors, biased toward stepwise motion and phrase-end cadential resolution.