MIDI Generator: Build a Fractal Melody

Three notes at the piano, in isolation, bum, bum, bum. The sounds hang in the air. They are complete in themselves. But they carry the seed of something, the beginning, the hush before dawn. At present, they stay small but have the potential to become mighty symphonies; like seeds, they are not destined to stay small. They remain an axiom (the starting string), the beginning point of a system. We showed this in our little seed music tool.

They hang, but not for long. The inborn rules fire, and all notes wait to transform, as much as can be crammed in growth-wise. It is simple too: the same rules apply to all the notes at once, and they transform in identical ways. wait This is where our fractal melody generator comes into play.

What happens next

In our tool, Ornament turns each note into four notes. It goes up one note and then back, a little flourish, Baroque-like. That is the first step, but it does not stop there. Those notes become more notes, following the identical rules. Bach would run out of fingers, but this is generated music, and the notes form fractal-like iterations.

This explosion of notes comes in layers, or iterations, and the slider in our tool sets the value; we call this depth. At depth one the notes follow the rule once, at depth two twice, at depth three thrice. The complexity of notes increases exponentially, as the same rule is applied many times. Our tool has room for only three; after this there would be too many notes, and we would be left with a muddy sound mess.

L-SYSTEM COMPOSER

Write a short motif. Choose a grammar โ€” a rewrite rule. Each iteration unfolds your idea recursively, the way a fern repeats its own shape at every scale.

Motif โ€” click chips to remove individual notes
Duration โ€” select before clicking a key; REST adds silence directly
Grammar โ€” the rewrite rule applied at each iteration
Parameters
Depth
Tempo
Scale Snap
Waveform
Piano Roll

The L-System Fractal Melody Generator

The MIDI fractal melody generator works differently from our other music players. Here, you bring your own idea, a note, a short phrase, whatever comes to mind, and hand it to the system to elaborate.

Start by clicking notes on the piano keyboard. Each note you click appears as a chip in the strip above the keyboard, showing its name and duration. Click a chip to remove it.

Choose your note duration before you click: eighth, quarter, dotted quarter, half, or whole. The REST button adds silence for the currently selected duration. Three to five notes make a good starting motif. Too many and the elaboration becomes unwieldy quickly.

Notes to Fractal

Once you have a motif, choose a grammar from the five cards. Each card shows a small diagram of what the rule does, a gold input note on the left and the green output notes on the right.

Ornament adds a quick decorative flourish and returns home. Sequence builds a rising run of three. Inversion mirrors the note above and below itself. Echo sends it back quieter. Branch forks three ways, like a tree dividing. The description on each card tells you the character of the rule in plain language.

Set the depth slider. Start at one and listen. Move to two and listen again. Three is where it get sound dense; the original motif is still inside, fractal layers deep, but harder to hear. The scale snap dropdown pulls all the elaborated notes into a chosen musical key after the rule fires; turn it off to hear raw mathematics.

Hit Play and watch the piano roll. The yellow line moves through the sequence as it plays. When something strikes you as worth keeping, hit Export MIDI.