{
  "$type": "at.atmosynth.module",
  "descriptionVersion": 1,
  "moduleId": "chorus-bbd",
  "versionKey": "3",
  "name": "Bucket-brigade chorus",
  "description": "The Roland Juno-6's chorus as a module, as one was heard and measured: one wave moving two bucket-brigade delay lines in opposite directions, one heard on each side beside the sound that came in, so while the left copy falls behind the right one catches up and the sound spreads out between the speakers. Mode is the Juno's three buttons. II sweeps each line about 2.2 milliseconds either side of 3.37, two thirds of a time a second (0.68 Hz), and I is the same sweep slower (0.405 Hz), the gentle one. I+II is not the two together but the Juno's third setting, a quick shallow wobble 7.85 times a second, its wave rounded nearly to a sine, closer to a vibrato than a chorus. Changing Mode while a note sounds glides from one to the next rather than clicking. Mix goes from the sound alone to the two lines alone, keeping the sound about as loud as it went in; it starts at 0.6, the Juno's own balance, each line a little under three decibels louder than the sound beside it, which is most of how wide the Juno is. What makes it a bucket-brigade chorus rather than the plain one: the lines are filtered either side as the Juno-6's are, clear to five kilohertz and gone soon past ten; a line is a row of buckets handed along at a clock, so as it lengthens its clock slows and it darkens, quietens and hisses a little more, and as it shortens the other way, with every sweep; the two lines are two chips that are not quite alike, one a touch quicker and louder, as no two ever are; and only a very loud sound comes out of a line at all rounded. Hiss is how much noise: where it starts, as quietly as the Juno, some seventy decibels under what is played, and at the top ten times that. The noise is the Juno's: a hiss under everything, a whoosh rising as each line lengthens, a soft thump at each turn of the sweep and a hum from the supply, at the levels a Juno-6 has them beside each other. It is there under whatever is played and for a second after, then goes over a second more, so a patch that has stopped playing falls silent and an export of it ends. A mono sound in comes out in stereo; a stereo one keeps its two sides in the dry path. It holds a few milliseconds past the note that made it, so it is added shared. Version 2 has darker lines, alike, steady in level and hiss across the sweep, rounds loud chords off plainly and plays I+II at 9.75 Hz; version 1 is the Juno-60's published figures. For a chorus with every setting free, the plain chorus is beside it. This module carries code, because everything a bucket-brigade line does as it sweeps follows its clock, the number of buckets divided by the delay, which nothing else here can divide by; and because nothing else here makes the random signal its noise is.",
  "audioInputs": [
    {
      "id": "in",
      "label": "In"
    }
  ],
  "audioOutputs": [
    {
      "id": "out",
      "label": "Out"
    }
  ],
  "midiInputs": [],
  "nodes": [
    {
      "id": "in",
      "kind": "moduleInput",
      "options": {
        "input": "in"
      }
    },
    {
      "id": "bbd",
      "kind": "dsp",
      "options": {
        "code": "// A bucket-brigade chorus, built as the Roland Juno-6's is: one LFO moving two\n// delay lines of 256 buckets each, the second line's movement turned upside\n// down, so while the left copy falls behind the right one catches up. Each\n// side is what came in plus its own line, and the two lines disagreeing is the\n// width.\n//\n// The three settings are the Juno's buttons, as a Juno-6 was heard to play\n// them: II sweeps the lines round a middle of 3.37 milliseconds, 2.23 either\n// side, at 0.68 Hz, which two recordings of it agree on to a few hundredths of\n// a hertz and a twentieth of a millisecond, and I is the same sweep, slower:\n// 0.405 Hz, between the 0.39 and 0.46 a short recording of it allowed, and\n// what the notes on the Juno-6's service schematic say, a period of two and a\n// half seconds where II's is one and a half. I+II is not the two at once but a\n// third setting, a fast, shallow wobble round the same middle — 7.85 Hz and\n// 0.236 milliseconds either side, the lines still opposite, as a Juno-6 was\n// measured doing it — where the Juno's triangle comes out rounded nearly to a\n// sine, as it is here. Moving between them glides the sweep's width and shape\n// over a few hundredths of a second, so a change while a note sounds bends it\n// rather than clicking.\n//\n// The two lines are two chips, and no two are alike: the first runs a little\n// quicker and comes out a little louder than the second, a delay one and a\n// half per cent short and a level four per cent up, and the second the other\n// way. Two lines alike would comb the sound alike, which is plainest where the\n// two sides are heard as one.\n//\n// A bucket-brigade line is a row of capacitors that hand what they hold along\n// at a clock, so its delay is the count of buckets over twice the clock, and\n// the clock is what moves: a longer delay is a slower clock. A slower clock\n// does three things to what comes out, all of them one over the delay, which\n// is why this is code. What reaches the end is the sound held a clock tick at\n// a time, and a hold loses the top by how long it holds — half its power at\n// 0.443 of the clock — so the line darkens as it lengthens. Each bucket leaks\n// a little of what it holds while it waits, so the line is quieter the longer\n// it is, three and a half per cent of its level for every millisecond past the\n// middle, which is a decibel and a half across a sweep. And what leaks in is\n// noise, so a long line hisses: the hiss that leaks in rises with the delay\n// by 38 decibels across I's sweep, the Juno's whoosh coming and going with\n// every sweep, louder at the long end.\n//\n// Around the line are the filters every such line needs, the same either side\n// of it: a Butterworth pair at 9,661 Hz and a pole at 20 kHz, which is what\n// the Juno-6's two-transistor filters simulate as, flat to five kilohertz and\n// falling fast past ten. Before it, so nothing the clock cannot carry gets in;\n// after it, to take the steps of the hold away. With the hold, a Juno-6's\n// chorus measured on and off is matched by them to half a decibel up to ten\n// kilohertz.\n//\n// The buckets are capacitors with a limit, and the line rounds what it carries\n// as it nears it: the ladder's rational tanh, a curve eight times as wide as\n// full scale, so a full-scale sound loses a twentieth of a decibel in the line\n// and only something far louder is plainly rounded. The curve is the same\n// either side of nothing, but a wave that is not — a narrow pulse, a sawtooth\n// a filter has rounded — comes out of it a little off centre, so the line is\n// filled through a one-pole at 5 Hz that takes that lean off below any note.\n//\n// And the line is noisy, at a level Hiss sets. A floor of hiss under\n// everything, lifted six decibels above three kilohertz; the hiss that leaks\n// in, which comes and goes with the sweep; a thump where the clock is at its\n// quickest and turns, as the clock's own driver kicks the line, a smaller one\n// the other way where it is slowest, and a ring at 30 Hz the bigger one leaves\n// behind it; and a hum at twice the mains, 100 Hz and two of its harmonics,\n// from the rail the chips run off, the same on both sides. Their levels beside\n// each other are as a Juno-6's were measured, and together they are seventy\n// decibels under what is played, as the Juno-6 these figures come from was.\nimport { AtmoProcessor, Rng } from \"atmosynth:dsp\";\n\nfunction clamp(value, low, high) {\n  return value < low ? low : value > high ? high : value;\n}\n\n// Buckets in each line: the MN3009's 256.\nconst STAGES = 256;\n// Each setting's LFO rate in hertz, the middle of the sweep and how far it goes\n// either side in seconds, and how far the wave is rounded from a triangle to a\n// sine, are tables the constructor makes.\n// How long a change of setting takes to settle, in seconds.\nconst GLIDE = 0.03;\n// Each line's delay and level beside the sweep's, the first chip's and the\n// second's, are two more.\n// The filters either side of the line: the pair's corner and how sharp its\n// knee is, and the pole beside it.\nconst KNEE = 9661;\nconst SHARPNESS = Math.SQRT1_2;\nconst TILT = 20000;\n// Where a hold loses half its power, as a share of its clock.\nconst HOLD = 0.443;\n// How much quieter the line is, as a share of its level, for each second its\n// delay is past the middle, as its buckets leak for longer.\nconst LOSS = 34.9;\nconst MIDDLE = 0.00337;\n// How wide the line's curve is beside full scale.\nconst WIDTH = 8;\n// The hiss at the top of the knob, which is ten times the Juno's, where the\n// knob starts: the floor, at the line's end before its filters, and the shelf\n// lifting it above SHELF by LIFT; the hiss that leaks in at the longest of I's\n// sweep, between LEAK_LOW and LEAK_HIGH, and how fast it falls as the line\n// shortens, 38 dB over I's 4.46 ms, as nepers per second of delay; the thump\n// where the clock turns, how long it lasts, and the smaller one's share of it;\n// the ring it leaves; and the hum.\nconst FLOOR = 0.000614;\nconst SHELF = 3000;\nconst LIFT = 0.995;\nconst LEAK = 0.00943;\nconst LONGEST = 0.0056;\nconst RISE = ((38 / (0.0056 - 0.00114)) * Math.LN10) / 20;\nconst LEAK_LOW = 800;\nconst LEAK_HIGH = 4000;\nconst THUMP = 0.032;\nconst THUMP_TIME = 0.18;\nconst SLOW = 0.2;\nconst RING = 30;\nconst RING_Q = 18;\nconst RING_LEVEL = 0.083;\nconst MAINS = 50;\nconst HUM1 = 0.0000265;\nconst HUM2 = 0.0000074;\nconst HUM3 = 0.0000033;\n// The hiss is let go of once nothing has come in for a while and taken up\n// again with the next sound, so a patch that has finished playing falls\n// silent — an export of it finds its end, where a hiss that never stopped\n// would ring to the end of the render — while under anything played it hisses\n// as it always did. Anything under −80 dB is nothing, which is where an\n// export takes silence to start too. The hiss stays a second past the last\n// sound, nearly two hundred times the longest the line holds anything (5.6 ms), so\n// the line's own tail is always heard out with its hiss under it, and a rest\n// of up to a second — a half note at 120 — passes with the hiss unmoved\n// rather than pumping between the notes of a phrase. Then it goes over a\n// second more, so a longer rest hears it thin away rather than stop, and it\n// comes back over a hundredth of a second, under the start of whatever\n// brought it back. Straight lines counted in samples, so the plugin's port\n// arrives at every value the program does.\nconst QUIET = 1e-4;\nconst LINGER = 1;\nconst FADE = 1;\nconst RETURN = 0.01;\n\n// The ladder's tanh, near enough: x(27 + x²) / (27 + 9x²), arriving at one at\n// three with no slope left. Arithmetic and nothing else, so the plugin works it\n// out to the same double.\nfunction soft(value) {\n  return value > 3 ? 1 : value < -3 ? -1 : (value * (27 + value * value)) / (27 + 9 * value * value);\n}\n\n// The thump, from nothing to nothing over its length: a sharp lobe down and a\n// slower, smaller one up, which is a line's output cap answering a kick.\nfunction thump(t) {\n  if (t < 0.2) {\n    const u = t / 0.2;\n    return -Math.exp(-4 * u) * Math.sin(Math.PI * u);\n  }\n  const u = (t - 0.2) / 0.8;\n  return 0.85 * Math.exp(-8 * u) * Math.sin(Math.PI * u);\n}\n\n// A one-pole's share of the way to its input at `hz`, by the bilinear\n// transform, so it is exactly where it is asked to be at any rate.\nfunction onePole(hz) {\n  const g = Math.tan((Math.PI * Math.min(hz, 0.45 * sampleRate)) / sampleRate);\n  return g / (1 + g);\n}\n\n// A table the constructor makes, one entry for each of the three settings.\nfunction table(first, second, third) {\n  const values = new Float64Array(3);\n  values[0] = first;\n  values[1] = second;\n  values[2] = third;\n  return values;\n}\n\n// The same for the two sides: what each starts at.\nfunction sides(first, second) {\n  const values = new Float64Array(2);\n  values[0] = first;\n  values[1] = second;\n  return values;\n}\n\nexport default class AtmosynthBbdChorus extends AtmoProcessor {\n  static spec = 1;\n  static inputs = [2];\n  static outputs = [2];\n  // Not smoothed here: a knob's move reaches these already eased.\n  static params = {\n    // Which of the three, by the Mode choice's position: I, II and I+II.\n    // Rounded, since a choice turned by a controller glides between\n    // positions on its way to one.\n    mode: { min: 0, max: 2, default: 0, rate: \"k\", smooth: 0 },\n    // From what came in alone to the two lines alone.\n    mix: { min: 0, max: 1, default: 0.6, rate: \"a\", smooth: 0 },\n    hiss: { min: 0, max: 1, default: 0.1, rate: \"k\", smooth: 0 },\n  };\n\n  constructor() {\n    super();\n    this.rng = new Rng(this.seed);\n    this.rates = table(0.405, 0.68, 7.85);\n    this.middles = table(0.00337, 0.00337, 0.00337);\n    this.depths = table(0.00223, 0.00223, 0.000236);\n    this.roundings = table(0, 0, 1);\n    this.trims = sides(0.985, 1.015);\n    this.gains = sides(1.04, 0.96);\n    // One line carries what both sides read, since both lines on the Juno are\n    // handed the same sound; each side reads it at its own delay. Longer than\n    // the longest delay, the slower chip's, by the four samples a reading\n    // between two needs.\n    this.size = Math.ceil(0.006 * sampleRate) + 4;\n    this.line = new Float64Array(this.size);\n    this.write = 0;\n    this.phase = 0;\n    // The sweep as it stands, gliding to the setting's; set outright the\n    // first time, so the chorus does not glide in from nothing.\n    this.settled = false;\n    this.middle = 0;\n    this.depth = 0;\n    this.rounding = 0;\n    // The mix the two levels below were last worked out for.\n    this.mix = 0 / 0;\n    this.dryLevel = 0;\n    this.wetLevel = 0;\n    // The pair either side of the line, as a state-variable filter: its\n    // integrator's gain and what its feedback divides by.\n    this.knee = Math.tan((Math.PI * KNEE) / sampleRate);\n    this.kneeDivide = 1 / (1 + this.knee / SHARPNESS + this.knee * this.knee);\n    this.tilt = onePole(TILT);\n    this.glide = 1 / (GLIDE * sampleRate);\n    this.ceiling = 0.45 * sampleRate;\n    // Before the line, the pair's two integrators and the pole's.\n    this.before1 = 0;\n    this.before2 = 0;\n    this.beforeTilt = 0;\n    // The 5 Hz one-pole the rounded sound is filled into the line through,\n    // and the two samples it remembers.\n    this.pole = 1 - (2 * Math.PI * 5) / sampleRate;\n    this.lastBent = 0;\n    this.centred = 0;\n    // After it, on each side: the hold's, the pair's two and the pole's.\n    this.hold = new Float64Array(2);\n    this.after1 = new Float64Array(2);\n    this.after2 = new Float64Array(2);\n    this.afterTilt = new Float64Array(2);\n    // The noise, each side its own: the floor's shelf, the leak's two poles,\n    // how far into each thump it is (none running at −1), whether its line\n    // was already past where one starts, so one starts only on the way in,\n    // and the ring's two integrators. The LFO starts at its turn, and no thump\n    // is heard for a turn that was never travelled to.\n    this.shelf = onePole(SHELF);\n    this.leakLow = onePole(LEAK_LOW);\n    this.leakHigh = onePole(LEAK_HIGH);\n    this.shelved = new Float64Array(2);\n    this.lowLeak = new Float64Array(2);\n    this.highLeak = new Float64Array(2);\n    this.length = Math.round(THUMP_TIME * sampleRate);\n    this.quick = sides(-1, -1);\n    this.slow = sides(-1, -1);\n    // One for already past, nothing for not.\n    this.inQuick = sides(1, 1);\n    this.inSlow = sides(1, 1);\n    this.ringFrequency = 2 * Math.sin((Math.PI * RING) / sampleRate);\n    this.ringLow = new Float64Array(2);\n    this.ringBand = new Float64Array(2);\n    this.hum = 0;\n    // How many samples nothing has come in for, counted no further than the\n    // linger, and how far open the hiss is, from shut to one. It starts shut,\n    // as if the quiet had been going on for ever: nothing has passed yet.\n    this.linger = LINGER * sampleRate;\n    this.quiet = this.linger;\n    this.open = 0;\n    this.fall = 1 / (FADE * sampleRate);\n    this.rise = 1 / (RETURN * sampleRate);\n  }\n\n  // The line read `behind` samples before the one just written, between two\n  // samples where that is not a whole number: a cubic through the four nearest,\n  // which keeps the top a straight line between two would lose.\n  read(behind) {\n    const line = this.line;\n    const size = this.size;\n    let at = this.write - behind;\n    if (at < 0) at += size;\n    const whole = Math.floor(at);\n    const fraction = at - whole;\n    const y0 = line[whole === 0 ? size - 1 : whole - 1];\n    const y1 = line[whole];\n    const y2 = line[whole + 1 >= size ? whole + 1 - size : whole + 1];\n    const y3 = line[whole + 2 >= size ? whole + 2 - size : whole + 2];\n    const c1 = 0.5 * (y2 - y0);\n    const c2 = y0 - 2.5 * y1 + 2 * y2 - 0.5 * y3;\n    const c3 = 0.5 * (y3 - y0) + 1.5 * (y1 - y2);\n    return ((c3 * fraction + c2) * fraction + c1) * fraction + y1;\n  }\n\n  process(inputs, outputs, parameters) {\n    const input = inputs[0];\n    const output = outputs[0];\n    const frames = output[0].length;\n    // In a worklet `sampleRate` is an accessor on the global scope rather than\n    // a variable, so it is read once a block.\n    const contextRate = sampleRate;\n    const mode = clamp(Math.round(parameters.mode[0]), 0, 2);\n    const rate = this.rates[mode] / contextRate;\n    const hiss = parameters.hiss[0];\n    const mixes = parameters.mix;\n    if (!this.settled) {\n      this.settled = true;\n      this.middle = this.middles[mode];\n      this.depth = this.depths[mode];\n      this.rounding = this.roundings[mode];\n    }\n    const knee = this.knee;\n    const kneeDivide = this.kneeDivide;\n    const tilt = this.tilt;\n    const humStep = (2 * MAINS) / contextRate;\n\n    for (let index = 0; index < frames; index += 1) {\n      // A mono source arrives on both sides, and nothing as silence on both.\n      const left = input[0][index];\n      const right = input[1][index];\n\n      // Whether anything is coming in, and the hiss opening or shutting by it.\n      if (Math.abs(left) > QUIET || Math.abs(right) > QUIET) this.quiet = 0;\n      else if (this.quiet < this.linger) this.quiet += 1;\n      this.open =\n        this.quiet < this.linger\n          ? Math.min(1, this.open + this.rise)\n          : Math.max(0, this.open - this.fall);\n      const noise = hiss * this.open;\n\n      // Both lines are handed the two sides as one, through the pair and the\n      // pole before them and rounded as the buckets fill, and what the\n      // rounding leaves off centre is taken off under 5 Hz.\n      let high = 0.5 * (left + right) - this.before2;\n      let band = (this.before1 + knee * high) * kneeDivide;\n      let low = this.before2 + knee * band;\n      this.before1 = 2 * band - this.before1;\n      this.before2 = 2 * low - this.before2;\n      let v = (low - this.beforeTilt) * tilt;\n      const filtered = v + this.beforeTilt;\n      this.beforeTilt = filtered + v;\n      const bent = WIDTH * soft(filtered / WIDTH);\n      this.centred = bent - this.lastBent + this.pole * this.centred;\n      this.lastBent = bent;\n      this.line[this.write] = this.centred;\n\n      // The sweep glides to the setting's, and settles there exactly.\n      this.middle += (this.middles[mode] - this.middle) * this.glide;\n      this.depth += (this.depths[mode] - this.depth) * this.glide;\n      this.rounding += (this.roundings[mode] - this.rounding) * this.glide;\n      if (Math.abs(this.middles[mode] - this.middle) < 1e-12) this.middle = this.middles[mode];\n      if (Math.abs(this.depths[mode] - this.depth) < 1e-12) this.depth = this.depths[mode];\n      if (Math.abs(this.roundings[mode] - this.rounding) < 1e-9) this.rounding = this.roundings[mode];\n\n      // The triangle, from the bottom at nothing to the top half way, and the\n      // sine it is rounded towards, in step with it.\n      const phase = this.phase;\n      const triangle = phase < 0.5 ? 4 * phase - 1 : 3 - 4 * phase;\n      const rounded = this.rounding > 0 ? -Math.cos(2 * Math.PI * phase) : 0;\n      const wave = triangle + this.rounding * (rounded - triangle);\n      // Equal power: half way is the two at one level, and 0.6 the Juno's own,\n      // each line a little under three decibels over the sound beside it; as\n      // loud as what came in, at any mix, wherever the two are unlike.\n      const mix = mixes[index];\n      if (mix !== this.mix) {\n        this.mix = mix;\n        this.dryLevel = Math.cos(mix * (Math.PI / 2));\n        this.wetLevel = Math.sin(mix * (Math.PI / 2));\n      }\n      // The thumps are as big as the sweep is wide beside I's, since a\n      // narrower sweep kicks the clock less far.\n      const kick = THUMP * (this.depth / this.depths[0]);\n      const hum =\n        HUM1 * Math.sin(2 * Math.PI * this.hum) +\n        HUM2 * Math.sin(4 * Math.PI * this.hum) +\n        HUM3 * Math.sin(6 * Math.PI * this.hum);\n\n      for (let side = 0; side < 2; side += 1) {\n        // The second line's movement upside down, each at its own chip's\n        // delay; and where it is in its sweep, from its quickest clock at one\n        // to its slowest at minus one.\n        const sweep = side === 0 ? this.middle + this.depth * wave : this.middle - this.depth * wave;\n        const delay = this.trims[side] * sweep;\n        const quickness = side === 0 ? -wave : wave;\n\n        // The floor and what leaks in. The dice are rolled whether the hiss\n        // is open or not, so the noise is where it would be whichever way the\n        // quiet fell.\n        const white = this.rng.bipolar();\n        v = (white - this.shelved[side]) * this.shelf;\n        const under = v + this.shelved[side];\n        this.shelved[side] = under + v;\n        const floor = FLOOR * (white + LIFT * (white - under));\n        const drip = this.rng.bipolar();\n        v = (drip - this.lowLeak[side]) * this.leakLow;\n        const lows = v + this.lowLeak[side];\n        this.lowLeak[side] = lows + v;\n        v = (drip - lows - this.highLeak[side]) * this.leakHigh;\n        const leaked = v + this.highLeak[side];\n        this.highLeak[side] = leaked + v;\n        const leak = LEAK * Math.exp(RISE * (delay - LONGEST)) * leaked;\n\n        // A thump starts as the line comes into either turn, and runs its\n        // length whatever the sweep does meanwhile, starting again if the\n        // sweep turns back sooner.\n        const intoQuick = quickness > 0.95;\n        if (intoQuick && this.inQuick[side] === 0) this.quick[side] = 0;\n        this.inQuick[side] = intoQuick ? 1 : 0;\n        const intoSlow = quickness < -0.95;\n        if (intoSlow && this.inSlow[side] === 0) this.slow[side] = 0;\n        this.inSlow[side] = intoSlow ? 1 : 0;\n        let quick = 0;\n        if (this.quick[side] >= 0) {\n          quick = kick * thump(this.quick[side] / this.length);\n          this.quick[side] = this.quick[side] + 1 >= this.length ? -1 : this.quick[side] + 1;\n        }\n        let slow = 0;\n        if (this.slow[side] >= 0) {\n          slow = SLOW * kick * thump(this.slow[side] / this.length);\n          this.slow[side] = this.slow[side] + 1 >= this.length ? -1 : this.slow[side] + 1;\n        }\n        // The ring the quick one leaves.\n        this.ringLow[side] += this.ringFrequency * this.ringBand[side];\n        const ringHigh = quick - this.ringLow[side] - this.ringBand[side] / RING_Q;\n        this.ringBand[side] += this.ringFrequency * ringHigh;\n\n        let wet = this.read(delay * contextRate) + noise * (floor + leak + quick - slow);\n\n        // The hold, darker as the clock slows; then the pair and the pole\n        // after it.\n        const clock = STAGES / (2 * delay);\n        const g = Math.tan((Math.PI * Math.min(HOLD * clock, this.ceiling)) / contextRate);\n        v = (wet - this.hold[side]) * (g / (1 + g));\n        wet = v + this.hold[side];\n        this.hold[side] = wet + v;\n        high = wet - this.after2[side];\n        band = (this.after1[side] + knee * high) * kneeDivide;\n        low = this.after2[side] + knee * band;\n        this.after1[side] = 2 * band - this.after1[side];\n        this.after2[side] = 2 * low - this.after2[side];\n        v = (low - this.afterTilt[side]) * tilt;\n        wet = v + this.afterTilt[side];\n        this.afterTilt[side] = wet + v;\n\n        // What the buckets lose to leaking, this chip's own level, and what\n        // reaches the output from beside the line rather than through it.\n        wet *= this.gains[side] * (1 - LOSS * (delay - MIDDLE));\n        wet += noise * (RING_LEVEL * this.ringLow[side] + hum);\n\n        const dry = side === 0 ? left : right;\n        output[side][index] = this.dryLevel * dry + this.wetLevel * wet;\n      }\n\n      this.phase = phase + rate >= 1 ? phase + rate - 1 : phase + rate;\n      this.hum = this.hum + humStep >= 1 ? this.hum + humStep - 1 : this.hum + humStep;\n      this.write = this.write + 1 >= this.size ? 0 : this.write + 1;\n    }\n    return true;\n  }\n}\n",
        "tail": true
      }
    },
    {
      "id": "out",
      "kind": "moduleOutput",
      "options": {
        "output": "out"
      }
    }
  ],
  "connections": [
    {
      "from": {
        "node": "in",
        "output": 0
      },
      "to": {
        "node": "bbd",
        "input": 0
      }
    },
    {
      "from": {
        "node": "bbd",
        "output": 0
      },
      "to": {
        "node": "out",
        "input": 0
      }
    }
  ],
  "automation": [],
  "parameters": [
    {
      "id": "mode",
      "label": "Mode",
      "values": [
        "I",
        "II",
        "I+II"
      ],
      "default": "I",
      "targets": [
        {
          "node": "bbd",
          "param": "mode"
        }
      ]
    },
    {
      "id": "mix",
      "label": "Mix (dry to wet)",
      "range": {
        "min": "0",
        "max": "1"
      },
      "default": "0.6",
      "targets": [
        {
          "node": "bbd",
          "param": "mix"
        }
      ]
    },
    {
      "id": "hiss",
      "label": "Hiss",
      "range": {
        "min": "0",
        "max": "1"
      },
      "default": "0.1",
      "targets": [
        {
          "node": "bbd",
          "param": "hiss"
        }
      ]
    }
  ],
  "sampleSlots": [],
  "createdAt": "2026-10-28T00:00:00.000Z"
}