npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@synthlet/virtual-analog-filter

v0.2.0

Published

Virtual analog filters ported from Faust

Readme

@synthlet/virtual-analog-filter

Nine classic analog filter circuits, modelled and switchable

Part of Synthlet.

Where @synthlet/state-variable-filter gives you clean textbook responses, this gives you circuits: the Moog ladder, the Korg 35, the diode ladder and the Oberheim SEM, each with the nonlinearity and the resonance behaviour that make it recognisable. Nine models behind one type parameter.

Install

npm i @synthlet/virtual-analog-filter

Or npm i synthlet for every module at once.

Usage

import {
  registerVirtualAnalogFilterWorklet,
  VirtualAnalogFilter,
} from "@synthlet/virtual-analog-filter";

const ac = new AudioContext();
await registerVirtualAnalogFilterWorklet(ac);

const filter = VirtualAnalogFilter(ac, {
  type: VirtualAnalogFilter.MOOG_LADDER,
  frequency: 900,
  resonance: 0.9,
});

osc.connect(filter).connect(ac.destination);

// a-rate: a smooth sweep, and a 200 Hz modulator is filter FM
lfo.connect(filter.frequency);

Parameters

| Param | Default | Range | Rate | Meaning | | ----------- | ------- | ---------- | ------ | ------------------------------- | | type | 0 | 0 … 8 | k-rate | Which circuit — see below | | frequency | 1000 | 20 … 20000 | a-rate | Cutoff in Hz | | detune | 0 | −127 … 127 | a-rate | Semitones on top of frequency | | resonance | 0.8 | 0 … 1 | a-rate | Resonance |

The nine models are on the factory as constants: VirtualAnalogFilter.MOOG_LADDER (0), MOOG_HALF_LADDER (1), KORG35_LPF (2), KORG35_HPF (3), DIODE_LADDER (4), OBERHEIM_LPF (5), OBERHEIM_HPF (6), OBERHEIM_BPF (7) and OBERHEIM_BSF (8).

frequency, detune and resonance are a-rate, so an envelope or an LFO on the cutoff is a smooth sweep. At one value per render quantum the cutoff was sampled at 344.5 Hz, so anything above 172 Hz folded — a 200 Hz modulator arrived as 144 Hz.

An unmodulated patch does not pay for it. Each model computes its coefficients — a Math.tan, and a Math.pow too in the Korg 35 — at the top of the block, and the filter renders in runs of constant coefficients: one run when nothing is moving, which is exactly what it did before, and 128 when a genuine per-sample sweep needs them. Each channel keeps its own state, so a stereo sweep updates both.

type stays k-rate: it is an index into a bank of nine circuits, and switching it mid-block is a discontinuity rather than a feature.

Every channel of the input is filtered, so a stereo signal stays stereo.

Credits

Generated from the Faust virtual analog filter library (vaeffects.lib): ve.moogLadder by Dario Sanfilippo, and ve.moogHalfLadder, ve.korg35LPF, ve.korg35HPF, ve.diodeLadder and ve.oberheim by Eric Tarr. All are declared under the STK-4.3 licence.

Full notice in LICENSE.md and in the repository's THIRD-PARTY-LICENSES.md.

License

MIT © danigb