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

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

cyfaust_llvm-0.1.2-cp314-cp314-macosx_11_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

cyfaust_llvm-0.1.2-cp313-cp313-manylinux_2_39_x86_64.whl (37.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

cyfaust_llvm-0.1.2-cp313-cp313-macosx_11_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cyfaust_llvm-0.1.2-cp312-cp312-manylinux_2_39_x86_64.whl (37.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

cyfaust_llvm-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cyfaust_llvm-0.1.2-cp311-cp311-manylinux_2_39_x86_64.whl (37.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

cyfaust_llvm-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cyfaust_llvm-0.1.2-cp310-cp310-manylinux_2_39_x86_64.whl (37.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

cyfaust_llvm-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0e3a705d91b767f228f6ab5888874a71167074408ea0edaffccb97d0d0db22a5
MD5 3511f0232a786543bf0b752e9b93815f
BLAKE2b-256 a02099b84cd309c022b1496ae2b7fdfd722aacb5d5a09ad22358cea17dd80081

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 974e534c3afb5fa8a632d415d3b1f044a8e06593d82348b95beecd3bdc7f1fd5
MD5 e0f18f4e729aebb777a02d026ff01da2
BLAKE2b-256 014129893cdb0e120d17fbe8c6b9bd9871573661b7d91017890fd5f30f7c98ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 97103f0e05315d2c455d4c45589544afa4ebf640bb47c546b5463f0c025436ca
MD5 955ffe88b357139a2d34174b7598fb59
BLAKE2b-256 697fa489515250b1aae1b94707b28c803ce1f80c7ddca749a1dc180c0b5d7c0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6575e3f73129c896e6a82ed1ae648ffbdd4e389caa6aa29c337352e9b78eae3f
MD5 88c38199143ad6abbdbcb2a89d9df6f0
BLAKE2b-256 a4292ee965cdbd4f77dbed685580cbd58a867cb77dc62b3ef6bb5b866f6e4dd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 5c98a12cc2bd234671076470a301516fbbefa8f3a8c0895b45fc3aeb739dbfb8
MD5 887645962613da3cdaced80fe9685493
BLAKE2b-256 1f6be5226378c2849eefbbaedcb96c4d3ee291f813cef9e94ef590d0bea634b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e02e3fc277a82155acebfb6c716c2dec15675f9e38abc23cf04b271cb151fd12
MD5 6412b31abe3afa4964f46ac42f75e7f8
BLAKE2b-256 1154853e12a5f71daa4e6a16ac66e70eed0280777e1ecc61e35ec843d728cbac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 50fad0a3392eb707b44ccc46e6c19523638d900093f095292ff3f0c4b08ce7b9
MD5 f23ae87c3c8c638b82f3d028ab67cf67
BLAKE2b-256 2edfe42a7dbb82d3e37070c7bf9fb1ee1c75160968a37b60a64a1220fe0bb563

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ecafce8bc07135d2d0389880ca8a6b991f8c9bd77ef2f827f8a8a0d41d4faa39
MD5 800825838eaddeade5c2a38d04b3f052
BLAKE2b-256 9e807faf9f491c2b6aece21364a92545004202b21f180bb29674b10ba68a6c35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 7245e4f92ba859e99d11f81c2aaa3cbf758a8b8dbf5c17336c9f5234164d0224
MD5 829c967a6505f3ec70789f95e999453b
BLAKE2b-256 5a1f3893fe6690a03ab1a32e1c104b2dcf50e3a3177da48415aec96c5d3ab488

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cyfaust_llvm-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4186ce5dac4410c6f5555f983d5b2d127090fa576d13ff5b3de1cdc40bb8c8d2
MD5 7df4b58283e8dec68824580550be35ed
BLAKE2b-256 773896f6ea54f8755fd0bce9ce71e67ac39abe37477ccc47adf4b53755f190c4

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