Write music as code and hear it as MIDI. Code Sequencer is an editor for patterns, chord progressions, generated melodies and multi-track songs, written in Symbolic Cycle, Maru's own pattern language. Each part plays on its own MIDI channel, so you can hear it on the built-in voice, send it to instruments in a rack, or export it as a MIDI file.
The idea
Symbolic Cycle follows the TidalCycles and Strudel tradition of short, looping patterns written in mini-notation, and adds musical values that stay abstract until the last moment: chord symbols, Roman numerals in a key, scale steps, pitch-class sets and drum names. Seeded generators draft progressions, melodies and basslines that vary between seeds but loop exactly.
const chords = roman("<i III VI VII>").key("E:minor").phrase(4)
export const keys = chords.velocity(0.5)
export const lead = generateMelody({ over: chords, rhythm: "x x ~ x", seed: 2 })Each named part becomes a track, with its own colour in the MIDI roll and its own channel. Drums play on channel 10.
Working in the editor
- Preview plays the code. Edits are checked after a short pause and, while playing, take over at the next cycle boundary at the same position, so nothing drops out or jumps back. An invalid edit leaves the last working pattern playing. ⌘↵ or Ctrl+Enter applies an edit; ⌘. or Ctrl+. stops.
- Click a value in the code to edit it with a control: a seed with dice, a note range, a rhythm step grid, a pitch-class clock, a key or a scale. The edit is written back into the code in your own spelling.
- Render replaces a generator call with the literal notes it produced, keeping the original as a comment.
- The MIDI roll shows every part, with mute and solo, a scrolling view for long songs, and an Analysis view for rhythm and chord study. Export MIDI downloads a type 1 MIDI file with one track per part, or drag the button straight into a DAW.
- Problems lists errors and what the code had to assume, and the Reference panel lists every name in the language with an example to insert.
- Tempo follows the host by default, or set your own BPM.
Getting started
Open the composition menu and start with one of the loops, then try a long form such as Song form, Groove with breakdown or Drifting ambient. The Symbolic Cycle examples teach the language in order, from chord sets and voicings to generated melodies and full arrangements.
The menu also offers programs, such as Scale explorer: small projects with their own play panel of knobs and switches, so you can shape a piece without editing its code. Some programs take a MIDI file you drop in and build on its melody; others, such as Live harmonizer, respond to notes you play into the module.
Code is saved with presets and share links. Opening a shared link never runs its code until you press Preview or edit it. The code runs as JavaScript in your browser, so only run code you trust.
Limits
- 1 to 256 cycles, at 20 to 300 BPM, up to 50,000 notes.
- Code is limited to 3,072 bytes so it fits in a share link.
- Notes carry velocity and channel; controllers, program changes and pitch bend are not sent.
- Code Sequencer currently runs in the browser only.
The Symbolic Cycle guide walks through the language with examples. In the source, the language reference lists every name with its defaults and a runnable example, and the program templates describe each built-in program.




