# SIREN distortion and amp plan 2026-10-30. Provisional research design. Listening page: https://fanco16.kissa.dev/v9/drive/ ## The useful addition Add general nonlinear stages to the existing operators, mixers, filters, and 8-line delay network. An amp is a guest recipe that connects these parts. A source selector also leaves room for a future microphone or audio interface. No instrument-specific chip code, and no effects on the browser page. The isolated prototype implements eight mono stages at four times the 48 kHz output rate. Each has two signed inputs, a bass cut, driven nonlinear curve, fixed bias, envelope-dependent gain reduction, treble roll-off, DC rejection, output level, and dry/filter/delay-send routing. Stereo uses paired stages. A stage can split to several consumers. More than two inputs use an extra linear stage. Earlier-index connections use the current 192 kHz sample; self-links and later-index connections use the previous one. Loops are allowed. This is an explicit sampled feedback model, not an algebraic circuit solver. ## What the prototype establishes - Serial gain staging, three parallel driven bands, asymmetric clipping, and envelope-dependent gain recovery use the same small implementation. - Full guest programs perform setup and note automation through normal CPU writes. The host does not sequence notes while rendering. - Existing shared filters and delay effects work with the new stages. - The ordinary `v9/vm.wasm`, sound specification, and live machine stay unchanged. - `v9/wasm/drive.h` is selected only by `v9/drive-build.sh`. - No new dependencies were added. The amp comparison uses a synthesized 24-partial picked-string input. The recipes cover edge, crunch, heavy, and fuzz. Named commercial amp matching needs reference recordings and a matched input; it has not been measured here. Cha Cha Cha's opening bass pattern is MIDI 28, 28, 28, 41, 28, 40, 28, 28, in eighth notes at 155 BPM. The experiment adds upper octaves. Source: Songsterr song 536635, revision 768326, Jytabasso part, transcription attributed by that revision to Evgeny62. The Sandstorm phrase is approximate. Darude's Sound On Sound interview identifies an old dull 8-bit 303-like sample processed with Quadrafuzz and resampled into an ASR-10. It does not establish a Korg source. The saw/high-pulse recipe is a separate synthesis starting point from Syntorial. ## Deep bass-guitar direction The next sound target is a rich, deep bass in the direction of Pink Floyd's "Comfortably Numb": clear pluck, sustained low body, and gentle saturation. The three bass comparisons use the same original B-minor phrase at 79 BPM. Each voice uses 24 additive partials in three independently enveloped bands. The lower eight partials decay slowly; the upper bands disappear sooner. Two alternating voices let a released string decay across the next attack. Six ordinary mixer slots sum into a silent, bypassed shared filter; its output feeds one experimental drive stage. No new chip behavior is needed. Compare clean, warm (9 dB drive, 3.8 kHz low-pass), and round (15 dB drive, 2.2 kHz low-pass). Output levels are guest recipe settings; the page adds no normalization or boost. The phrase is original, and recording-specific tone matching remains a listening task. The page reports measured guest bytes. ## Compactness: count both the window and the recipe | Interface option | Fixed address space | Additional guest recipe storage | | ------------------------------------------- | ------------------: | ------------------------------: | | Prototype: 8 x 16-byte stages | 128 bytes | None for stage descriptors | | Proposed descriptor pointer + count/control | 4 bytes | 16 bytes per stage | | Indexed 16-byte window + selector/control | 18 bytes | Depends on ownership model | The pointer proposal totals 20 bytes for one stage, 68 for four, and 132 for eight. An indexed window saves addresses only if the chip stores persistent parameter records elsewhere; counting that as free would hide guest content. The direct 128-byte map is the easiest prototype. The pointer form is worth trying for programs that need few stages. Neither is yet a final ABI. Curves, cabinet impulses, and amp recipes must also live in guest memory. Working histories, oversampling buffers, and filter state can live in the chip. Do not reduce the visible register count by hiding preset content in the chip. ### Experimental direct map `0580-05FF`, eight stages of 16 bytes. These addresses remain reserved in the ordinary v9 machine. Fields below use decimal offsets and values. | Offset | Meaning | | ------ | -------------------------------------------------------------- | | 0, 1 | Source A, source B | | 2, 3 | Signed input gains / 32 | | 4 | Drive multiplier: 2^(value/24) | | 5 | Signed fixed bias / 64 | | 6 | Curve: 0 linear, 1 soft, 2 cubic, 3 hard clip, 4 triangle fold | | 7 | One-pole input high-pass: 20 x 2^(value/24) Hz; zero bypass | | 8 | One-pole output low-pass: same encoding; zero bypass | | 9 | Envelope-dependent gain reduction / 32 | | 10 | Envelope time constant: 0.001 x 2^(value/24) seconds | | 11 | Output level / 128 | | 12 | Return: 0 internal, 1-3 shared filters, 4 dry stereo bus | | 13 | Existing delay-network send / 255 | | 14 | Signed pan / 127, clipped to -1..1 | | 15 | Bit 0 enables the stage | Drive runs before the curve. The soft curve is x/sqrt(1+x*x). The cubic clamps x to [-1,1], then computes 1.5x - 0.5x^3. Bias is added before the curve and its static output is subtracted afterward. A 20 Hz DC blocker follows the low-pass. Gain reduction uses `drive / (1 + amount * envelope(abs(input)))`. This recovery model uses the same time constant for attack and release. Source IDs in this experiment: | IDs | Source | | ---------- | ---------------------------------------------------- | | 0-15 | Operator outputs | | 16-23 | Filtered noise outputs | | 24-26 | Previous 48 kHz shared-filter outputs | | 32-39 | Stage outputs | | 40, 41, 42 | Dry left, dry right, send before stage contributions | | 48-63 | Raw delay-tap reads from previous history | | 255 | Silence | Other IDs produce zero. Delay reads use the configured base tap position, not operator modulation or an allpass output. This source map conflicts with some existing capture/mixer IDs: unify it before integration. Do not cement a second source namespace into the machine. ## Routing and sound quality Connected stages remain at 192 kHz. External sources enter through a 129-tap Blackman-windowed sinc interpolator; routed outputs use the matching decimator. The nominal cutoff is 18 kHz. Both filters together add approximately 0.67 ms of algorithmic delay, calculated from their group delays. Browser, device, shared-filter, and delay-network latency are additional. Shared filters and the existing delay network still run at 48 kHz. Returning through them crosses the rate boundary; their feedback timing is longer than a stage-to-stage loop. A production graph should expose these timing semantics and group connected nonlinear stages at one rate. Four-times oversampling does not guarantee inaudible aliases at every drive setting. Hard clipping and folding have unlimited harmonic bandwidth. Compare 4x/8x and antiderivative antialiasing on sweeps and two-tone signals before choosing a quality tier. The classic saw/pulse oscillators already alias at 48 kHz; use additive band-limited sources when measuring the nonlinear block. The current stage controls latch at 600 Hz without smoothing. These recordings configure them before the notes start. Before live knobs, add continuous parameter responses and structural crossfades; test rerouting and re-enabling stages, including stale histories. Reuse existing SIREN response semantics. ## Amp development in useful steps 1. **Reference first.** Feed the same dry guitar passage and swept/multitone probes to a reference and SIREN. Compare at matched listening level without changing the delivered output gain. Separate the amp and cabinet where references permit. Include soft notes, chords, hard attacks, and decays. 2. **Curves in guest memory.** A general curve-table descriptor can express asymmetric transfer shapes without amp names in the chip. Compare a small piecewise curve with an analytic family. Count the table bytes. 3. **Memory that matters.** Fixed bias misses charge-related bias excursion. Add a general detector/integrator that can modulate bias and drive, with separate attack and recovery. A shared detector can represent a common supply reacting to several stages. Keep static clipping, bias shift, and supply compression separately measurable. 4. **Tone and feedback.** Add general biquad sections or equivalent filters only where the existing three filters are insufficient. Match tone-stack curves, interstage bass loss, and frequency-dependent feedback. A delayed feedback loop is cheap; a coupled zero-delay solver costs more real-device CPU work and should earn its place in a measured comparison. 5. **Speaker response.** Compare a compact resonant-filter recipe with a guest-supplied impulse response. At 48 kHz, a mono 16-bit 1,024-tap IR costs 2,048 guest bytes and spans 21.3 ms; 2,048 taps cost 4,096 bytes and span 42.7 ms. Those are storage calculations, not a measured fidelity result. 6. **Choose the smallest useful interface after listening.** Keep the controls that make demonstrably different sounds. A compact descriptor can point to optional curve/filter data instead of forcing every stage to carry it. ## Microphone and audio-interface input Proposed flow: browser input transport -> VM input source -> ordinary graph -> VM limiter - Recover the existing capture descriptors first: they currently capture internal SIREN sources into guest RAM. External input should join the common source namespace, not become a parallel effects system. - Request browser permission on an explicit user action, only after the guest requests input. Expose pending, denied, live, and disconnected status. - Request echo cancellation, automatic gain, and noise suppression off for music; read the negotiated settings and report them. A browser can choose different settings, especially on mobile. - Transport mono/stereo input to the VM, resampling the device rate to 48 kHz where needed. Timestamp bounded blocks; expose underruns/overruns instead of silently building latency. Bound the host queue to protect browser memory. - Input selection, gain, and all effects remain general guest controls. No automatic loudness boost. Stop tracks and release permission-held devices when input is disabled or the machine resets. - Begin monitoring muted. Require an explicit monitor action because a microphone and nearby speaker form an acoustic feedback loop. Keep the existing final limiter, but do not treat it as protection from feedback. - Measure actual round-trip latency with a loopback on each real device. Report hardware/input/output buffering separately from calculated DSP delay. No microphone input is implemented by this experiment. ## Verification and next decision The renderer checks finite samples, peak <= 1, nonzero signal, and a silent last 10 ms. It records loaded guest bytes, duration, peak, full-clip RMS, mean DC, and elapsed server render time per audio second in `results.json`. Server timing is a cold single-pass measurement on an aarch64 Neoverse-N1 reported virtual server, including the guest's 60 MHz virtual CPU and SIREN. It is not an iPhone speed measurement. Real-device worst-case trials must run all supported stages, sources, filters, and feedback paths together before setting a machine tier. No subjective listening approval has been recorded. Next decision: listen to the serial/multiband leads and amp recipes, choose which direction merits refinement, then compare the direct map with guest stage descriptors. Keep the live machine unchanged until that choice. ## Sources - https://www.soundonsound.com/techniques/classic-tracks-darude-sandstorm - https://www.syntorial.com/preset-recipe/darude-sandstorm-lead/ - https://www.songsterr.com/a/wsa/kaarija-cha-cha-cha-bass-tab-s536635 - https://robrobinette.com/Tube_Guitar_Amp_Overdrive.htm - Parker, Zavalishin, Le Bivic: Antiderivative Antialiasing for Memoryless Nonlinearities, DAFx 2016: https://dafx.de/paper-archive/2016/dafxpapers/20-DAFx-16_paper_41-PN.pdf