Skip to main content

cyfaust

The cyfaust project provides a minimal, modular, self-contained, cross-platform cython wrapper of the Faust DSP language and the RtAudio cross-platform audio driver.

  • Dual Backends: Interpreter (default, ~8MB) or LLVM JIT (~33MB, faster execution)

  • Box API: Fully wrapped with both functional and object-oriented interfaces

  • Signal API: Fully wrapped with both functional and object-oriented interfaces

  • Platform Support: macOS, Linux, and Windows

  • Build Variants: Dynamic (libfaust.so|dylib) and static (libfaust.a|lib)

  • Faust Version: 2.85.9

  • Documentation: cyfaust-docs

Installation

To install cyfaust with the faust interpreter backend (default):

pip install cyfaust

To install with the LLVM JIT backend:

pip install cyfaust-llvm

Features

  • Python-oriented cross-platform implementation of the Faust DSP language

  • Two backend options:

    • Interpreter (default): Compact ~8MB binary, good for development and most use cases

    • LLVM JIT: ~33MB binary with native code compilation for maximum performance

  • Provides the following submodules (in the default build):

    • cyfaust.interp: wraps the faust interpreter and the rtaudio audio driver

    • cyfaust.box: wraps the faust box api

    • cyfaust.signal: wraps the faust signal api

    • cyfaust.common: common utilities and classes

  • Self-contained, minimal, and modular design

  • Can generate code using the following backends: c++, c, rust, codebox

  • Can generate auxiliary files such as SVG block diagrams of DSP

  • Dual functional/OO design for box and signal APIs with minimal code duplication

  • Implements Memoryviews for read/write buffer using numpy or array.array

  • Runtime UI parameter control: enumerate a DSP's controls and get/set their values by full path or label (params(), get_param(), set_param())

  • Both dynamic and static build variants can be packaged as a self-contained python wheel

  • Command-line interface for common operations

Quick Start

from cyfaust.interp import create_dsp_factory_from_string, RtAudioDriver
import time

# Define Faust DSP code
code = """
import("stdfaust.lib");
process = os.osc(440);
"""

# Create factory and DSP instance
factory = create_dsp_factory_from_string("osc", code)
dsp = factory.create_dsp_instance()
dsp.init(48000)

# Play through speakers
driver = RtAudioDriver(48000, 256)
driver.init(dsp)
driver.start()
time.sleep(2)
driver.stop()

Runtime parameters

A DSP's UI controls (sliders, buttons, checkboxes, nentries, bargraphs) can be enumerated and driven at runtime:

from cyfaust.interp import create_dsp_factory_from_string

factory = create_dsp_factory_from_string(
    "gain", 'process = _ * hslider("gain", 1, 0, 2, 0.01);'
)
dsp = factory.create_dsp_instance()
dsp.init(48000)

for p in dsp.params():
    print(p.path, p.kind, p.init, p.min, p.max)  # /gain/gain hslider 1.0 0.0 2.0

dsp.set_param("gain", 0.5)   # address by leaf label or full path; takes effect on the next compute
dsp.get_param("gain")        # 0.5

Buttons, checkboxes, sliders, and nentries are settable inputs; bargraphs are read-only outputs (set_param on one raises ValueError, as do unknown or ambiguous keys).

See the Getting Started guide and Examples for more usage patterns including the Box API, Signal API, buffer computation, and serialization.

Command-Line Interface

cyfaust provides a CLI accessible via the cyfaust command or python -m cyfaust:

cyfaust <command> [options]
Command Description
version Show cyfaust and libfaust version information
info Display DSP metadata, inputs, outputs, and dependencies
compile Compile Faust DSP to target backend (cpp, c, rust, codebox)
expand Expand Faust DSP to self-contained code with all imports resolved
diagram Generate SVG block diagrams
play Play a DSP file with RtAudio
params List DSP parameters, or get/set control values by path/label
validate Check a DSP file for errors
bitcode Save/load compiled DSP as bitcode for faster loading
json Export DSP metadata as JSON

