// Wavetable synth — crossfade custom Fourier wavetables built with createPeriodicWave. // Run: node examples/wavetable.js organ 220 0.3 6s // Run: node examples/wavetable.js preset=bell freq=220 morph=0.5 -d 6s // Keys: q quit import { AudioContext } from 'web-audio-api' import { init } from './graphs/wavetable.js' import { args, num, sec, keys, clearLine, help } from './utils.js' help({ description: 'crossfade custom PeriodicWave tables between two oscillators', usage: ['', '[preset] [frequency] [morph] [duration]', 'preset=bell freq=220 morph=0.5 dur=6s'], options: [ ['preset=', 'organ, bell, pulse, or voice (default: organ)'], ['freq=', 'fundamental frequency (default: 220)'], ['morph=<0..1>', 'crossfade toward the next preset (default: 0.3)'], ['-d, --duration