@maruaudio/dsp/oscillators/daisysp-blep holds the band-limited step helpers shared by the three DaisySP oscillator ports, kept in one place so a numeric change cannot split them. They are the polynomial BLEP residuals for the sample of a discontinuity and the sample after it, the integrated-BLEP residuals for slope changes, a sine that takes its phase in turns, and the ports' conditional clamp. Every residual is rounded to f32 at each step.
Functions
| Name | Input | Output | Domain as coded |
|---|---|---|---|
daisyThisBlepSample | t (fraction of a sample since the step) | f32(0.5 t²) | 0 → 0, 1 → 0.5 |
daisyNextBlepSample | t | f32(−0.5 (1 − t)²) | 0 → −0.5, 1 → −0 (negative zero) |
daisyNextIntegratedBlepSample | t | f32(0.1875 − t/2 + 1.5 (t/2)² − (t/2)⁴) | 0 → 0.1875, 1 → 0 |
daisyThisIntegratedBlepSample | t | daisyNextIntegratedBlepSample(1 − t) | 0 → 0, 1 → 0.1875 |
daisySine | phase in turns | f32(sin(2π × phase)) | No wrap; any number |
daisyClamp | value, minimum, maximum | conditional clamp | NaN passes through; reversed bounds return minimum for values below it |
Lifecycle
None. Stateless helpers; the calling oscillator owns every phase and residual accumulator.
When to use it
Writing or extending a port of a DaisySP or Plaits oscillator that must keep the upstream arithmetic. @maru/oscillators-variable-shape, @maru/oscillators-z and @maru/oscillators-formant call it.
Limits
- The residuals assume
tin 0..1; nothing clamps it. daisyClampis not the@maru/math-rangepolicy:value < minimumandvalue > maximumare tested in that order, so NaN is returned unchanged.