1 #ifndef __VariableShapeOscillator_h
2 #define __VariableShapeOscillator_h
29 float square =
phase <
pw ? 0 : 1;
31 float sample = saw + (square - saw) *
waveshape;
32 return sample * 2 - 1;
Oscillator with a waveshape that is variable from saw to square, with adjustable pulse width.
static constexpr float end_phase
void setWaveshape(float value)
Set pulse width to a value between 0 (for saw) and 1 (for square)
void setPulseWidth(float value)
Set pulse width to a value between 0 and 1.
static constexpr float begin_phase