sinpwm()

sinpwm(x, width)

Category

Oscillator / Waveshaper

Description

Pulse-width shaped sine oscillator. It keeps a sine-like character but bends the phase/width, giving smoother PWM colors than a square pulse.

Waveform

sinpwm waveform

Example: sinpwm(X,0.5)

Arguments

Typical Values

Width is most useful around 0.05 to 0.95. Avoid exactly 0.0 or 1.0 for sustained tones because very narrow pulses can become silent or clicky.

Example

sinpwm(X, 0.4)

Notes

For pitched oscillator functions, X already contains the current MIDI note pitch and transpose information. Prefer saw(X), sin(X), or pwm(X, 0.4) unless you intentionally want an octave or ratio shift such as 0.5*X or 2*X.