marbles

marbles · sources · schema v1

Random sampler / clock generator (Mutable Instruments Marbles archetype, Émilie Gillet, MIT-licensed). Clean-room TypeScript port of the eurorack/marbles/ DSP. The T-section (t1 / t2 gates) generates clocked random gates via one of six models — COIN (complementary Bernoulli), CLUSTERS, DRUMS (18 built-in 8-step patterns), INDEP (independent Bernoulli), 3-STATE, MARKOV — with a déjà-vu loop that locks the random stream into a repeating pattern (RATE / T BIAS / T JITTER / DÉJÀ VU / LENGTH). The X-section (x1 / x2 / x3 CV) draws random voltages shaped by SPREAD (variance), X BIAS (mean), and STEPS (quantization amount + STEPS-knob portamento), snapped through a weight-aware variable-resolution quantizer onto one of six scales (C major / C minor / Pentatonic / Pelog / Raag Bhairav / Raag Shri), with its own déjà-vu loop shared across the three X channels via pseudo-random hash shifts. clk is the master clock. CV outs are ±1 (= ±5V). Beta-distribution sampling is approximated analytically vs the firmware's precomputed table; the déjà-vu / Markov / quantizer / lag logic is ported line-for-line.

A random sampler and clock generator (a port of Mutable Instruments Marbles) with two halves driven by one master clock. The T section makes random GATES (two outputs, t1/t2) whose character is set by a model — coin-toss, clusters, drum-like, independent, three-state, or Markov — plus bias and jitter. The X section makes three random CONTROL VOLTAGES (x1/x2/x3) whose Spread sets how wide they wander, Bias sets their average, Steps adds lag/portamento, and a Scale quantizes them to musical notes. The killer feature is Déjà Vu: turn it up and the otherwise-random stream LOCKS into a repeating loop (length set per section), so you can dial smoothly from pure chance to a fixed pattern and anywhere in between. Every control also has a dedicated CV input so the randomness itself can be modulated.

the faceplate

marblesrate_cvcvtmodel_cvcvtbias_cvcvtjitter_cvcvdejavu_cvcvlength_cvcvspread_cvcvxbias_cvcvsteps_cvcvxdejavu_cvcvscale_cvcvt1gatet2gatex1cvx2cvx3cvclkgateaudiocvgatepitch
11 inputs · 6 outputs · 13 params

inputs

idcablewhat it does
rate_cvcvCV that modulates the master clock Rate (in semitones, summed with the knob) — speeds up or slows down both the T and X sections together.
control voltage (CV); modulates rate (additive offset — ±1 CV sweeps the full range, centered on the knob)
tmodel_cvcvDiscrete CV that modulates the T-section Model select, stepping between COIN / CLUSTERS / DRUMS / INDEP / 3-STATE / MARKOV.
control voltage (CV); modulates t_model (integer buckets — CV selects a discrete step)
tbias_cvcvCV that modulates the T-section Bias (0..1, summed with the knob) — skews the gate distribution sparser or denser.
control voltage (CV); modulates t_bias (additive offset — ±1 CV sweeps the full range, centered on the knob)
tjitter_cvcvCV that modulates the T-section Jitter (0..1) — adds or removes timing humanization on the random gates.
control voltage (CV); modulates t_jitter (additive offset — ±1 CV sweeps the full range, centered on the knob)
dejavu_cvcvCV that modulates the T-section Déjà Vu (0..1) — sweeps the gate stream from fully random toward a locked, repeating loop.
control voltage (CV); modulates deja_vu (additive offset — ±1 CV sweeps the full range, centered on the knob)
length_cvcvCV that modulates the T loop Length (1..16 steps) used when Déjà Vu locks the gate pattern.
control voltage (CV); modulates length (additive offset — ±1 CV sweeps the full range, centered on the knob)
spread_cvcvCV that modulates the X-section Spread (0..1) — widens or narrows how far the three random voltages wander from the mean.
control voltage (CV); modulates spread (additive offset — ±1 CV sweeps the full range, centered on the knob)
xbias_cvcvCV that modulates the X-section Bias (0..1) — shifts the average level of the three random voltages.
control voltage (CV); modulates x_bias (additive offset — ±1 CV sweeps the full range, centered on the knob)
steps_cvcvCV that modulates the X-section Steps (0..1) — adds lag/portamento so the voltages glide between values instead of jumping.
control voltage (CV); modulates steps (additive offset — ±1 CV sweeps the full range, centered on the knob)
xdejavu_cvcvCV that modulates the X-section Déjà Vu (0..1) — sweeps the voltage stream from random toward a locked loop.
control voltage (CV); modulates x_deja_vu (additive offset — ±1 CV sweeps the full range, centered on the knob)
scale_cvcvDiscrete CV that modulates the X-section quantizer Scale select (C major, C minor, pentatonic, Pelog, Raag Bhairav, Raag Shri).
control voltage (CV); modulates scale (integer buckets — CV selects a discrete step)

