Motif
An AI-native music-as-code tool and visual DAW for Sonic Pi.
Motif was previously published as Sonic Pi DAW. It provides a visual arrangement workspace for Sonic Pi rather than a standalone audio engine.
Motif brings Sonic Pi Ruby code into a visual workspace in VS Code. Explore tracks and notes on a timeline, make supported edits visually, and keep your Ruby file as the source of truth. Sonic Pi runs separately and produces the sound.
Select sounds and describe an idea to send source and selection context to your IDE chat. If chat cannot be opened, Motif attempts to copy the prompt to your clipboard. AI is provided by your IDE or an external tool; Motif does not include a model or guarantee generated changes.
Requirements
- VS Code 1.85 or later. The current Marketplace package targets Apple Silicon macOS; the minimum VS Code version has not yet been independently verified.
- Sonic Pi installed at
/Applications/Sonic Pi.app and running for playback. The connection uses Sonic Pi's local UDP interface.
Quick start: open the demo
- Install Motif in VS Code.
- Open the Command Palette (
⇧⌘P) and run Motif: New Demo. A new, untitled Ruby document and its DAW view open side by side.
- Explore the tracks and notes. Try changing a note or its timing in the DAW, then see the Ruby source update. Use VS Code Undo to undo an edit.
- Save the Ruby document if you want to keep your changes.
- Open Sonic Pi, then select Play / Restart latest code in the DAW to send the current Ruby document, including unsaved changes, to Sonic Pi.
- Select Stop all Sonic Pi jobs when you are finished.
Play / Restart stops all running Sonic Pi jobs before starting the current document. Stop also stops all jobs, including those started from other Sonic Pi buffers. Edits do not change the sound until you run the code again. A message that code was sent is not confirmation that it played; check Sonic Pi for execution errors.
Open your own music
Open a Sonic Pi .rb file in VS Code and run Motif: Open Arrangement, or use the editor's Open Motif action. The arrangement is derived from the Ruby source; visual edits write supported changes back to that document and participate in VS Code Undo.
What you can do
- Explore tracks, notes and timing in an arrangement view and piano roll.
- Edit supported note pitches, timing, synth choices, track gain and mute in the visual interface.
- Work with supported loops and choose whether an edit applies to one occurrence or the whole loop when prompted.
- Import an external vocal or audio sample, edit supported sample parameters, and add lyric annotations to notes or samples.
- Follow supported playback using beat reports from Sonic Pi. The view waits for valid reports and freezes a track if its reports stop; this is not a measurement of audio output latency.
Current limitations
- This is an early release. Ruby expressions, dynamic timing and other unsupported constructs may limit precise visualization or editing; check the warnings in the DAW.
- Playback following is available only for supported Ruby structures. Manual cursor movement and silent animation affect the view; they do not seek or pause audio.
- The
sonicPiDaw.outputLatencyMs setting can delay the displayed playhead to compensate manually for output latency. Acoustic synchronization has not been measured or verified.
- The package is for Apple Silicon macOS. Other platforms and the declared minimum VS Code version need additional validation.
- Sonic Pi is a separate application; this extension does not include an audio engine.
Why Motif?
A motif is a small musical idea that can grow through repetition and variation. The name also nods to the historic Motif GUI toolkit: both references reflect our goal of bringing music, code and a visual interface together. Motif is an independent project and is not affiliated with the historic GUI toolkit.