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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@noonesimg/mosfez-faust

v0.0.20

Published

fork of https://www.npmjs.com/package/mosfez-faust with added functionality.

Downloads

2

Readme

mosfez-faust

Fork of https://www.npmjs.com/package/mosfez-faust

Makes dynamic compilation of Faust on the web a little easier, and has a dev project to run values through dsp offline, and preview dsp live. It's an opinionated version of some parts of Faust for webaudio, mostly just the Web Assembly Faust compiler, wrapped up in a library that has:

  • full typescript compatibility
  • ESM exports, so no need to add <script> tags
  • have any async functions chain seamlessly off any prior initialisation steps, so if a required resource is not yet ready, the API function simply waits until it is ready
  • error reporting is more idiomatic for JavaScript - error objects are thrown containing details of the problem when compilation does not work

Note: "opinionated" means this library has a much narrower set of concerns than the original Faust webaudio API it's using. This is mainly just for compilation on the web, playback using AudioWorket nodes, no in-built-polyphonic compilation. Some compilation options may be inaccessible via this API.

Installation

npm install mosfez-faust or yarn add mosfez-faust

Then you'll need to copy the files from node_modules/mosfez-faust/public and put it in your projects public-facing root directory that will be accessible once deployed. e.g. if you are using Vite, put them in your Vite project's public directory. This library will make a request for libfaust-wasm.wasm and libfaust-wasm.data when it starts up, and will not work if those files can't be found.

Usage

import { compile } from "mosfez-faust/faust";
import { touchStart } from "mosfez-faust/touch-start";

const audioContext = new window.AudioContext();
touchStart(audioContext);

async function startSines() {
  const dsp = `
    import("stdfaust.lib");
    process = os.osc(440.0),os.osc(441.0);
  `;

  const node = await compile(audioContext, dsp);
  node.connect(audioContext.destination);
}

Also some general purpose web audio conversion utilities can be found at:

import { * as conversions } from "mosfez-faust/convert";

See source code for details.