Deluge Firmware 1.3.0
Build date: 2026.11.22
Loading...
Searching...
No Matches
deluge::dsp::Supersaw Class Reference

#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 &centrePhase, SidePhases &sidePhases, bool bandLimit)

Static Public Attributes

static constexpr size_t kNumSaws = 7

Detailed Description

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.

Member Function Documentation

◆ numSawsFromPulseWidth()

constexpr int32_t deluge::dsp::Supersaw::numSawsFromPulseWidth ( uint32_t pulseWidth)
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.

◆ render()

void deluge::dsp::Supersaw::render ( int32_t *__restrict__ buffer,
int32_t numSamples,
uint32_t phaseIncrement,
int32_t spread,
int32_t numSaws,
uint32_t & centrePhase,
SidePhases & sidePhases,
bool bandLimit )
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.

Parameters
spreadBipolar, +-2^30, as the wave index param
numSaws1 to kNumSaws. Saws are added as the centre, then pairs from the outside in
bandLimitWhether to apply the polyBLEP. Without it the saws alias, but it saves CPU when that's dire

◆ sidePhasesFrom()

constexpr SidePhases deluge::dsp::Supersaw::sidePhasesFrom ( uint32_t centrePhase)
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.


The documentation for this class was generated from the following files:
  • src/deluge/dsp/oscillators/supersaw.h
  • src/deluge/dsp/oscillators/supersaw.cpp