Synthlet
Audio Sources

PolyBLEP Oscillator

An oscillator module implemened using PolyBLEP algorithm

This module implements a synth oscillator. It's very similar to the native OscillatorNode found in Web Audio API. The difference is the implementation and, therefore, the sound.

The oscillator is implemented using the PolyBLEP algorithm. This algorithm is used to generate band-limited waveforms.

import { PolyblepOscillator } from "synthlet";
 
const osc = PolyblepOscillator(audioContext, {
  type: PolyblepOscillatorType.Sawtooth;
  frequency: 440,
});

Parameters

  • type: A number representing the waveform type. Default is 0 (saw). The available types are:
  • frequency: The frequency of the oscillator in Hz. Default is 440.
  • detune: The detune in cents. Default is 0

Oscillator types are:

  • PolybleopOscillatorType.Sawtooth = 0
  • PolybleopOscillatorType.Square = 1
  • PolybleopOscillatorType.Triangle = 2

References

On this page