vite-plugin-faust

Vite plugin to transform Faust DSP files into importable JavaScript (+ WASM) modules. Uses faustwasm under the hood.

Installation

# npm
npm install --save-dev vite-plugin-faust

# yarn
yarn add -D vite-plugin-faust

# pnpm
pnpm add -D vite-plugin-faust

Usage

// vite.config.js
import faust from "vite-plugin-svgr";

export default {
  // ...
  plugins: [faust()],
};

Then DSP files can be imported as modules:

import createReverb from "./Reverb.dsp";

// ...
const reverb = await createReverb(liveAudioContext());
reverb.faustNode; // is an AudioWorkletNode
reverb.dspMeta; // contains a bunch of meta information about this node

If you are using TypeScript, there is also a declaration helper for better type inference. Add the following to vite-env.d.ts (or env.d.ts, or whatever declaration file you chose to use):

/// <reference types="vite-plugin-faust/client" />

Options

None at the moment!

License

MIT