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

Uploaded CPython 3.14Windows x86-64

cyfaust-0.1.3-cp314-cp314-manylinux_2_39_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

cyfaust-0.1.3-cp313-cp313-manylinux_2_39_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

cyfaust-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

cyfaust-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

cyfaust-0.1.3-cp310-cp310-manylinux_2_39_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

cyfaust-0.1.3-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.3-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: cyfaust-0.1.3-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 7.1 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.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e188b62a39b0db79cd3f9877b573f7486d542a7fac6fc03c857c9ccb98080011
MD5 853047debfce1b7baabca7627343217f
BLAKE2b-256 b0dcd2adebaa328bb9d679056eb1d0fe5fb9550cff73a2578243e0b49c5d42c7

See more details on using hashes here.

File details

Details for the file cyfaust-0.1.3-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6a68cdbc48276d8b26080d9284d7c941f78d2198a26e54b62046ae12613a5d86
MD5 b6b02f2c2af7d8012f0d79eb241ce6f9
BLAKE2b-256 46f43de1579f371c66d0e0375ae313fb19dbcb650e8b9f4c8d435d0148b00f58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1777c971252e9f87e5f0a954f515a25e10d6065360257c39a491dc894b4f7d2
MD5 ae0c28897e00960281863d4195cc1864
BLAKE2b-256 6fbeaff16349029a0702c2dbc1ac23d4179842851e54715c8c55e504f5adcbfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 93d7e1279fa6868716aaa0243fcc99fa22604bbe42344e997c2f959e73138b2d
MD5 436b5f16a923b72134f5a19f23fb854b
BLAKE2b-256 fc648573d924d23b71afe25af2c3b8af342bb02d4d0c9b2c978665c5a1810642

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 52fa99c204de47cc80d86e11474ff80c72ffa6b780e376257527266739b23caa
MD5 6759d26a036f1cf74ccd5b245a62505f
BLAKE2b-256 b9e1878030b7cef5969279cbf699b537cc311bd813f22a584ff5d3151167ea45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f76a5928901fb068d0fb9385bad32b9b9d680a5f297069c3a1f9746a4019f242
MD5 ce35716be5c721c8c7869e981c5de7ea
BLAKE2b-256 0038a462fa8f62e99416282aec1660eb7c6fee1c9c45533d3c1891f12ea45774

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c9c8ef44e67c2a237ec617afe003e26960ecc78bfb690fae9eedf494a5a612d5
MD5 a5e189c405bf715120df8bc3e53447b2
BLAKE2b-256 7e932a564be41cd312129e0875fa369cb307c0504da00e49d222c1d8688d9480

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c25272653c8a9f31ad802442dc8d1645e7059d222dbc7f14f4ed17fd58a8ac4d
MD5 de49dabd2a76d409fde481f84505f374
BLAKE2b-256 115bfd79e762be669e8b3bfbc69236dee3173a5f111dd399de49fc5ce6df7d40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3867611ac2b9cc4b248201296f3db652c0b9ba48f1314170078e569b9c31739
MD5 5608359b6879b1f01b1ffaaad6671028
BLAKE2b-256 b13c578818a1167449114b8cb09f0e105250f91074f9ffc1f74fd7f119c5596b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8e6f9585d91f26ca809e0d8ebe9138c4d2ab7e2a6fb68f9484acf4774cb932d9
MD5 44a65efcd4a8c26e4a6d779fd7616d5a
BLAKE2b-256 0464f60dc0fa6b9b7fb0daf063bdb6e31a618bb866d6bebd194e41e16e21aa9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a5c9c557c9bbbf682b93908112bb33667d2c5695716ffa0d9b3ecd634b3427f4
MD5 4dea7e2d87eb7594a81f2e5a60e232c5
BLAKE2b-256 98feee91659f17ddbcc16f265ca1cf2d69b4c124727ea9e47bd13ccc59e6c161

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 698f2013c9566f347c0473c2def8f4bc7c713b68f6be360d524cd55314b4e56f
MD5 b7924fecc79037bce3300193dddcec63
BLAKE2b-256 f8429cc4587672ade176c8e66282990cb9e13d15f4dd829f9e6bb128ecd497ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0d7fa3c905d812b9e60f59b1ab0f6c04bd9159d413b6ed592390a198addac601
MD5 6a1e8811e1b26b7d5b244ddfd4a20533
BLAKE2b-256 8d65ae82c00db23c208057d997480bca5bf07f91e5b190a5d1295aaf59209ad7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 9a066364285c583e359d4ac95fbde022678f36e364c324f2fb9cea95b7a305f0
MD5 35e0fc851c02f5334289f28c20c95049
BLAKE2b-256 0e6f4a6ce581600bf212bf5fb4fc130e32a121ad06dfb3a8f3e36210cf5770ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad9d9d1704759213629db454378999f127a5114c3ce37b9f02564c7e54347460
MD5 1be6e5c0941e08ea4b35fdb9a02dd4d7
BLAKE2b-256 6f7449d3cdbbb3cadc29071e61de528db3c2a338246ae308865525ad11262529

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