Skip to main content

A Cython wrapper of the Faust interpreter and signal processing library with RtAudio support.

Project description

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.5
  • 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

  • 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()

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 all DSP parameters (sliders, buttons, etc.)
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
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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cyfaust_llvm-0.1.4-cp314-cp314-manylinux_2_34_x86_64.whl (38.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

cyfaust_llvm-0.1.4-cp314-cp314-macosx_11_0_arm64.whl (34.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

cyfaust_llvm-0.1.4-cp313-cp313-manylinux_2_34_x86_64.whl (38.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

cyfaust_llvm-0.1.4-cp313-cp313-macosx_11_0_arm64.whl (33.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cyfaust_llvm-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl (38.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

cyfaust_llvm-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (33.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cyfaust_llvm-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl (38.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

cyfaust_llvm-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (33.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cyfaust_llvm-0.1.4-cp310-cp310-manylinux_2_34_x86_64.whl (38.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

cyfaust_llvm-0.1.4-cp310-cp310-macosx_11_0_arm64.whl (33.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file cyfaust_llvm-0.1.4-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ebeb803c6e017bd43241f94d752ccad2d3035515cb0ab5cd724abc6d91a74ae3
MD5 f0ebe22a53d1ba869ebcbf54a6479227
BLAKE2b-256 d8a731bc072f6700ae1d56c3576394b8fbbee9d0ac240c797e27b5d4eae87910

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df74ebcb9a0f41cdce0957bb312f5a8a7ad24171c0f5fe8579838e3a5b3bf617
MD5 c89ba5a5ad1493bb8af6a2654e620e6c
BLAKE2b-256 78bf356ae5db573f15a0bd911015766d8700cc3e771505f2a39e759e57f95a55

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7411ece628bccff48ccedd993bfbb7eceba3300821dec0c080ebde4a5b391493
MD5 dfd645e26dd86255ffa9291aaba19282
BLAKE2b-256 faa923f514fe4816befe58cb6c354b43554b70ec248ea29d2f41b2c9309526b5

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 74cd9e5eb3ce8e24181c9097eb5aa14e10d08b1944c33abbb034bce5ea2e6d92
MD5 7a3fff7ff7e521766f4dde5810989986
BLAKE2b-256 2b0bf5be1beea34c4e72af9e8090f0d3f3a32e6500c7472d9f857b68ee59bd7a

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d5e292b2b3c5108c276a6991d67da0703ce640abc91d72614b8ef634b021e4ce
MD5 72e365f598c6ecdc85341b69967e4538
BLAKE2b-256 e5bb9a156e329ce8a9dede6c1a19dd8dee6d98a468e0cccd9e5f0bbdf7802a12

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f90fb26c669181fb3f264c6b5069eb406765fc58c155a64f1421d58905e5a2f5
MD5 7f82af3621fef5948547248620680033
BLAKE2b-256 b71d0bc28117523b7dc0712d2978b28808fad55ecacc1b779fe0e57da6d92f5f

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7c9e2c3d4b662c05b089d80968aa6fa7fcc7d6186cb6f24f49d9707de909092c
MD5 ac81e8bc111dfbeb4827a44add3076cf
BLAKE2b-256 9dddc8407573ea6fb27ef07f67db93a3ffa331997fb59f331f25f0b2135a7953

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d05a3c51c3ab12875807a5d915bf28ef39467997c392be8f617ac323657af46
MD5 31b7f4d2e93c173e716ea40d2798b10b
BLAKE2b-256 cc26d03ded110410d69fea8d0658a9f1edb2b5b037d4b0822ae4ca31a761bcf7

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0fa4895b177b63e575c8d8d90a949ac269f39a0c3fdc3ae43e6302f474560c87
MD5 d6f2d3ab8b73b8ca3030cff82c5803df
BLAKE2b-256 933115e1fa148fba017038746c954bd9b266c4b3becdb391901d28dfaa655643

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fdd4519920e309afd5b07c890a2cd4590a57c757ee8f2f6b0265acd513257bdf
MD5 18a975f5ac735caeffe5d006db439567
BLAKE2b-256 6a5ad8c07f1d3e83c817d5cb099adf38392cc52f64d9535501a622e4262fdc95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page