{"id":31306098,"url":"https://github.com/dxinteractive/mosfez-faust","last_synced_at":"2025-09-25T04:09:02.666Z","repository":{"id":41388406,"uuid":"508555780","full_name":"dxinteractive/mosfez-faust","owner":"dxinteractive","description":"Makes Faust nicer to use on the web, and has a dev environment to programatically run values through dsp","archived":false,"fork":false,"pushed_at":"2025-09-23T02:12:40.000Z","size":36149,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-23T04:11:23.308Z","etag":null,"topics":["faust","typescript","webaudio"],"latest_commit_sha":null,"homepage":"https://dxinteractive.github.io/mosfez-faust/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dxinteractive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-06-29T05:17:27.000Z","updated_at":"2025-09-23T02:12:44.000Z","dependencies_parsed_at":"2023-01-30T08:31:30.712Z","dependency_job_id":"08b0cb69-fa13-47e9-a0f5-f089743dc6ee","html_url":"https://github.com/dxinteractive/mosfez-faust","commit_stats":{"total_commits":117,"total_committers":2,"mean_commits":58.5,"dds":0.008547008547008517,"last_synced_commit":"684fe0ef3c4a73ffd67796716138e53747a98586"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dxinteractive/mosfez-faust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxinteractive%2Fmosfez-faust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxinteractive%2Fmosfez-faust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxinteractive%2Fmosfez-faust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxinteractive%2Fmosfez-faust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxinteractive","download_url":"https://codeload.github.com/dxinteractive/mosfez-faust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxinteractive%2Fmosfez-faust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276538267,"owners_count":25659932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faust","typescript","webaudio"],"created_at":"2025-09-25T04:08:58.876Z","updated_at":"2025-09-25T04:09:02.659Z","avatar_url":"https://github.com/dxinteractive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mosfez-faust\n\n[![npm](https://img.shields.io/npm/v/mosfez-faust.svg)](https://www.npmjs.com/package/mosfez-faust) ![Master build](https://github.com/dxinteractive/mosfez-faust/workflows/CI/badge.svg?branch=main)\n\nMakes dynamic compilation of [Faust](https://faust.grame.fr/) 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](https://github.com/grame-cncm/faust/tree/master-dev/architecture/webaudio), mostly just the Web Assembly Faust compiler, wrapped up in a library that has:\n\n- full typescript compatibility\n- ESM exports, so no need to add `\u003cscript\u003e` tags\n- 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\n- error reporting is more idiomatic for JavaScript - error objects are thrown containing details of the problem when compilation does not work\n\n[See the dev project](https://dxinteractive.github.io/mosfez-faust/) - but keep in mind it's intended to be used locally.\n\n**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.\n\n## Installation\n\n`npm install mosfez-faust` or `yarn add mosfez-faust`\n\nThen 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.\n\n## Usage\n\n```js\nimport { compile } from \"mosfez-faust/faust\";\nimport { touchStart } from \"mosfez-faust/touch-start\";\n\nconst audioContext = new window.AudioContext();\ntouchStart(audioContext);\n\nasync function startSines() {\n  const dsp = `\n    import(\"stdfaust.lib\");\n    process = os.osc(440.0),os.osc(441.0);\n  `;\n\n  const node = await compile(audioContext, dsp);\n  node.connect(audioContext.destination);\n}\n```\n\nOr to separately create a factory and worklet nodes:\n\n```js\nimport { compileFactory } from \"mosfez-faust/faust\";\nimport { touchStart } from \"mosfez-faust/touch-start\";\n\nconst audioContext = new window.AudioContext();\ntouchStart(audioContext);\n\nasync function startSines() {\n  const dsp = `\n    import(\"stdfaust.lib\");\n    process = os.osc(440.0),os.osc(441.0);\n  `;\n\n  const factory = await compileFactory(dsp);\n  const node = await factory.createNode(audioContext);\n  node.connect(audioContext.destination);\n}\n```\n\nAlso some general purpose web audio conversion utilities can be found at:\n\n```js\nimport { * as conversions } from \"mosfez-faust/convert\";\n```\n\nSee source code for details.\n\n## The dev project\n\nThe `/dev` directory contains a dev project that uses Vite and allows Faust DSP development in an IDE, while hot realoading and displaying and playing the results of your DSP changes. After cloning the repo, run `yarn prep` then `cd dev`, then `yarn dev` to use the project.\n\nDSP definitions can be added and browsed to. There are two types, `offline` and `live`.\n\n- Offline DSP is compiled on page load or file save, and values specified in the dsp definition are passed through the faust DSP and logged to the console. This makes for a very deliberate DSP development experience, where you can even define your expected output and console messages will indicate if your DSP produces the correct result.\n- Live DSP is compiled on page load or file save, and is immediately started and connected to an audiocontext in the browser so you can hear the result live.\n\n## Developing this library\n\nThis library is written in [typescript](https://www.typescriptlang.org/), using modified code from [Faust's repo](https://github.com/grame-cncm/faust) and wrapping that in a typical typescript library \"wrapper\". It's bundled with `rollup`, formatted with `prettier`, linted with `eslint` and tested with `jest`.\n\nYou will need `node@16` or greater and `yarn@1` installed globally. Clone the repo and run `yarn prep` to install deps and build. Then you can run:\n\n- `yarn build` to build the `*.ts` source files into `*.js` files and `*.d.ts` type files in `/dist`.\n- `yarn test` to run tests using `jest` (none yet).\n- `yarn pretty` to run the auto-formatter `prettier`.\n- `yarn lint` to run the linter `eslint`.\n- `cd dev \u0026\u0026 yarn dev` to run the dev project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxinteractive%2Fmosfez-faust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxinteractive%2Fmosfez-faust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxinteractive%2Fmosfez-faust/lists"}