Csound for the sound. The web for everything you see.
Cabbage is a framework for audio software development. Write your instrument in Csound 7, build its interface with HTML, CSS and JavaScript, and export it as a VST3, CLAP or AU plugin without leaving VS Code.
instr Savoy cutoff:k = cabbageGetValue:k("cutoff") reso:k = cabbageGetValue:k("resonance") saw:a = vco2(0.4, 110) sig:a = moogladder(saw, tonek(cutoff, 10), reso) outs(sig, sig)endinimport { Cabbage } from './cabbage/cabbage.js';const cutoff = document.querySelector('#cutoff');const send = (gesture) => Cabbage.sendControlData( { channel: 'cutoff', value: +cutoff.value, gesture }, null);
// begin and end let the DAW record automation.cutoff.addEventListener('pointerdown', () => send('begin'));cutoff.addEventListener('input', () => send('value'));cutoff.addEventListener('pointerup', () => send('end'));
// Follow the DAW when it moves the knob. Never send from here.Cabbage.addMessageListener((msg) => { if (msg.command === 'parameterChange') redraw(msg.data ?? msg);});Cabbage.isReadyToLoad(null);<Cabbage>{ "pluginId": "Svoy", "widgets": [ { "type": "form", "caption": "Savoy", "size": { "width": 440, "height": 200 } }, { "type": "rotarySlider", "label": { "text": "Cutoff" }, "bounds": { "left": 110, "top": 40, "width": 90, "height": 110 }, "channels": [ { "id": "cutoff", "range": { "min": 20, "max": 20000, "defaultValue": 1200 } } ] }, { "type": "rotarySlider", "label": { "text": "Resonance" }, "bounds": { "left": 240, "top": 40, "width": 90, "height": 110 }, "channels": [ { "id": "resonance", "range": { "min": 0, "max": 1, "defaultValue": 0.5 } } ] } ]}</Cabbage>The same instrument with an interface of its own. It is a web page.
Start with a sketch. Finish with a design of your own.
The widgets that ship with Cabbage are for prototyping. They get sound on screen in minutes. When the instrument is right, give it an interface that looks like your work, not ours.
- 1
Sketch with built-in widgets
Describe sliders, buttons, keyboards and XY pads in JSON, then drag them into place in Edit Mode. Every change is written back to your .csd file.
Widget reference - 2
Add widgets of your own
Write a widget class in JavaScript. It shows up in the property panel and drags around the editor like the built-in ones.
Custom widgets - 3
Replace the whole interface
Point Cabbage at any web page: plain HTML, or a Svelte, React or Vue project with hot reload. The Cabbage JS API carries values to Csound and back, DAW automation included.
Custom interfaces
Csound 7 underneath.
Cabbage 3 is built on the latest major release of Csound. Instrument code is easier to read, and a few things plugin authors have wanted for years are now part of the language.
- Explicit types
- Name variables however you like and declare their rate: cutoff:k, not kCutoff.
- Structs and better UDOs
- Group related state, and pass arrays to your own opcodes by reference.
- Built-in oversampling
- Run distortion and waveshaping at a higher rate to keep aliasing out.
- Opcode arrays
- Create a bank of filters or oscillators and run the lot in one line.
; Four resonant filters, created and run as one array.instr FilterBank freq:i[] fillarray p5*0.75, p5, p5*1.333, p5*1.666 obj:Opcode[] create reson, lenarray(freq) src:a rand linenr(p4, 0.1, 0.1, 0.01) sig:a[] run obj, src, freq, freq/p6, 2 out sumarray(sig) / lenarray(sig)endinEverything else is a command away.
Cabbage 3 lives in the VS Code command palette. Pick a command to see what it does.
Export as CLAP Effect
Exports the instrument as a plugin. Effects and synths build as VST3 or CLAP, and as AUv2 on macOS, where MIDI effects are supported too.
Exporting instruments- Cabbage: Compile Cabbage Instrument
- Saves the .csd and opens the instrument in a panel beside your code. While the Cabbage server is running, every save rebuilds the interface. Working with instruments
- Cabbage: Edit Mode
- Right-click to add widgets, drag them into place and change their properties in a panel. The JSON in your file is rewritten as you go. Working with instruments
- Cabbage: Create Vanilla VST3 Synth Project (Custom UI)
- Scaffolds a complete plugin with a plain HTML, CSS and JavaScript front end, already wired to the Cabbage JS API. Bring Svelte, React or Vue when you are ready. Custom interfaces
- Cabbage: Export as CLAP Effect
- Exports the instrument as a plugin. Effects and synths build as VST3 or CLAP, and as AUv2 on macOS, where MIDI effects are supported too. Exporting instruments
- Cabbage: Export as VST3 Effect (ARA)
- Builds an ARA plugin, which gives Csound direct access to the audio on the DAW timeline instead of waiting for it in real time. ARA support
- Cabbage: Start Recording to WAV
- Records the instrument output to a WAV file while you play, in 16-bit or 32-bit float. Commands and settings
- Cabbage: Make for Daisy
- Compiles the current .csd for the Electrosmith Daisy hardware platform. Commands and settings
- Cabbage: Update old-style Cabbage code to JSON
- Converts Cabbage 2 widget code to the JSON format that Cabbage 3 uses. What is new in Cabbage 3
Coming from Cabbage 2?
Cabbage 3 is a rewrite, and some familiar things have moved. The standalone IDE has given way to a VS Code extension, widgets are written as JSON with camelCase names, and instruments run on Csound 7. One command converts your old widget code.
Selling what you make
Yes, you can sell instruments built with Cabbage. Two things to know first: the Cabbage framework inside every exported plugin is GPLv3, and in a standard export end users can read your Csound code. For protected exports and commercial terms, message rorywalsh on the forum about Cabbage Pro.
Three installs and you are making noise.
Stuck? Ask on the forum.
- 1
Csound 7
The audio engine Cabbage 3 runs on.
- 2
The Cabbage extension for VS Code
The editor tools, the live preview and the Cabbage server, in one download.
- 3
The Csound language extension
Syntax highlighting, opcode hints and error checking for your Csound code.