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.83.1
  • 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)

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 Distribution

cyfaust-0.1.2.tar.gz (6.0 MB view details)

Uploaded Source

Built Distributions

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

cyfaust-0.1.2-cp314-cp314-win_amd64.whl (5.7 MB view details)

Uploaded CPython 3.14Windows x86-64

cyfaust-0.1.2-cp314-cp314-manylinux_2_39_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

cyfaust-0.1.2-cp314-cp314-macosx_11_0_arm64.whl (6.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

cyfaust-0.1.2-cp313-cp313-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.13Windows x86-64

cyfaust-0.1.2-cp313-cp313-manylinux_2_39_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

cyfaust-0.1.2-cp313-cp313-macosx_11_0_arm64.whl (6.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cyfaust-0.1.2-cp312-cp312-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.12Windows x86-64

cyfaust-0.1.2-cp312-cp312-manylinux_2_39_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

cyfaust-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (6.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cyfaust-0.1.2-cp311-cp311-win_amd64.whl (5.7 MB view details)

Uploaded CPython 3.11Windows x86-64

cyfaust-0.1.2-cp311-cp311-manylinux_2_39_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

cyfaust-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (6.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cyfaust-0.1.2-cp310-cp310-win_amd64.whl (5.7 MB view details)

Uploaded CPython 3.10Windows x86-64

cyfaust-0.1.2-cp310-cp310-manylinux_2_39_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

cyfaust-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (6.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file cyfaust-0.1.2.tar.gz.

File metadata

  • Download URL: cyfaust-0.1.2.tar.gz
  • Upload date:
  • Size: 6.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for cyfaust-0.1.2.tar.gz
Algorithm Hash digest
SHA256 405f2f1b998af81e18900e72393c694de9f3c5899b6c001d731f8ee908ebfb77
MD5 001fee3c39488761e50d1b34383e7b99
BLAKE2b-256 1d1088639f8d57bd62ba027957135d93f325d8d641ada87d2d92ae75138a84a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 5.7 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.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 06aff98ccc1f104bbc9e0e9b771ebb00a3cf9d9aa3f8b498b90676307dd29d04
MD5 14278a6e7b83992a659063749bfe0c1f
BLAKE2b-256 47beb5ba2e2309d8eedfa87bda1e518e618dffaa0dc78f4913969ea380fad951

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a2e5639138d12906baa5f8e8400f1023ca86f8cf8976cf898e378c03644ab253
MD5 c8ac4a03da18ef0a379e341c9d8b29ab
BLAKE2b-256 40af9ea56705852a8f73cfac3007212efaa10a69a8da50a3e44157c1a1b16259

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8dcd97b317cf6ce2de3f005427ca70d928690b5c6f8a07bc618fadd55b9318e9
MD5 88dfb1a1e2e7c138c8a6b1cdbee09543
BLAKE2b-256 665bc4bfc9842389b060db293a651539f313d86d736ca13c261d641a5c33e57f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 5.6 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 918e884bfca0a16645541dfcc49e5abcf5f918592bc41d3c9c4a669014a06440
MD5 102feb150a4f2752917a2c364229ea6b
BLAKE2b-256 b3bfb5df33008709faa9d13998016218964989440434308cc46f5e53fcdf685e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0e94dd7688cfc5734139972f680e4398503bdc8a3504f267f62dfaef5fe00bdd
MD5 921f6d4f321af7710ab812941f320c12
BLAKE2b-256 7704f28785332333d8cfbd0b85c52045b3fda36a7ba6e57c7c90e3bea088bb31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12d9c60938f5016e4f40ffc8e7c539c3f2896f3823b2362d707a5717ae64ef3e
MD5 d1d41708ce1f6895d8fc23e9da3ad9cd
BLAKE2b-256 77c296af24c7734cfb23d7bc77e4b25c6c4ec42bec10f803bc1000589adc8b28

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.6 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c41f5fa985dfa75ccf3a9e1b86e0605ecc54d237cfa1a13bc11a5d838d3654ff
MD5 0f7e01b21c479c9ce926378e9d0ff4b1
BLAKE2b-256 55e133bcf109d3121e11d3bff3cb134cb01f247a9eda4fc954760c6d1d76ebea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 43c517b5d5cd84a0eff6b92220e13b33860f9dbd0bf8b9ceb4157ad339ef1963
MD5 9d7fb118ab7537072813ba5c90e7fac1
BLAKE2b-256 df463acea51f628c842864bd0d131a52d777a20060a56f880467efeacfa75f30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b273579b3af72602a98a66877f13a7a03b597919b1d63fe8d195b8a06ab34fdf
MD5 fb0d63052736d93e8bba0479c97d7449
BLAKE2b-256 1b1348f2f6b768bbc5400198df14d431f101ffa1f482648fbbd9fdcaac07831a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.7 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 697ce8853ecafb1576419912703c23ee4675e6413da27a09d29e6aba0565bb80
MD5 a26e6a30794290286ba01972bacd14ab
BLAKE2b-256 f9f40b5915b9e756f23f68061e0731585b239b1387652948ec7bdfbd9fc61127

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e1b67906cd22544dbef5884fc02a20c6bd4927bc9daa3ba9904b6021364fae37
MD5 761a3747e820706745bf86055bcfe9fa
BLAKE2b-256 c2c8d66c3014ba9727842198297ad535fe0a37fc0ff7da0827c58e03dcb6cf9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00fa479c3f2e01b1bf8b5dd9e8edd9812dffe98294066b4f825ae8e3d9441b5e
MD5 ed0ef5880b33a14f5cfaca07876bfb01
BLAKE2b-256 295f3fd5f1cf11de6ff75b67ec681c8baf277e1cc85ff2fe0d16126faa57380b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cyfaust-0.1.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 5.7 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d7069b74117a07f4c26895f385f508bbc7cb1c24727fabc1d4ea7b1c4a6ef7cc
MD5 209731dddced18a38057669eade86aad
BLAKE2b-256 61302781389ebb9b5f4b817dc8a329f4a3a1a9a434a905a50f3b24b9edac5ada

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 3c7a3f06b902c0d42cf823b974ace2cc01f8a6f353aca194dd51c98a7d88d796
MD5 a2447b1d8cc93a8185d63d41824de939
BLAKE2b-256 ca8a655b4e4596eed46ccee2150c9b7676a7a78c31937e8831fb17d09d4e85f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c0147d7c7f7de0fe7e1116480c6a3e688d34039097076fa7dfa970a6e2649951
MD5 f1abdda378612510694986a5496e0c2f
BLAKE2b-256 33144f165c3cf3ff7863ec78f48e4e5f64401adb59831490c4d828df0234cf02

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