@audio/synth-osc
v1.0.4
Published
Oscillator — sine/square/sawtooth/triangle with detune (wraps periodic-function)
Downloads
760
Readme
@audio/synth-osc

Oscillator — periodic-function waveforms (sine/square/saw/triangle), detune, custom wave fn
npm install @audio/synth-oscimport osc from '@audio/synth-osc'Classic waveform oscillator rendered from periodic-function, with cents detune and phase offset. Pitched — (freq, opts), the family generator contract.
osc(440, { type: 'sawtooth', detune: -5 }) // → Float32Array| Param | Default | |
|---|---|---|
| freq | — | Hz (positional) |
| duration | 1 | Seconds |
| type | 'sine' | 'sine' | 'square' | 'sawtooth' | 'triangle' |
| amp | 0.8 | Peak amplitude |
| detune | 0 | Cents |
| phase | 0 | Starting phase, 0..1 |
| wave | — | Custom waveform fn t => v, overrides type |
| fs | 44100 | Sample rate |
Use when: the base oscillator under synth-voice and synth-poly, or any test tone with a classic waveform.
Part of @audio/synth — the synth family umbrella.
MIT © audiojs
