Chapter 16
The Code module and Visual
Write your own modules in a small DSP language, and a first look at the Drambo Visual expansion.
Written in our own words from the Drambo docs’ Code module and Drambo Visual pages, and the App Store release notes. Read the Drambo docs
The Code module
The Code module, added in 2.49, lets you write a module of your own in a simple expression language built for real-time audio. You can edit the code while it plays. Use it for a bit of custom maths between two modules, or go all the way to your own oscillators, filters, envelopes and effects.
What it can do
- Work on whole blocks of samples at once, which runs almost as fast as Drambo’s own modules, or sample by sample for fully custom DSP such as filters with feedback, at roughly two to five times the cost. See Per-sample mode and feedback.
- Keep state between blocks: its oscillators, filters, envelopes and delays carry on where they left off.
- Branch with
ifandelseor the?:operator. - Show the inputs, knobs and outputs you declare on the surrounding module, where they connect like any others. See Inputs, knobs and outputs.
Things to know before you start
- No semicolons needed at the ends of lines.
- Write numbers in full:
0.1, not.1, and no scientific notation such as1e-9. - Keep each expression on one line.
- The module processes each voice and each stereo channel separately, so you can’t yet reach left and right together.
From the community
Live DSP Coding in Drambo 2.49 (Code Module)
beepstreetapps
BeepStreet’s 90-second clip of the Code module from 2.49, edited while it plays. From January 2026.
BeepStreet Drambo v2 - Demo / Tutorial 104: Code Module WOW 🤩
SoundForMore MusicTech Tutorials
A sine oscillator built in the Code module, then given envelope parameters and gain, ending with a look at the module’s own documentation. From February 2026.
Making Techno In Drambo (with explanation)
Tone Garden
An 80-minute techno session with commentary, on a MacBook: the Macro Oscillator, Flexi Sampler hi-hats, scene states for variation and an unsuccessful Code module experiment. From February 2026.
- Drambo docsBeepStreet — The official documentation this guide draws on, from the interface and sequencer to modules, MIDI mapping and the Code module. Its video page warns that some recommended videos show older versions.
- Drambo (iOS/macOS): update 2.55: modular groovebox gets granular synthesis and moreSynth Anatomy — A running article that adds each update on top: 2.55’s Looper and Granular modules, Drambo Visual, the Code module, the 2.40 MIDI and time-signature changes, and back to 2.0.
- Code module development repositoryBeepStreet forums — A community member’s public repository of Code modules, with testing and linting tools. From October 2026.
Inputs, knobs and outputs
Three functions connect your code to the rest of Drambo. Each one you call adds something to the module.
- input(type, name)
- Adds an input socket and gives you its signal, read-only. The name is optional.
- param(type, name)
- Adds a knob and gives you its value.
- output(variable, type, name)
- Sends a variable to an output socket. Type and name are optional, and the first argument has to be a variable, not an expression.
Socket types
| Type | What the value is |
|---|---|
audio | An audio signal. |
gate | 0 while the key is up, 1 while it’s down. |
pitch | Pitch in hertz. |
velocity | The gate’s velocity. |
time | Time in seconds. |
Knob types
| Type | Range |
|---|---|
value | 0 to 1 |
pitch | 20 to 20,000 Hz |
time | 0 to 20 seconds |
Two system variables are always there: sampleRate, the current sample rate, and tempo, the current tempo. Because pitch arrives in hertz, you rarely need cvToFreq and freqToCv, which convert between hertz and Drambo’s pitch scale (How pitch works).
From the community
BeepStreet Drambo v2 - Demo / Tutorial 104: Code Module WOW 🤩
SoundForMore MusicTech Tutorials
A sine oscillator built in the Code module, then given envelope parameters and gain, ending with a look at the module’s own documentation. From February 2026.
The language
There is nothing to declare: a variable exists once you assign to it. Every variable is a number — either a single value or a buffer of samples — and operators work on whole signals at once.
| Operators | Meaning |
|---|---|
+ - * / | Arithmetic |
> < >= <= == != | Comparisons |
condition ? a : b | Picks a when the condition is true, otherwise b |
if (…) { … } else { … } blocks work too. In the default block mode, a condition is judged for the whole block, from its first sample; switch to per-sample mode when it has to be judged on every sample (Per-sample mode and feedback). Comments use // for a line and /* … */ for a block.
From the community
Live DSP Coding in Drambo 2.49 (Code Module)
beepstreetapps
BeepStreet’s 90-second clip of the Code module from 2.49, edited while it plays. From January 2026.
BeepStreet Drambo v2 - Demo / Tutorial 104: Code Module WOW 🤩
SoundForMore MusicTech Tutorials
A sine oscillator built in the Code module, then given envelope parameters and gain, ending with a look at the module’s own documentation. From February 2026.
Built-in functions
The language comes with a small standard library. Oscillators, filters, envelopes and delays keep their state from one block to the next.
| Group | Functions |
|---|---|
| Maths | sin cos tan tanh abs log exp sqrt pow floor ceil fract min max clamp mod mix, and and or xor |
| Oscillators | oscSin(freq, phase, sync) with phase and sync optional, oscSaw(freq), oscTri(freq), oscPulse(freq, width), noise() |
| Filters | lpf hpf bpf notch (12 dB state-variable filters taking input, cutoff and resonance), lpf6 hpf6 apf6 (6 dB one-pole filters), comb(input, frequency, feedback) |
| Envelopes | envAD envD envAHD (start on a rising gate and run to the end), envAR (releases as soon as the gate falls) |
| Delays | delay(input, seconds), delayTuned(input, frequency) for Karplus-Strong and physical modelling |
| Utilities | seq(index, …) picks one of a list of values, edge turns a rising gate into a one-sample pulse, sh samples and holds, sign, integrator, differentiator, cvToFreq, freqToCv |
Per-sample mode and feedback
By default the Code module works on blocks of samples, which is fast. Put #persample on the first line to run the script once per sample instead. It costs more, but it unlocks something nothing else in Drambo allows: reading a variable before it is assigned in the same pass, which gives you its value from the previous sample. Variables start at 0.
That is single-sample feedback — the basis of hand-made filters, physical models and feedback delays — and it’s the way round Drambo’s one-way signal flow (Feedback loops).
A one-pole smoother
#persample
x = input(audio)
amount = param(value, Smooth)
// y still holds last sample’s value here
y = y + (x - y) * (1 - amount * 0.99)
output(y, audio)Code to start from
These use only the functions listed in Built-in functions. Paste one into a Code module, and its knobs and sockets appear on the module.
Drive with a dry and wet mix
x = input(audio)
drive = param(value, Drive)
wet = param(value, Mix)
y = tanh(x * (1 + drive * 5))
out = mix(y, x, wet)
output(out, audio)Tremolo
x = input(audio)
rate = param(value, Rate)
depth = param(value, Depth)
lfo = oscSin(0.5 + rate * 12)
gain = 1 - depth * (0.5 + lfo * 0.5)
out = x * gain
output(out, audio)A plucked voice
p = input(pitch)
g = input(gate)
decay = param(time, Decay)
s = oscSaw(p) * envD(g, decay)
s = lpf(s, p * 3, 0.3)
output(s, audio)Put the drive and tremolo on an effect track or inside a Processor rack. The plucked voice needs pitch and gate, so it goes after MIDI to CV on an instrument track; set its Decay knob to taste.
From the community
BeepStreet Drambo v2 - Demo / Tutorial 104: Code Module WOW 🤩
SoundForMore MusicTech Tutorials
A sine oscillator built in the Code module, then given envelope parameters and gain, ending with a look at the module’s own documentation. From February 2026.
Drambo Visual
Drambo Visual, introduced in 2.54, is an in-app purchase that adds a modular environment for graphics. You patch visual modules the same way as sound modules, and the two share the same signals — so sequencers, LFOs, envelopes, MIDI, morphs and performance gestures can all drive what you see. You can show the result on an external display over HDMI and export audio and video in sync.
Three ways in
- Content
- Start from text, images, video or the camera, and place, transform, layer, colour and distort them. The easiest place to begin.
- Shaders
- Images defined pixel by pixel — generative patterns, textures and distortions — built modularly from Shader Kit modules or coded.
- Scene
- Draw and animate objects in 2D or 3D, with structure and state, mostly through code.
The main visual signal is the texture — an image of RGBA pixels — which flows from sources through processors to the Projector, which displays it. Visual modules can also turn textures back into sound and MIDI: 2.55 added modules that synthesise audio from live textures, and 2.56 added a MIDI Texture Scanner that plays notes from what it scans.
Visual launched with 42 modules and keeps growing. BeepStreet’s Drambo Visual pages document it in depth.
From the community
Drambo Visual - Intro Walkthrough
Ben Richards
A 43-minute introduction to the Drambo Visual purchase from 2.54: patching, modulation, audio reactivity, shaders, 3D, feedback and export. He also points to the in-app Visual Rack tutorials. From July 2026.
Drambo Visual Extension - Easily Create Stunning Visuals
Simon Inwards
A short showcase of an evolving visual made with Drambo Visual after working through the factory tutorials. From September 2026.
- Drambo VisualBeepStreet — BeepStreet’s page for the Visual expansion: how texture signals flow from sources to the Projector, visual racks, shader building and per-pixel modulation.
- Drambo Visual expansion — BeepStreet forumsBeepStreet forums — Where Drambo Visual users share projects and techniques, and where the developer often joins in.
- Drambo (iOS/macOS): update 2.55: modular groovebox gets granular synthesis and moreSynth Anatomy — A running article that adds each update on top: 2.55’s Looper and Granular modules, Drambo Visual, the Code module, the 2.40 MIDI and time-signature changes, and back to 2.0.
