There are two personas when using a modular synth that occupy very different head spaces. Patching, tweaking and performance is an art in itself, sequencing and generating interesting music as another. Modular Riffs is my solution to allow myself to focus entirely on the patching and performance side from time to time.

What It Does
The goal of Modular Riffs is to generate coherent and interesting music so I can focus on patching voices, tweaking them and driving the performance as a whole. It runs entirely in the browser from my server so I an play with it wherever I am. It will substitute voices if I am not connected via MIDI, but it’s really designed to drive the 4 voice Mutable Instruments Yarns module. It also handles MIDI clock start/stop so I can sequence drums on the Arturia Keystep Pro and have it play along.

It generates a pad, bass, arpeggio and melody part and has an extensive library of styles to draw from.

I designed it to take a genre, generate a solid song structure and allow me to make changes to the arrangement, chord progressions and intensity of sections as I go. Intensity is a collective way to say make the parts more interesting, more note dense, etc.
How it generates intelligent music
The core idea is that the tool never composes at random. A random sequence of in-key notes is easy to produce and almost always sounds aimless. Instead, every piece is derived from real musical knowledge and then varied, so the output reads as a genre rather than a random walk. Three layers work together to make that happen: a theory engine, a structure engine, and a melody engine, all riding on a controllable intensity curve.
It starts from real source material, then mutates
Rather than inventing harmony from scratch, generation begins from a library of blueprints. Each blueprint is a complete song skeleton: a set of chord progressions written for named sections (intro, verse, prechorus, chorus, bridge, drop, and so on) plus a realistic order for those sections. These are generic, non-copyrightable building blocks, named by type and era rather than tied to any recording. The tool picks a blueprint that fits your chosen style and tonal flavor, instantiates it in your key and scale, and then applies a controlled amount of variation set by the Evolve slider. At low Evolve it stays faithful to the source; at high Evolve it derives further from it. The same principle drives the melodies, which grow from a library of archetypal melodic shapes rather than note-by-note guesswork.
The harmony is musically literate
Underneath sits a full theory engine that understands scales and modes, how to build chords by stacking thirds within a key, and how to read roman numerals so progressions transpose correctly to any key or scale. When the music borrows a chord from outside the key or uses a secondary dominant, the engine recognizes it and switches the melody to that chord’s own implied scale for its passing tones, the way a trained player would. It also knows which notes to avoid on strong beats for a given chord quality and nudges them onto safer chord tones, so the line stays consonant where it matters and free where it does not.
When the harmony is varied, it is varied by function, not at random. Chords are substituted within their functional family (tonic, subdominant, or dominant), so a swap still makes harmonic sense. The opening chord and the final cadence of each section are protected from change so the section stays recognizable and resolves properly. At higher Evolve settings, style-aware moves kick in: jazz-family styles can get tritone substitutions, pop-family styles can borrow a minor four chord. The substitutions a style would never use simply do not appear for that style.
Four monophonic voices imply the harmony together
Every part plays one note at a time, like a single oscillator voice on a modular synth. Because no single voice can play a chord, the harmony is implied across the parts rather than stacked. The bass owns the root, the pad leans on the chord’s guide tones (its third and seventh, the notes that define its color), the arpeggiator spells out the chord tones, and the lead outlines the changes on top. The pad and bass also use voice leading, moving to the nearest available tone from one chord to the next instead of jumping around, which is what makes the progression feel connected rather than blocky.
Melodies are developed, not just sampled
The lead is the clearest example of intentional rather than accidental music. It does not wander note to note. It states a short melodic cell (a rhythm plus a contour), then develops that cell across a four-bar phrase the way a composer would: restating it over each new chord, transposing it, inverting it, reversing it, or fragmenting it, with the amount of development again governed by Evolve. Phrases begin anchored to a chord tone near the center of the register, are kept from drifting too high or too low, thin out as the phrase ends so the line breathes, and resolve onto a chord tone at the cadence. The result is melody that sounds related to itself and purposeful, not like a string of correct but disconnected notes.
An intensity arc shapes the energy
Musical interest also comes from dynamics over time, so the arranger writes a per-bar intensity curve as it lays out the song. Quiet sections like intros and breakdowns sit low; choruses and drops sit high; transitions ramp between them. That curve controls how busy each part is, how wide the arpeggio ranges, and how hard notes are struck, and a live Energy control lets you ride the whole thing up or down in real time. Different sections also bring different parts in and out, so a verse and a chorus feel like different places in the song.
It is reproducible and it never stops
All of the randomness flows from a single seed, so the same settings always regenerate the same jam from the first bar, which makes a good result something you can return to. The melody variation runs on its own separate stream, so you can reroll the melodies alone without disturbing the harmony, bass, or structure. And rather than looping a fixed pattern, the engine keeps cycling and re-mutating the blueprint to compose forward continuously, so it plays on without ever repeating itself exactly until you stop it.
The intelligence is not one clever trick but the layering of musical constraints: known-good source material, functional harmony, voice leading, motif development, and a dynamic arc, all combined so that what comes out sounds composed rather than generated.