DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
WavetableOscillator.h File Reference

Bandlimited wavetable oscillator with mipmap anti-aliasing. More...

#include "DspMath.h"
#include "AudioSpec.h"
#include "AudioBuffer.h"
#include "Phasor.h"
#include "Interpolation.h"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <vector>
Include dependency graph for WavetableOscillator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  dspark::WavetableOscillator< T >
 Professional mipmapped wavetable oscillator for bandlimited synthesis. More...
 

Namespaces

namespace  dspark
 Main namespace for the DSPark framework.
 

Detailed Description

Bandlimited wavetable oscillator with mipmap anti-aliasing.

A wavetable oscillator using a flattened contiguous memory layout for cache-friendly access, bitwise phase masking, and 3rd-order Hermite interpolation. Fractional mipmapping with a quadratic crossfade prevents aliasing at all frequencies and keeps frequency sweeps timbre-continuous.

Table content is sample-rate independent (each mip level stores a fixed harmonic count); prepare() re-derives the per-level cutoff frequencies, so the build and load methods may be called before or after prepare().

Note
Setup methods (build*, load*) allocate memory and perform heavy mathematical operations (a direct DFT: loadWavetable costs O(size * harmonics)). They MUST NOT be called on the real-time audio thread, nor while the audio thread is generating.

Threading: owner-managed. Setters and generation belong to the owning (audio) thread; build/load/prepare are setup-time.

Dependencies: DspMath.h, AudioSpec.h, AudioBuffer.h, Phasor.h, Interpolation.h.

Definition in file WavetableOscillator.h.