marbles
marbles · sources · schema v1Random 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.
the faceplate
inputs
| id | cable | what it does |
|---|---|---|
rate_cv | cv | CV 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_cv | cv | Discrete 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_cv | cv | CV 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_cv | cv | CV 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_cv | cv | CV 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_cv | cv | CV 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_cv | cv | CV 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_cv | cv | CV 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_cv | cv | CV 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_cv | cv | CV 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_cv | cv | Discrete 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
| id | cable | what it does |
|---|---|---|
t1 | gate | First random gate from the T section, firing per the selected model's logic, bias and jitter. Patch into a drum/envelope trigger. gate / trigger |
t2 | gate | Second 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 |
x1 | cv | First 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) |
x2 | cv | Second random control voltage, decorrelated from x1 — a different but related stream for a second voice or parameter. control voltage (CV) |
x3 | cv | Third random control voltage, decorrelated from x1 and x2 — a third independent stream. control voltage (CV) |
clk | gate | The master clock output that paces both sections — patch it out to clock other modules in time with Marbles. gate / trigger |
params
| id | label | range | default | curve |
|---|---|---|---|---|
rate | Rate | -60..60st | 0 | linear |
t_model | T Model | 0..? | 0 | discrete |
t_bias | T Bias | 0..1 | 0.5 | linear |
t_jitter | T Jitter | 0..1 | 0 | linear |
deja_vu | Déjà Vu | 0..1 | 0 | linear |
length | Length | 1..16 | 8 | discrete |
pw_mean | PWidth | 0..1 | 0.5 | linear |
spread | Spread | 0..1 | 0.5 | linear |
x_bias | X Bias | 0..1 | 0.5 | linear |
steps | Steps | 0..1 | 0.5 | linear |
x_deja_vu | X Déjà Vu | 0..1 | 0 | linear |
x_length | X Length | 1..16 | 8 | discrete |
scale | Scale | 0..? | 0 | discrete |
controls
| control | what it does |
|---|---|
| Déjà Vu | The 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'. |
| Length | How many steps long the T-section loop is (1..16) when Déjà Vu locks the gate pattern. |
| PWidth | The average pulse width of the T-section gates (0..1) — how wide each gate stays high relative to the clock. |
| Rate | Master 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. |
| Scale | The 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). |
| Spread | How far the three X voltages wander from the mean (0..1): low is tight around the center, high explores the full range. |
| Steps | Lag/portamento on the X voltages (0..1): 0 jumps instantly between values, higher values glide smoothly between them. |
| T Bias | Skews the T gates sparser or denser (0..1) — low values fire rarely, high values fire often, 0.5 is balanced. |
| T Jitter | Adds timing humanization to the T gates (0..1): 0 is metronomic, higher values loosen the placement. |
| T Model | Picks 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 Bias | The average level the three X voltages center on (0..1) — shifts the whole random spread up or down. |
| X Déjà Vu | The X-section randomness lock (0..1): like Déjà Vu but for the three control voltages — sweeps from random to a repeating loop. |
| X Length | How many steps long the X-section loop is (1..16) when X Déjà Vu locks the voltage pattern. |
source
marbles.ts on GitHub.