@audio/ synth-wavetable
Status calibrated
npm1.0.1licenseMIT
Morphing wavetable oscillator — scan a bank of single-cycle tables (WaveEdit class)
Wavetable oscillator with table morphing (tables required)
import wavetable from '@audio/synth-wavetable'
Morphing wavetable oscillator (WaveEdit class): scans a position 0..1 through a bank of single-cycle tables, crossfading between adjacent tables and interpolating within each. tables is a required asset argument (array of single-cycle Float32Arrays) — no default set is bundled, and there's no audio.js manifest since arrays have no params representation for a host; use the kernel directly. Pitched — (freq, opts).
wavetable(220, { tables: [sine, saw, square], position: t => t }) // → Float32Array
| Param | Default | |
|---|---|---|
freq |
— | Hz (positional) |
tables |
— | Required — Float32Array[], single-cycle waveforms |
position |
0 |
0..1, or a function progress => position |
duration |
1 |
Seconds |
amp |
0.8 |
Peak amplitude |
fs |
44100 |
Sample rate |
Use when: morphing timbres over the course of a note — feed it your own table bank (e.g. rendered from synth-osc waveforms, samples, or additive synthesis).
Part of @audio/synth — the synth family umbrella.
MIT © audiojs