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-0.1.4-cp314-cp314-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.14Windows x86-64

cyfaust-0.1.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

cyfaust-0.1.4-cp314-cp314-macosx_11_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

cyfaust-0.1.4-cp313-cp313-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.13Windows x86-64

cyfaust-0.1.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

cyfaust-0.1.4-cp313-cp313-macosx_11_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cyfaust-0.1.4-cp312-cp312-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.12Windows x86-64

cyfaust-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

cyfaust-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cyfaust-0.1.4-cp311-cp311-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.11Windows x86-64

cyfaust-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

cyfaust-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cyfaust-0.1.4-cp310-cp310-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.10Windows x86-64

cyfaust-0.1.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

cyfaust-0.1.4-cp310-cp310-macosx_11_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file cyfaust-0.1.4-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: cyfaust-0.1.4-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for cyfaust-0.1.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 69e84f47596960c9fe332dff366d43c5c30f56f6e0dbb79988d71ba350cb3d63
MD5 d50da02c744e9f93cfacbc079653710c
BLAKE2b-256 4eab18b7b71178a11708cc2b31c160e1d5468e38b9797e59b81ccd17d9a9f7d1

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5cb24e99648c1ecde0388d239359bcebf1f8d22e6c7ae92609bde435b7a729a3
MD5 688bc276e2fd49a827b2bccee37932d4
BLAKE2b-256 72f4e4ae4794a179f293ab378c383f0a0054c7566190b089387642c6d08077b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f4bce24eccc4575c79bbad8b104dd4ec353689fe68c4645c75cbdaa6efb200d
MD5 8c5bdfca6dfb1fa76a5692be3dd3a76e
BLAKE2b-256 cd22107934910da6228f0895ed76f4c91751f5343389d6275e3d2e32c866e670

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cyfaust-0.1.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for cyfaust-0.1.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 44a8416322c9e1b59964e7d7b3ef15d2ac0b40618c6a39931ad7cd3d4cf111e4
MD5 d2420faf6c598c6cc4598872fbf6fe7c
BLAKE2b-256 342c594745abb2448982368ad1367025704f67597884f9dc33dce8cd714bf22f

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6527e7d7430d37bc0b786a9f066638408e703bb6a35590af70635c33391861a5
MD5 18f145ce207cfe81c51cee8de5ce686f
BLAKE2b-256 0aa34890d981c6649bfa397c5ba69e93b3b4d1db8cff6f63e10bf51141b965a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d5c713cf7ec7075c38db57e859c53858a058ce9b91b023b16bfc9486ef369ebe
MD5 bc34fedda8330c89e5c1dbabd9bceed7
BLAKE2b-256 9132028e77d05a55e3d6b9f222f6d8c15aac4bde299eba9ba63984269ffe5344

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cyfaust-0.1.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for cyfaust-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4cf722e77398d0f4fd0ba1b0522ae1669eb3017f26f92818763430d46ea79660
MD5 2e9e0dfebe2d281a32ebada87ef71197
BLAKE2b-256 8cdc7c116f185b40ccb9e6e743094ac3380581333de754dbbfeec244800663aa

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6f57530d1510ed1b0a3d74e6afe7695944e30d221764c544c571b94d705e3fe6
MD5 7bf3d5905071d7b9398638c7f8ddf8fb
BLAKE2b-256 e32beaee762d2099fad9ef9c8959cda5ce93a4f797d94e024cb20fc09efeccb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b3cfc7f7ef856eb6303596e04f95dcf895f6854b5a8fc37f656218ba4ebcc85
MD5 5751c6c16baa4967b31d57000b2df1a5
BLAKE2b-256 a0a7d96e79a024dee24c806c00a043dececbd18affdcd0380bfda053f7d9a041

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cyfaust-0.1.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for cyfaust-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c0865f3bd07ba65e7aab110d1e47d9926d62081e5128715b9ca674927e66b812
MD5 21d534b24342dd76f4198a32610f6afa
BLAKE2b-256 642e3d2984fffcb604c64d051dc62d71ca74c3c5c87f44815c7bee3e5b350f33

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 485073d0fe085722e0d1ab07eb318009f5d1fd9a9e17305ba594953d1b92df6a
MD5 8691b468b23672d9edc9d0b019e1a1d6
BLAKE2b-256 ed4ad08e1a9dca617a8b7f69616cf94768d6af8c1d5aa198e341c50e9b640931

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 07167c7abfc33205b7c3289a1ff57b53671e489744f836e56edc5646340fa6b2
MD5 d9e24870f64cc6193db35a40f2aecf00
BLAKE2b-256 5b97746d92e388bf04ead0f726501958309b3f5c012282f79235f456deec7aa6

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cyfaust-0.1.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for cyfaust-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9f011396b1af96c5223c8cad91225498eb02bf8fc72438b565c4bcef34e207cf
MD5 6dcf64c98ec9549ef59196f5c20d44e8
BLAKE2b-256 938156ac259dd3b6262822b4fcc3e5a20669bc33f0871804a6a4149976940b40

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0eaef68aa8255c569d51675c33c606d78d796440fce00d1ac5e13bbe10bd51f4
MD5 16ffd3270dca08ef21a0f18bd6ac2379
BLAKE2b-256 f08e98114f248ef68e9ec6d3925835a2e0ba5446fa5292008573c69da1dcc06b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e970da047ca9db3fb1eac6d4340fc413374811684932ca28f55c892a7c02cb5a
MD5 066f7d694f99824ee03ce10e1d986baf
BLAKE2b-256 ea5cffd0beb303b765214db4742bc9d8ed63994e929799d64e53d7dff562f3d5

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