outputs

idcablewhat it does
t1gateFirst random gate from the T section, firing per the selected model's logic, bias and jitter. Patch into a drum/envelope trigger.
gate / trigger
t2gateSecond random gate from the T section — complementary or independent of t1 depending on the model. The two together build call-and-response rhythms.
gate / trigger
x1cvFirst quantized random control voltage from the X section, shaped by Spread/Bias/Steps and snapped to the chosen Scale. Patch into a pitch input.
control voltage (CV)
x2cvSecond random control voltage, decorrelated from x1 — a different but related stream for a second voice or parameter.
control voltage (CV)
x3cvThird random control voltage, decorrelated from x1 and x2 — a third independent stream.
control voltage (CV)
clkgateThe master clock output that paces both sections — patch it out to clock other modules in time with Marbles.
gate / trigger

params

idlabelrangedefaultcurve
rateRate-60..60st0linear
t_modelT Model0..?0discrete
t_biasT Bias0..10.5linear
t_jitterT Jitter0..10linear
deja_vuDéjà Vu0..10linear
lengthLength1..168discrete
pw_meanPWidth0..10.5linear
spreadSpread0..10.5linear
x_biasX Bias0..10.5linear
stepsSteps0..10.5linear
x_deja_vuX Déjà Vu0..10linear
x_lengthX Length1..168discrete
scaleScale0..?0discrete

controls

controlwhat it does
Déjà VuThe T-section randomness lock (0..1): 0 is fully random gates, 1 repeats a fixed loop of Length steps, and in between it occasionally re-rolls — the heart of Marbles' 'controlled chance'.
LengthHow many steps long the T-section loop is (1..16) when Déjà Vu locks the gate pattern.
PWidthThe average pulse width of the T-section gates (0..1) — how wide each gate stays high relative to the clock.
RateMaster clock rate in semitones (-60..+60); sets the tempo that drives both the T gates and the X voltages, and the rate of the clk output.
ScaleThe quantizer scale the X voltages snap to: C major, C minor, pentatonic, Pelog, Raag Bhairav, or Raag Shri (the card's scale button cycles these).
SpreadHow far the three X voltages wander from the mean (0..1): low is tight around the center, high explores the full range.
StepsLag/portamento on the X voltages (0..1): 0 jumps instantly between values, higher values glide smoothly between them.
T BiasSkews the T gates sparser or denser (0..1) — low values fire rarely, high values fire often, 0.5 is balanced.
T JitterAdds timing humanization to the T gates (0..1): 0 is metronomic, higher values loosen the placement.
T ModelPicks the T-section gate model: COIN (independent coin tosses), CLUSTERS (bursts), DRUMS (drum-pattern-like), INDEP (two independent streams), 3-STATE, or MARKOV (state-machine sequences). The card's T-model button cycles these.
X BiasThe average level the three X voltages center on (0..1) — shifts the whole random spread up or down.
X Déjà VuThe X-section randomness lock (0..1): like Déjà Vu but for the three control voltages — sweeps from random to a repeating loop.
X LengthHow many steps long the X-section loop is (1..16) when X Déjà Vu locks the voltage pattern.

source

marbles.ts on GitHub.

Generated from packages/web/src/lib/{audio,video}/module-registry.ts · repo