![]() |
Deluge Firmware 1.3.0
Build date: 2026.11.22
|
#include <supersaw.h>
Public Types | |
| using | SidePhases = std::array<uint32_t, kNumSaws - 1> |
| Phases of the side saws. The centre saw's phase is the regular oscillator phase. | |
Static Public Member Functions | |
| static constexpr SidePhases | sidePhasesFrom (uint32_t centrePhase) |
| static constexpr int32_t | numSawsFromPulseWidth (uint32_t pulseWidth) |
| static void | render (int32_t *__restrict__ buffer, int32_t numSamples, uint32_t phaseIncrement, int32_t spread, int32_t numSaws, uint32_t ¢rePhase, SidePhases &sidePhases, bool bandLimit) |
Static Public Attributes | |
| static constexpr size_t | kNumSaws = 7 |
JP-8000 style supersaw: a centre saw plus up to six detuned side saws, band limited with polyBLEP. Spread sets both the detune (quadratically) and the side/centre mix.
|
inlinestaticconstexpr |
Pulse width takes saws away: all of them at zero, down to just the centre saw at full. Negative values (from patching) count the same as positive, as they do for the other oscillators' pulse width.
|
static |
Render, overwriting the buffer, at the same RMS level as a single saw with a peak of 2^29. Writes in blocks of 4, so the buffer must have room for numSamples rounded up to a multiple of 4.
| spread | Bipolar, +-2^30, as the wave index param |
| numSaws | 1 to kNumSaws. Saws are added as the centre, then pairs from the outside in |
| bandLimit | Whether to apply the polyBLEP. Without it the saws alias, but it saves CPU when that's dire |
|
inlinestaticconstexpr |
Side phases spread around the centre phase, so a retriggered supersaw always starts the same way and the saws don't start out in phase with each other. Each is another golden ratio of a cycle on from the last.