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.

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.2.0-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.2.0-cp314-cp314-macosx_11_0_arm64.whl (34.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

cyfaust_llvm-0.2.0-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.2.0-cp313-cp313-macosx_11_0_arm64.whl (34.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cyfaust_llvm-0.2.0-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.2.0-cp312-cp312-macosx_11_0_arm64.whl (34.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cyfaust_llvm-0.2.0-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.2.0-cp311-cp311-macosx_11_0_arm64.whl (34.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cyfaust_llvm-0.2.0-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.2.0-cp310-cp310-macosx_11_0_arm64.whl (34.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e20a2d05c24ddfc712607d010f26c93fae1b49fe8d2970a313bcb8fc55aa2e47
MD5 66f7dccb6cf40f8ab66693084689c56b
BLAKE2b-256 4239c1eb62990090b51acee6919c9d011a114433460c10735be103382537949f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eaf4149f3e64c40692d378289d9ad0b30e5ab5288637d7f73d615ce09899bffb
MD5 4307c5fc67c0356769c86eafe4d8da40
BLAKE2b-256 3cf666f0c5598685ae200a6c79a5cfc138ad511c6bfee5b2b6290be17a357656

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3f6e403ef9ce92909e8bc4a5cfbf68f78f2649bbca7407acadc2fea07ae83c61
MD5 729ba6bbb99c35a28db8b161a1332bb9
BLAKE2b-256 000b36e4d23f617a31e559c2c2f6264965fbb2156e8defe14d07dc8b2c4791f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ae5c466f6cb6c3997cd191faf13043dd9a787a0a3a10e4d545ac580c7e63da20
MD5 e352cfc1155055d5229c15ebf3693a47
BLAKE2b-256 29f99417a54f86b5f7d28a0abc6f5ec2d6ee3f8f231b932adc6f9ae2304c73f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3c953b7ff9b400d1e2c148dea3ba9fd6bd40f34de540c9e7c278bee5f748f91d
MD5 ad20bdf93b6d4a47ededdc7535cae8bc
BLAKE2b-256 2bda4d58ded77fcbafb5782f0fea20f6c4f593a59a611294f8a6a34954072277

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f55fe050295020bd5de6555e34ddf4fe81e353d64b04e9eb02e52c3a1a53006
MD5 27abec225fccd222e1bcb04ec3cd3599
BLAKE2b-256 d61d0b97de0d0a0f613070631876fa8d35feb65449efdfad4b48e401e4a3d22c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1f9d7a8bda405e0c459dd13c3df627db0e64b68ef1f4e238fd657cc8a97047b2
MD5 36fe07a120b1728c4da67e65aafdacf1
BLAKE2b-256 e226609eab4a2fa75b1f4be90dbe8cc2bd0c941ef2db114b0a90f5ab889de126

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 affe6dbf542181857e090cdb1e44d8490d5c682323ac953b253c5c3d8d685b8c
MD5 20157c3da958fc5c9e7584c1be7dead2
BLAKE2b-256 888353496babe491ee3d8f84a9e4059092a4084efdad5881a619a888f24099d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f2610a351c98c32feaca29c592eda5da4225a59da5ec7670264bbb43bcc1c91e
MD5 0b3d189296f024bd2ca08c2c6fc52669
BLAKE2b-256 7d10a8bf1bb97cfd40de0678c6a30d0983eef00d970b9c21d642d4a173615e75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46b59db4302184536535753e0aafe98a2c9b0ac6a3092993c9279b03c7dafde9
MD5 2a3b229c8bbe41753bcd5d1cd33f4cfd
BLAKE2b-256 11adfdcdc2b369c42effcdc54cf1516b1ac4acd6234d2a7375df4035507b4f37

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

10 files

0.1.4

10 files

0.1.3

10 files

0.1.2

10 files

0.1.1

11 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