Synthlet
Audio Sources

Karplus-Strong

A Karplus-Strong source node

@synthlet/karplus-strong

A (currently) very simple Karplus-Strong source node:

import { registerKarplusStrongWorklet, KarplusStrong } from "synthlet";
 
const audioContext = new AudioContext();
await registerKarplusStrongWorklet(audioContext);
 
const osc = KarplusStrong(audioContext, {});
osc.connect(audioContext.destination);
 
// Trigger the source
osc.trigger.value = 1;

Parameters

  • trigger: A trigger to start the sound (1 means start)
  • frequency: The frequency of the generated sound.
  • decay: The decay time of the generated sound.

On this page