[][src]Module wavetable::wavetable

A wavetable representing a collection of waveshapes.

A wavetable consists of a collection of waveshapes. Every waveshape in the wavetable itself contains multiple bandlimited tables for use in different octaves. Every octave table is a vector of usually 2048 values representing a single wave cycle.

In memory, the table is stored as a vector of vectors. The inner vector holds the samples of a single wave cycle, with the different octave tables stored as a contiguous piece of memory. The outer vector holds the different waveshapes.

An oscillator using a wavetable then needs three positions to calculate a sample: The wave index, which determines which waveshape table to use, the current octave, which determines the octave table to use, and the position inside the single wave cycle. Both the wave index and the position are float values, which means some interpolation is required to get the final sample.

Structs

Wavetable

Type Definitions

WavetableRef