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.3-cp314-cp314-manylinux_2_39_x86_64.whl (38.6 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

cyfaust_llvm-0.1.3-cp314-cp314-macosx_11_0_arm64.whl (33.9 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

cyfaust_llvm-0.1.3-cp313-cp313-manylinux_2_39_x86_64.whl (38.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

cyfaust_llvm-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl (38.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

cyfaust_llvm-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl (38.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

cyfaust_llvm-0.1.3-cp310-cp310-manylinux_2_39_x86_64.whl (38.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

cyfaust_llvm-0.1.3-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.3-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 bb8e0ceeb8ff2458e536e62cc620c0a94b911cef9a519712e2282c4d2dec0fdb
MD5 5b71da31ffe1e6600d8194410106dd0a
BLAKE2b-256 84c75c713e405ed8f9be8c5e892dd3611a4a4649550654dd4642ecc41ec5ac60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e8af48c7cbe7c9c98695f77beb14553c6ffc035f6a6655e3af084f143663935
MD5 7ee45565849c51dc15470074cb9c8c1f
BLAKE2b-256 dcab5b151ee37c0069733bc9ee07647e5840bfc232138c17d49162d51601ac7f

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.3-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 87c66438876d2ac35cf27ccf8b9712f666a5fb6299cf7fee6b78fb4189a0ea71
MD5 ed2859bdd8ccfacaccb0fa0a9260a081
BLAKE2b-256 e90224ac66c80f4d449f84c5c50140ecaddfb3b9255f20cbf9a937b112a30088

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f0ff8eeb3366c0f0ae2da6a6ffa9a900d7c94152cdc9adaa954f243eaad6d8fc
MD5 120867a1e9d0b7fb45dbb37f5f8bef73
BLAKE2b-256 9af41469898c357ea12f0e8dde71ac973e2ed16808d1b22acc36a4ce3dd5a755

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 623886cf929a9ec61689cf2589d029eef9771f3d86fc2a9a2316e11bbdce83be
MD5 510ed16287101398082bba6f7204b416
BLAKE2b-256 5bb330eeae850ca2e64deec893ac7b9200296de82a4ce29967f8d48416fa8184

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e440c16459212ef41bd9271020c15f44fbaa02c8fa5a378a65e7ddd31530fb5c
MD5 1ec94687a6ad3e09a9ec8bc0d5d13f3b
BLAKE2b-256 064a94788f8d7cec8056cdaa2e7432d3bdf3b74ba18115b15c6db86851248983

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 7baae1ae35c8784946e62fa48b0846e4b2b47ecfb99ca68b3d9e89b3ae8e38ca
MD5 e0dfe75883f597eae9c1a9afa80859f1
BLAKE2b-256 ed094ec0c4133c7f8417646d055bf03a96dea068a62d0903e1e173ce88876404

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0f2798f0543b664ef36f6d955936ddd4e93878c2e427e71a605cd12dc28cc859
MD5 26c852f2a440d64a9270440a8a8f52b2
BLAKE2b-256 ed3f60a551c49cc3948ec4f75a2650d49c9b378083594082120599a0a1c684d1

See more details on using hashes here.

File details

Details for the file cyfaust_llvm-0.1.3-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 131230e17bf1fcd017b5ee01e0065290015c46ce06f3e3b25f9e5ed7e75e357a
MD5 f8b2250f697a8a704fb6ef59167e9ffb
BLAKE2b-256 944da6a167d565e081caf5cc1666dfa466bd2d8608a38f89e7ceebfc7fa33f75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d075144f8912397badb86edaea349b3307d941f068b440927a625fd2463a635
MD5 1070b119fb79a0d40bd07f6e424c4601
BLAKE2b-256 c57ad62ba30656c12ae53a8d8a249485372c09c64b89c86b3dbacbfc99eb4674

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