prep for 1.2.0 release updates

This commit is contained in:
2026-06-21 11:45:58 -07:00
parent 73191c958f
commit 032b7c39d3
286 changed files with 21116 additions and 121 deletions
+172
View File
@@ -10588,3 +10588,175 @@ cleanup + CLAUDE.md rule · 229 polymeter. The Score system now places notes at
explicit/musical beats with rest auto-fill, addresses beats across simple/compound/
additive meters, handles overlaps + multi-voice, and renders mid-piece meter changes,
anacrusis, and polymeter — all MusicXML-export-faithful.
---
## Generator Catalog Expansion — 1.2 (GC group)
Closed the most-noticed UGen gaps relative to SuperCollider, sourced from a full
catalog sweep against the existing built-ins. Gaps clustered in trigger/timing
logic, control-signal conditioning, a few filters, waveshaping/routing, and the
chaotic-oscillator family. `TGrains` and `PingPongDelay` were explicitly excluded
(deferred separately). GC-10 was skipped on license grounds (see below). GC-12
(`Loudness`) remains pending in `docs/00-working-order.md`.
### Phase GC-1 — Trigger / timing primitives ✓ *(merged to main)*
`Generators/Triggers/`. The weakest family vs SC; bread-and-butter of drum
machines, arpeggiators, and gate logic. Trivial state machines on `GeneratorBase`;
per-audio-block trigger state → `_calculatedSamplesBlockRate` bypass (canonical
edge-detect pattern). Audio + Control each.
- **`Trig` / `Trig1`** (SC `Trig`/`Trig1`) — on a rising edge, output `1.0` for
`dur` seconds, then `0`. One-shot pulse stretcher. Distinct from `SendTrigger`.
- **`TriggeredDelay`** (SC `TDelay`) — re-fire a trigger after `dur` seconds.
- **`PulseCount`** (SC `PulseCount`) — count rising edges; optional `reset`.
- **`Stepper`** (SC `Stepper`) — step through `min…max` by `step` on each trigger,
wrapping. Optional `reset`.
- **`Schmidt`** (SC `Schmidt`) — Schmitt trigger with hysteresis band.
### Phase GC-2 — Sync + slew conditioning ✓ *(merged to main)*
- **`Phasor`** (SC `Phasor`) — normalized `[start, end)` phase accumulator with
`freq` + `trig` reset. `Generators/Oscillators/`; shares `OscillatorBase` for
`freq` classification but not the `[-1, 1]` phase normalisation. Audio + Control.
- **`Slew`** (SC `Slew`) — linear rate-limiter (`up`/`dn` units/sec), distinct
algorithm from exponential `Lag`. `Generators/Filters/`. Audio + Control.
### Phase GC-3 — Analysis / tracking primitives ✓ *(merged to main)*
`Generators/Analysis/`. All single-state, trivial.
- **`ZeroCrossing`** (SC `ZeroCrossing`) — zero-crossing rate in Hz. Audio + Control.
- **`Slope`** (SC `Slope`) — per-sample first difference. Audio + Control.
- **`RunningMin` / `RunningMax`** — running extreme with optional `trig` reset.
Audio + Control.
### Phase GC-4 — Routing / morph ✓ *(merged to main)*
- **`Select`** (SC `Select`) — pick one of N input generators by integer index;
inputs classified at `init` (no RT `is`/`as?`). `Generators/Routing/`. Audio + Control.
- **`CrossFade` / `LinearCrossFade`** (SC `XFade2`/`LinXFade2`) — equal-power /
linear crossfade on a `[-1, 1]` `pos`. Audio + Control.
### Phase GC-5 — Waveshaping / distortion ✓ *(merged to main; `Shaper` renamed `Waveshaper`)*
New `Generators/Waveshaping/` subfolder.
- **`Waveshaper`** (SC `Shaper`) — table-lookup waveshaper; `[-1, 1]` input indexes
a `LyrebirdBuffer` transfer curve via the `OscillatorTableReadHelpers` read path.
Audio + Control.
- **`CrossoverDistortion`** (SC `CrossoverDistortion`) — dead-zone distortion.
Audio + Control.
- **`Disintegrator`** (SC `Disintegrator`) — stochastic sample-zeroing via
`xorshift64Next`. Audio.
### Phase GC-6 — Resonant-shape filter + Gaussian LFO ✓ *(merged to main)*
Implemented as the difference of two two-pole Ringz resonators (`Formlet ==
Ringz(decay) − Ringz(attack)`) reusing `runTwoPoleResonatorScalarBlock` /
`…InterpolatedBlock` + `resonatingCoeffs`. `LFGauss` parameterized by `period`
(seconds); bell `out = exp(−0.5·(x/width)²)`, `x = 2·phase − 1`.
- **`Formlet`** (SC `Formlet`) — resonant filter by `attackTime` / `decayTime`.
Audio + Control.
- **`LFGauss`** (SC `LFGauss`) — Gaussian bell oscillator (`period`, `width`,
`phase`). `Generators/Oscillators/`. Audio + Control.
### Phase GC-7 — Chaotic / strange-attractor oscillators ✓ *(merged to main; nine chaotic oscillators on `ChaoticBase`)*
`ChaoticBase` (holds `freq`/`_mulAdd`/`interpolation` + 4-value history ring +
sub-iteration phase accumulator; `iterate()` per map; `stepRate` clamps per-sample
iteration count for RT safety), `ChaoticHelpers` (`chaoticInterpolate`
`.none`/`.linear`/`.cubic` via shared `catmullRomCubic`). Maps iterate at `freq` Hz
(read per block) and bridge iterations by interpolation. New `Generators/Chaotic/`.
- **`LorenzLinear`** (SC `LorenzL`, default `.linear`; default Euler `h` = `0.02`).
- **`HenonStepped`** (SC `HenonN`), **`QuadStepped`** (SC `QuadN`),
**`LinCongStepped`** (SC `LinCongN`, output `[0,m)`), **`GbmanStepped`** (SC `GbmanN`).
- Follow-ons on the same base: `StandardN`/`FBSineN`/`LatoocarfianN`/`CuspN`.
Interpolation-suffix convention: SC `N`/`L`/`C` (non/linear/cubic bridging)
replaced by an explicit Lyrebird name + an `interpolation: TableInterpolation`
parameter where more than one bridging mode is wanted.
### Phase GC-8 — Runtime-respecifiable resonator / partial banks ✓ *(merged to main)*
- **`Klank`** (SC `Klank`) — parallel two-pole resonator bank reading a
`[freq, amp, decay]` spec buffer, plus `freqscale` / `freqoffset` / `decayscale`
modulation; whole spec live-swappable via `setBuffer` (RT-safe `RTBufferSlot`).
Reuses `ResonatorBank`'s vDSP kernel. `Generators/Filters/`. Audio-only.
- **`Klang`** (SC `Klang`) — additive sinusoidal-partial bank summing N table sines
from a `[freq, amp, phase]` spec; `phase` seeds each accumulator at init so live
`setBuffer` retunes keep phase continuity. `Generators/Oscillators/`. Audio-only.
### Phase GC-9 — `Normalizer` ✓ *(merged to main)*
- **`Normalizer`** (SC `Normalizer`) — look-ahead peak normalizer; scans ahead
`dur` seconds, scales **up AND down** to `level` (vs `LookAheadLimiter`, which
only attenuates). Reuses the limiter's pre-allocated delay ring + monotonic
sliding-window-max deque; gain `level / windowPeak` (instant attack, one-pole
smoothed release; silence holds gain). Latency `Int(dur·sr)`. `Generators/Dynamics/`.
Audio-only.
### Phase GC-9B — `Balance` (sc3-plugins JoshUGens) ✓ *(merged to main)*
- **`Balance`** (SC `Balance.ar(in, test, hp = 10)`) — RMS level matcher; scales
`in` so its running RMS tracks reference `test`. Running mean-square via
`onePoleLowPassStep` on `x²` (pole `b1 = exp(-2π·hp/sr)`); `out = in ·
sqrt(ms_test / (ms_in + tiny))`. Gain is a ratio of like-normalised mean-squares
so the one-pole normalisation cancels (matches SC's unnormalised running-sum,
bounded + denormal-safe). Two-input Ring4-style wiring. `Generators/Dynamics/`.
Audio-only.
- Follow-on (`balance-improvements` → `balance-fold-logdomain`): decoupled gain lag
(`smooth`, default `0` = bit-identical to the classic single-pole) decouples
detection speed (`hp`) from gain-change rate; log-domain smoothing (lag
`log10(ms_test/ms_in)` then exp — symmetric perceptual glide) folded into the same
type behind `logDomain: Bool = false` (initially a separate `BalanceDB`, then
merged). Final signature: `Balance(in:test:hp:10, smooth:0, logDomain:false, mul:, add:)`.
### Phase GC-10 — `DFM1` ✗ *(skipped — license incompatible)*
- **`DFM1`** (SC `DFM1`) — digital filter with nonlinear feedback saturation.
**Skipped:** the SC `Dfm1` source (`sc3-plugins/source/TJUGens/Dfm1.cpp`,
Hardie-Bick / Stutters) is **GPL v2+**, and the model *is* a baked 16-octave ×
32-step coefficient LUT (no closed form in the source) — a faithful port would
copy GPL data into the MIT codebase. A clean-room reimplementation of the
topology (two leaky integrators + cubic feedback distortion) is possible but was
de-prioritised in favour of GC-11; revisit only if a clean-room DFM-style filter
is wanted.
### Phase GC-11 — `BeatTrack` ✓ *(merged to main)*
- **`BeatTrack`** (SC `BeatTrack` + `BeatTrack2`, folded into one type) —
real-time tempo + beat-phase tracker. Clean-room (autocorrelation tempo induction
+ log-Gaussian tempo preference + phase locking; **not** a port of the GPL SC
sources). One `BeatTrack.Control` backed by an internal `BeatTrackerCore` (ODF
decimation → whitening → power-of-two ring → weighted autocorrelation → phase
accumulator), emitting 4 control-rate rows: beat / eighth / sixteenth triggers +
tempo (BPM). ODF source is a `BeatTrackODF` flag (mirroring the `Balance`
`logDomain:` fold): `.spectralFlux(analysis:)` computes flux from a paired
`SpectralChain.Audio` (FFT-fed = SC `BeatTrack`); `.feature(_:)` takes an external
onset-detection signal (feature-fed = SC `BeatTrack2`). `Generators/Analysis/`.
Design + algorithm: `docs/stdlib/analysis.md`.
### Phase GC-12 — `Loudness` ✓ *(merged to main)*
- **`Loudness`** (SC `Loudness`) — psychoacoustic loudness meter in **sones** from
a paired analyze-only `SpectralChain.Audio`. Clean-room implementation of the
published Zwicker model and ISO 532 B / DIN 45631 (tables transcribed from the
Apache-2.0 MoSQITo project + the standard) — **not** a port of the GPL SC
`Loudness`. Three fidelity models folded into one `Loudness.Control` behind a
`LoudnessModel` flag (mirroring the `Balance` `logDomain:` / `BeatTrack`
`BeatTrackODF` folds): `.barkEstimate` (Stevens power law over third-octave band
intensities), `.realtimeZwicker(smask:tmask:)` (critical-band Zwicker specific
loudness with spectral-masking constant + temporal-mask one-pole), and
`.iso532b(field:)` (full stationary Zwicker — low-band RAP/DLL correction → LCB
combination → critical-band excitation with LTQ/A0/DDF/DCB → upper-slope
integration). Shared `LoudnessBandCore` does FFT→third-octave (28-band) binning
(precomputed bin→band map) then per-model specific loudness; `LoudnessField`
(free/diffuse) in its own file. Calibration via a `calibrationDB` dBFS→SPL
offset. `Generators/Analysis/`. Control-rate, single-row (sones) output.
Validated against the **1 kHz @ 40 dB SPL = 1 sone** definition anchor (all
models), +10 dB ≈ 2× (Stevens), monotonicity, silence→0, free≠diffuse. Design +
algorithm + tables: `docs/stdlib/analysis.md`. This completes the GC 1.2 group.