Skip to content
saugns v0.5.0. Add a set of PD synthesis & PS options.

Language changes:
 * Signal generator types. Add `W` mode toggle. (See below.)
 * Accept phase `p` values directly after `W` and `R` (a
   phase number requires e.g. parentheses around to set it
   apart from a wave or line type). This is mostly a shortcut
   to using phase subparameters (`W.a1/2`) and/or PM (`W[W]`).
 * Accept amplitude `a` values directly after `N` (not only
   after `A` as before); an amplitude number requries e.g.
   parentheses around to set it apart from the noise type.
   This is more for consistency and as a shortcut for AM.
 * Implement phase distortion synthesis, and some forms of
   pulsar synthesis as well. Add a set of phase `p`
   subparameters for this; each is for a distortion function,
   with main and subvalues which can be set, swept, and
   modulated. Used with constant numbers, they derive new wave
   types, e.g. `W.c2` is a sine alternating between on and off
   every other cycle with preserved base frequency.
 * Accept phase `p` subparameters for PD and for self-PM as
   `p[]` list heading subparameters. The main `p` parameter
   doesn't support value sweeps etc., so there was nothing
   else being parsed in such a way. This combines with the
   new support for `p` values right after `R` or `W`.

Implement `R` and `W` PD options, each such subparameter
(including its 2 subparameters) having full value ranges
support.
 * Each PD option under `p` subparameters has in turn:
   - Subfrequency `.f`.
   - Phase offset `.p`.
 * The new duty cycle parameter `p.d` defaults to 1; a
   zoom phase distortion which is the inverse of `p.c`
   and corresponds to "PulWM", implemented through PD.
   Full zoom-out at 0.
 * The new cycle length parameter `p.c` defaults to 1.
   Values closer to 0 "zoom in" -- sawtooth-like edges
   may form. Values larger than 1 "zoom out", with the
   new area filled with a "blank" (the cycle beginning
   and end amplitude).
 * The new hold phase distortion with parameter `p.h`,
   a way to overwrite a portion of a wave cycle. Using
   a positive value draws a horizontal line up to that
   phase position, e.g. 1/4 for the first 1/4; using a
   negative value the line is drawn backward (for -1/4
   over the last 1/4).
 * The new `p.x` and `p.y` parameters allow a PWM-like
   phase distortion, which changes the size proportion
   of the 1st and 2nd halves of a cycle. Use `p.x` for
   "PWM" generalized to any wave type. Meanwhile `p.y`
   is the inverse, a rate-of-change distortion for how
   much phase moves in each half, making one "slower",
   the other "faster".
 * Tweak the `W` oscillator's LFO behavior for ADAA to
   remove overshoots, also fix PD glitches. For 0 Hz a
   prior value was (re-)used instead of a new, causing
   some LF noise with the new zoom-out PD. Instead, in
   case of phase difference at most 1 LUT value large,
   produce a naive sample instead. More glitches fixed
   for extreme PD where one sample pops up or down but
   some issues remain.

Allow use of `W` as a naive oscillator using a new mode `m`
switch. (The `W m` option is similar to `R m`, but simpler,
having only 2 letters for modes as yet.) The default is `a`
(ADAA, antiderivative anti-aliasing) preserving the current
behavior. Using `n` switches to the naive implementation in
the codebase that gives results like pre-v0.3.9 saugns, but
with the current wave types -- not rounded like v0.3.3 had.

Fix default line type for `p.a[]` -- now `lin`, was `cos`.

Major refactoring, mainly of the generator module.