Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
wavetable.hpp File Reference

Wavetable oscillator with band-switching + bank morphing. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::signal::WavetableEntryT< SampleType >
 One single-cycle wavetable plus the maximum playback frequency it remains bandlimited at. More...
class  pulp::signal::WavetableT< SampleType >
 Wavetable oscillator with band-switching. More...
class  pulp::signal::WavetableBankT< SampleType >
 Linear-interpolated morph across N Wavetables. More...

Namespaces

namespace  pulp
namespace  pulp::signal
namespace  pulp::signal::detail
 Round-2 effect-wave vocabulary.

Typedefs

using pulp::signal::WavetableEntry = WavetableEntryT<float>
using pulp::signal::WavetableEntry64 = WavetableEntryT<double>
using pulp::signal::Wavetable = WavetableT<float>
using pulp::signal::Wavetable64 = WavetableT<double>
using pulp::signal::WavetableBank = WavetableBankT<float>
using pulp::signal::WavetableBank64 = WavetableBankT<double>

Functions

template<typename SampleType>
std::vector< SampleType > pulp::signal::detail::build_wavetable_band_ceilings (std::size_t num_bands, SampleType reference_sample_rate)
 Shared ceiling plan for synthesized and authored wavetable stacks.
template<typename SampleType, typename HarmonicAmp>
std::vector< SampleType > pulp::signal::detail::generate_wavetable (std::size_t length, std::size_t max_harmonic, HarmonicAmp &&harmonic_amp)
template<typename SampleType, typename HarmonicAmp>
std::vector< WavetableEntryT< SampleType > > pulp::signal::detail::build_wavetable_band_stack (std::size_t num_bands, std::size_t table_length, SampleType reference_sample_rate, HarmonicAmp &&harmonic_amp)

Variables

template<typename SampleType>
constexpr SampleType pulp::signal::detail::kWavetableTwoPi

Detailed Description

Wavetable oscillator with band-switching + bank morphing.

Wavetable plays back a stack of single-cycle, pre-bandlimited tables. At each block the table whose Nyquist budget covers the current playback frequency is selected; when the selection changes, the oscillator crossfades between the previous and new table across a short window so the band switch is click-free.

WavetableBank morphs across N Wavetables — useful for "wavetable evolution" patches where a 0..1 position knob sweeps between several base waveforms.

Built-in factories (make_saw, make_square, make_triangle) generate fully bandlimited stacks across the audible range using direct harmonic synthesis: each band caps harmonics so the top harmonic at that band's playback ceiling stays at or below Nyquist (sample_rate / 2). make_sine is the degenerate single-band case.