Repository navigation
synths fray algorithms
Working manual · 0.0.1-alpha · source snapshot 16 November 2026
FrayVirtualDAC.hpp contains reusable byte encode/decode, quantization,
missing-code remapping, stuck-low/high and floating pins, inversion, AND/OR/XOR,
signed shifts, rotation, modulo overflow, and probability-gated faults. Pin
faults apply last; stuck-high wins conflicting masks. Random bits are supplied
by the caller's deterministic stream. Optional five-Hz DC compensation is
available to internal consumers through VirtualDAC::convert; normal FRAY
keeps the raw DAC offset and waveform asymmetry as part of its digital character.
Every algorithm's final output passes through the same eight-bit conversion.
No claim of electrical circuit simulation is made.
Algorithms 13–20 generate their own saw byte and independently phased sine byte. Their modulator runs at 0.125–16 times the supplied frequency. They use actual 8-bit logic or modulo arithmetic, with no reference to another oscillator. XOR adds continuous depth and low-bit masks; AND gates low bits; OR merges high bits. BYTE instead switches full-byte AND, OR, XOR, NAND, NOR and XNOR. SHIFT uses the modulator to choose signed shifts, ROT8 selects rotations, MASK selects complementary masks by threshold, and CARRY performs wrapped addition with a separate missing-carry fault.
The following order is the public contract. All entries contain functional mechanisms; none dispatches to a placeholder oscillator. The same descriptions and per-algorithm defaults are available as UI-independent C++ metadata.
| ID | Name / mechanism | SHP | CLR | GHO |
|---|---|---|---|---|
| 01 | DCO — Phase-aligned mathematical waveform interpolation | Waveform interpolation | Harmonic curvature and brightness | DAC quantisation, floating pins, drift and phase jitter |
| 02 | PWM — Asymmetric trapezoidal pulse oscillator | Pulse width | Independent edge geometry | Pulse threshold timing errors |
| 03 | FOLD — Repeated triangular folding of a sine | Fold amount | Fold symmetry bias | Fold-boundary quantisation |
| 04 | PDST — Piecewise phase warp and windowed resonance | Phase warp | Virtual resonance | Quantised phase addresses |
| 05 | SYNC — Master-relative slave reset | Slave frequency ratio | Slave sine to saw | Reset-address timing jitter |
| 06 | FM2 — Independent sine modulator drives carrier phase | Modulation index | Modulator frequency ratio | Quantised phase arithmetic |
| 07 | LUT8 — Byte-quantised shared table reads with frame morphing | Table selection and morph | Resolution and interpolation | Address-line corruption |
| 08 | DIV — Master pulse mixed with a divided clock | Integer division ratio | Master/divider mixture | Divider clock instability |
| 09 | POLY — Clocked 16-bit feedback register | Feedback polynomial taps | Clock multiple | Register bitstream faults |
| 10 | SID — Original bitwise saw, triangle and pulse coupling | Waveform combination | Coupling and pulse width | Combined-wave leakage |
| 11 | TOY — Quantised divider waveform with nasal partials | Divider and waveform | Odd harmonic emphasis | Divider clock instability |
| 12 | ALIS — Held high-harmonic ramp at a reduced clock | Source harmonic multiple | Internal sample period | Read-address foldback instability |
| 13 | XOR — Two internal byte sources with masked XOR depth | Modulator ratio | Low-bit mask and wet depth | Logic address jitter |
| 14 | AND — Two internal byte sources with low-bit gating | Modulator ratio | Low-bit active mask | Intermittent stuck-low bits |
| 15 | OR — Two internal byte sources with high-bit merging | Modulator ratio | High-bit active mask | Intermittent stuck-high bits |
| 16 | SHIFT — Internal sine byte selects signed shifts of a ramp | Modulator ratio | Shift range and direction | Wrapped addition and dropped bits |
| 17 | ROT8 — Internal sine byte rotates a ramp byte | Modulator ratio | Rotation range | Rotation address jitter |
| 18 | MASK — Thresholded internal sine selects complementary masks | Mask oscillator ratio | Threshold and mask selection | Intermittent mask corruption |
| 19 | CARRY — Modulo-256 addition of two internal generators | Modulator ratio | Arithmetic operand depth | Lost nibble carry propagation |
| 20 | BYTE — AND, OR, XOR, NAND, NOR and XNOR of internal bytes | Modulator ratio | Boolean operation | Intermittent operation corruption |
| 21 | CHAO — Clocked logistic map with damped output | Chaos coefficient | Feedback damping | Numerical perturbations |
| 22 | SUBH — Fundamental plus adjacent subharmonic sine clocks | Subharmonic interval | Partial balance | Independent divider drift |
| 23 | FORM — Cycle-synchronous windowed sinusoid | Formant position | Formant bandwidth | Stepped formant ratio |
| 24 | BELL — Six independently phased inharmonic sine partials | Partial ratios | Spectral density | Partial frequency perturbation |
| 25 | COMB — Driven fractional delay with damped feedback | Delay tuning ratio | Feedback damping | Delay length quantisation |
| 26 | RECR — Driven saturating recursive map with modular feedback | Recursive coefficient | Feedback character | Precision loss and controlled overflow |
| 27 | JITR — Waveform swiper read with coloured phase jitter | Base waveform | Jitter bandwidth and curvature | Phase jitter depth |
| 28 | GLCH — Windowed sample-latch and address failures | Waveform and glitch window | Glitch density and curvature | Latch failure probability and displacement |
| 29 | BITR — Byte waveform with selected intermittent bit inversion | Source waveform | Target bit | Corruption probability |
| 30 | GHOST — Carrier, internal ring product and feedback leakage | Internal oscillator ratio | Spectral interference | Detuning, feedback and ghost-signal presence |
Ghost zero disables faults, not the inherent aliasing, quantization or unusual spectrum of a digital algorithm. BITR's colour selects the faulty pin, so it has no effect with Ghost zero. Random perturbations act on phase addressing, clock increments, register state, logic, arithmetic, delay length or recursive precision as appropriate, rather than adding one common noise effect.
- Deliberate raw digital synthesis: no general anti-aliasing or oversampling. High notes, FM, sync, folding and bitwise modes produce foldback.
- DIV/SUBH produce divided pitches; POLY/CHAO are clock-related textures. Inharmonic and resonant modes do not promise the supplied frequency as their sole or strongest spectral peak. DCO tuning is directly measured in tests.
- SID and TOY are original inspired mechanisms, not hardware emulators. BELL is a sustained six-partial oscillator, not a struck envelope/instrument.
- COMB's fractional delay is bounded to 2–1022 samples (about 21.3 ms at 48 kHz). Tuning outside that range saturates; it is a short driven resonator, not a full-range physical string model. Feedback gain stays below one.
- RECR uses a bounded saturating map and optional signed wrap, not a hardware floating-point fault emulator. CHAO uses a bounded clocked logistic map.
- Algorithm switching uses a short transition from the held last sample; large musical changes or fast repeated switches may still be audible.
- State costs 4296 bytes per instance on this x64 build, predominantly COMB's fixed 4096-byte buffer. The shared default bank is approximately 400 KiB and can be reused from the existing engine. Smaller existing banks are supported.
- Physical H700 timing and listening validation remain outstanding. Desktop benchmark numbers are not handheld CPU measurements or whole-engine capacity.
| Documentation still to add |
|---|
| Annotated current-build screenshots and a recorded controller walkthrough for this topic. |
Repository sources used for this page:
docs/fray.md
This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.