Phase distortion: a phase warped before the wave function, the Casio CZ's oscillator and the phase-shaping family #142

Open
opened 2026-10-06 00:33:31 +00:00 by bcox · 0 comments
Owner

bcox asked on 2026-10-05 for a ticket for each family in his gaps.md that has none. Engine claims are from reading the tree at cd68bd3e on main; literature named below is from recollection and was not re-read. Nothing here is built, measured or listened to.

What the tree has

  • Phase is unsigned Q0.32 over one cycle (dsp/phase.h), and Sine(Phase) in dsp/sine.h reads a table from it, so every wave function in the VA oscillator is a function of that word.
  • VaShape is the oscillator's shapes, appended and never reordered, with a comment reserving a wavetable shape (#115). None of them warps the phase before a function.
  • The one place a phase is remapped: VaMorphOrder::kSkewRamp, with VaSkew (a rise and a fall whose sum is the cycle, each with an IncrementReciprocal) and NaiveSkewRaw, computes a piecewise-linear ramp whose peak sits at the morph position. That ramp is output as the waveform itself. Read through Sine instead, it is the CZ's "sawtooth": a two-segment warp, fast then slow, into a cosine, with the knee's position as the DCW amount. So the shape machinery is one lookup short of the instrument, by construction and untried.

What the family is

  • The CZ-101/1000/5000's eight waveforms, each a warp of the phase before a cosine (saw, square, pulse, double sine, saw-pulse, and three "resonance" waves), with the DCW envelope moving the warp from none (a sine) to full (the named wave). The resonance waves are a cosine at a multiple of the phase, restarted each cycle and windowed by the base wave, which is a sync that does not click: a windowed sync by phase remap.
  • Phase-shaping oscillators (Kleimola, Lazzarini, Timoney and Välimäki, DAFx 2010): the CZ's idea generalized to any piecewise map, with band-limited corrections for the slope discontinuities a warp makes.
  • Sync by phase remap: a sync is a phase that restarts; a windowed one is a warp. #124 is sync's own ticket.

Shape and cost

A warp stage ahead of the shape functions: a map from Q0.32 to Q0.32, piecewise linear with two to four breakpoints, the breakpoints as mod destinations, since the DCW envelope is the whole instrument. Per segment one compare and one multiply, before the lookup that exists; NaiveSkewRaw is the two-segment version with its reciprocals precomputed. Cheapest item on gaps.md's list in fabric, as it says, and wholly absent.

Band-limiting is the design question. A warp makes a slope discontinuity, not a step, so the PolyBLEP corrections ShapeSample applies to edges do not apply; the CZ aliased, and the literature's answer is a BLAMP (a band-limited ramp) at each knee. Whether the oscillator's oversample derivation can price the warp from the patch, as it prices every other shape, is the thing to settle first.

Open

  • A stage every shape passes through (sine, triangle, #115's table), or a shape of its own with its own waves.
  • Whether the resonance waves want the windowed-sync form here, or lock plus sync in the matrix, which exist.

#115, #124.

bcox asked on 2026-10-05 for a ticket for each family in his `gaps.md` that has none. Engine claims are from reading the tree at `cd68bd3e` on `main`; literature named below is from recollection and was not re-read. **Nothing here is built, measured or listened to.** ## What the tree has - `Phase` is unsigned Q0.32 over one cycle (`dsp/phase.h`), and `Sine(Phase)` in `dsp/sine.h` reads a table from it, so every wave function in the VA oscillator is a function of that word. - `VaShape` is the oscillator's shapes, appended and never reordered, with a comment reserving a wavetable shape (#115). None of them warps the phase before a function. - The one place a phase is remapped: `VaMorphOrder::kSkewRamp`, with `VaSkew` (a rise and a fall whose sum is the cycle, each with an `IncrementReciprocal`) and `NaiveSkewRaw`, computes a piecewise-linear ramp whose peak sits at the morph position. That ramp is output as the waveform itself. Read through `Sine` instead, it is the CZ's "sawtooth": a two-segment warp, fast then slow, into a cosine, with the knee's position as the DCW amount. So the shape machinery is one lookup short of the instrument, by construction and untried. ## What the family is - **The CZ-101/1000/5000's eight waveforms**, each a warp of the phase before a cosine (saw, square, pulse, double sine, saw-pulse, and three "resonance" waves), with the DCW envelope moving the warp from none (a sine) to full (the named wave). The resonance waves are a cosine at a multiple of the phase, restarted each cycle and windowed by the base wave, which is a sync that does not click: a windowed sync by phase remap. - **Phase-shaping oscillators** (Kleimola, Lazzarini, Timoney and Välimäki, DAFx 2010): the CZ's idea generalized to any piecewise map, with band-limited corrections for the slope discontinuities a warp makes. - **Sync by phase remap**: a sync is a phase that restarts; a windowed one is a warp. #124 is sync's own ticket. ## Shape and cost A warp stage ahead of the shape functions: a map from Q0.32 to Q0.32, piecewise linear with two to four breakpoints, the breakpoints as mod destinations, since the DCW envelope is the whole instrument. Per segment one compare and one multiply, before the lookup that exists; `NaiveSkewRaw` is the two-segment version with its reciprocals precomputed. Cheapest item on `gaps.md`'s list in fabric, as it says, and wholly absent. Band-limiting is the design question. A warp makes a slope discontinuity, not a step, so the PolyBLEP corrections `ShapeSample` applies to edges do not apply; the CZ aliased, and the literature's answer is a BLAMP (a band-limited ramp) at each knee. Whether the oscillator's oversample derivation can price the warp from the patch, as it prices every other shape, is the thing to settle first. ## Open - A stage every shape passes through (sine, triangle, #115's table), or a shape of its own with its own waves. - Whether the resonance waves want the windowed-sync form here, or lock plus sync in the matrix, which exist. ## Related #115, #124.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bcox/tymbal#142
No description provided.