Examples:

cyfaust play osc.dsp -d 5                     # play for 5 seconds
cyfaust compile synth.dsp -b cpp -o synth.cpp  # compile to C++
cyfaust params synth.dsp                       # list parameters (path, kind, range, value)
cyfaust params synth.dsp --get gain            # read a control value
cyfaust params synth.dsp --set gain 0.5        # set a control value
cyfaust json instrument.dsp --pretty           # export metadata
cyfaust validate filter.dsp --strict           # check for errors

See the full CLI Reference for all options.

Building from Source

git clone https://github.com/shakfu/cyfaust.git
cd cyfaust
make        # builds libfaust + installs for development
make test   # run tests

Common build targets:

make                   # dynamic interpreter build (default)
make STATIC=1 build    # static interpreter build
make build-llvm        # static LLVM build
make wheel             # build wheel
make wheel-llvm        # build LLVM wheel (cyfaust-llvm)
make wheel-windows     # Windows one-shot (deps + wheel + delvewheel)

Build options (set via make VAR=1):

Option Default Description
STATIC 0 Build with static libfaust
LLVM 0 Build with LLVM backend (requires STATIC=1)
INCLUDE_SNDFILE 1 Include sndfile support
ALSA 1 ALSA audio (Linux)
PULSE 0 PulseAudio (Linux)
JACK 0 JACK (Linux/macOS)
WASAPI 1 WASAPI (Windows)
ASIO 0 ASIO (Windows)
DSOUND 0 DirectSound (Windows)

Windows

On Windows, use the provided build script:

python scripts/build_windows.py              # static wheel (default)
python scripts/build_windows.py --dynamic    # dynamic wheel (bundles faust.dll)
python scripts/build_windows.py --clean      # clean first, then build
python scripts/build_windows.py --test       # build + install + run tests

If you have GNU Make installed, make wheel-windows also works for dynamic wheels.

Prerequisites: Visual Studio 2022 (or MSVC Build Tools), Python 3.10+, uv, and CMake.

See the full Building from Source guide for platform prerequisites, LLVM backend details, and wheel building instructions.

Platform Support

Interpreter backend (cyfaust):

Platform Architecture Status
macOS arm64 (Apple Silicon) Supported
macOS x86_64 (Intel) Supported
Linux x86_64 Supported
Linux aarch64 Supported
Windows x86_64 Supported

LLVM backend (cyfaust-llvm):

Platform Architecture Status
macOS arm64 (Apple Silicon) Supported
macOS x86_64 (Intel) Supported
Linux x86_64 Supported
Linux aarch64 Supported
Windows x86_64 Planned

Prior Art of Faust + Python

  • DawDreamer by David Braun: Digital Audio Workstation with Python; VST instruments/effects, parameter automation, FAUST, JAX, Warp Markers, and JUCE processors. Full-featured and well-maintained. Use this for actual work! (pybind11)

  • faust_python by Marc Joliet: A Python FAUST wrapper implemented using the CFFI (updated 2015). There's a more recent (updated in 2019) fork by Patrik Lechner. (cffi)

  • pyfaust by Alexandru Stan: Embed Faust DSP Programs in Python. (cffi)

  • faust-ctypes: a port of Marc Joliet's FaustPy from CFFI to Ctypes. (ctypes)

  • faustpp: A post-processor for faust, which enables more flexible code generation.

Metadata

Release files for cyfaust-llvm 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for cyfaust-llvm 0.2.1
File
cyfaust_llvm-0.2.1-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details
cyfaust_llvm-0.2.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
cyfaust_llvm-0.2.1-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details
cyfaust_llvm-0.2.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
cyfaust_llvm-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
cyfaust_llvm-0.2.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
cyfaust_llvm-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details
cyfaust_llvm-0.2.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
cyfaust_llvm-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details
cyfaust_llvm-0.2.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 367.0 MB

