Synthlet
Modulation Sources
npm package

Param

Control parameters with unit conversion

This module is used to control audio parameters from UI. It provides a way to convert values from different units, and aggregate multiple sources.

import { registerParamWorklet, Param } from "synthlet";
 
const audioContext = new AudioContext();
await registerParamWorklet(audioContext);
const param = Param(audioContext, { input: 10 });

Parameters

  • scale: scale conversion
  • input: the input value
  • min: the minimum value
  • max: the maximum value
  • offset: optional offset

The acceptes values for type are:

  • 0 ParamScaleType.Bypass
  • 1 ParamScaleType.DbToGain
  • 2 ParamScaleType.GainToDb
  • 3 ParamScaleType.Linear: From [0,1] to [min,max]

Other different values will be ignored and bypass will be used.

On this page