Skip to content
saugns v0.4.5. Added self-PM/"feedback FM". New 'R' mode 'a'.

Language changes:
 * Add `p.a` amplitude feedback parameter for phase,
   for phase self-modulation. Accepts both sweep and
   modulators within `[]`. Default value is 0.0.
 * Signal generator types. `R` mode `m` noise functions:
   - Add `a` (additive recurrence, low-discrepancy a.k.a.
     quasirandom sequence) by default based on the golden
     ratio. Add mode subparameter `m.a` for changing the
     multiplier used to the fractional part of a number.
   - Rename `r` (uniform random, default) to `u`.
   - Seeds for all modes not using the `h` flag now differ.
     Keep the highest bit from the internal 32-bit seed,
     sacrifice the lowest bit (odd vs. even line segment)
     as phase extends a bit to take over its role instead.
 * Numerical expressions. Changes to mathematical functions:
   - Add `arbf(x)`, additive recurrence base frequency.
     Returns a multiplier for how much the pitch will
     change for an `R` instance when `x` is set to `R ma.a`.
     The value may be negative, corresponding to direction
     in a sawtooth-like wave which rises rather than falls.
   - Add `arhf(x)`, additive recurrence higher frequency.
     Like `arbf(x)`, but for the closest new frequency above
     the unshifted base frequency, instead of below it.
   - Add `sgn(x)`, which returns the sign of `x` as +/- 1
     or 0. (The sign bit is also preserved for 0.)
   - Remove deprecated `seed(x)` function replaced by `$seed`.
 * Seedable common parameters. Add `s` common to `N` and `R`,
   for overriding the default seed (assigned to new instances
   based on the `$seed` variable and a random sequence
   derived from it). `s` takes a value modulo 1.0 as the
   percentage of the state space, so `s0` means beginning, 0.

This self-PM support requries, to preserve the performance
when not using the feature, twice as much code for both the
`W` and `R` implementations. Self-modulation typically takes
at least 3 times more CPU time, sometimes more than 4 times.
(Self-modulation precludes use of vectorizing optimations.)

The parameter range uses the simplest scaling possible, like
multiplying the value by pi. This maps 1.0 to Yamaha feedback
level 6 in their chips. To avoid excessive ringing at that
level, stronger filtering than Yamaha used is used: 1-zero
(their choice) combined with 1-pole (itself a little better
at dampening self-oscillations than a 1-zero filter alone).