Release files / cyfaust_llvm-0.2.1-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL cyfaust_llvm-0.2.1-cp314-cp314-manylinux_2_34_x86_64.whl
Size 38.9 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
87989f21220243b67286f6c1c9a8b29dd665e82ca1f2670a5c0fe5896acc1ddc
BLAKE2b-256 checksum
How to use checksums
8d8fea8ca4b790782155a504111eab92aa36a2a724c93c678d6d48d6411a009e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp314-cp314-macosx_11_0_arm64.whl

Download URL cyfaust_llvm-0.2.1-cp314-cp314-macosx_11_0_arm64.whl
Size 34.5 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5f1f761b723d6d9232397355abebe29cd0bca34afbb414405e4ffd936ed5d1c3
BLAKE2b-256 checksum
How to use checksums
9c65cc116ac5608a7b291c6d8e8f763f0b977eb93183bf29aa94de8bb30589bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL cyfaust_llvm-0.2.1-cp313-cp313-manylinux_2_34_x86_64.whl
Size 38.9 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
80187b17121bb917cf2ea9e8e3ac63ab2bc83f7aef5048941e217a86c6d6abe8
BLAKE2b-256 checksum
How to use checksums
f0eaa32dd73e558d5c9b550035ae17345c102354b98ade15e6d940aa3874cc48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL cyfaust_llvm-0.2.1-cp313-cp313-macosx_11_0_arm64.whl
Size 34.5 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
df5bc032c00f7d3f6387e2daa333c0878f7da2ad7906e4a57da7eeabef0cca4b
BLAKE2b-256 checksum
How to use checksums
f9462cd27a3ad90c53b711c472ac178de13a9f0c55eaa053800b5a3e84cb2ccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL cyfaust_llvm-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl
Size 38.9 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
35051346f495e8d446669be2ad3b74afca522291199edeea5663401be0bc847e
BLAKE2b-256 checksum
How to use checksums
fd35854d663a297a89ce869577cbe3e1d9355df90b22c1c75f055bc82aae5447
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL cyfaust_llvm-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Size 34.5 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6270bdae8deacf0cd6878d1d2c1d705f877f643ae5b9d31888521e88a51b5a27
BLAKE2b-256 checksum
How to use checksums
3485f6e725e3b85cc56ff3e81f614db4bcc40cd52f1acb9cf0ec4e7954d5f960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL cyfaust_llvm-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl
Size 38.9 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
79bad7c4dd8305f0a3cf35fd0523a3debb0e7a83ff2f75ef6611a47d1330ea31
BLAKE2b-256 checksum
How to use checksums
7faed3781665e62ee1a4fe20f061dfeb6b45278429d46d9a53ecff1f7eb270ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL cyfaust_llvm-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Size 34.5 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
190889b6e89eed1aee968effef22cdf533c756924dfb9400dd494a267020bf68
BLAKE2b-256 checksum
How to use checksums
72c87598ad635580774bae2f12ab0c8120b25a5bbf85c2ffc16bfb11b19758fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL cyfaust_llvm-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl
Size 38.9 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
4a6ba10f0e69afa846941ddac7fbe9710c0820e85f79cad24936f6943b588de0
BLAKE2b-256 checksum
How to use checksums
cb860769963f6e540947dcfa05f9909f9208b32515cd23e8455d4c51b372d561
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cyfaust_llvm-0.2.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL cyfaust_llvm-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Size 34.5 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8596fdea48d28b3223f795a39812e31abef7c96e4c0e7df293544a00a6b7281c
BLAKE2b-256 checksum
How to use checksums
5100e35180f87444086b9442b65890d0dd882453be744d3f61f7c7b0e28c59c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

0.2.1 This release

10 release files

0.2.0

10 release files

0.1.4

10 release files

0.1.1

11 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page