Skip to content

API Reference

Architecture

cyfaust architecture

Modules

cyfaust provides Python bindings for the Faust DSP language through the following modules:

Module Description
cyfaust.interp Faust interpreter backend, DSP factory/instance creation, RtAudio driver
cyfaust.box Box API for functional signal composition
cyfaust.signal Signal API for lower-level DSP composition
cyfaust.common Shared utilities (ParamArray, resource paths)
cyfaust.player Sound file player classes

Design

The Box and Signal APIs offer dual interfaces:

  • Functional: Standalone functions like box_int(), sig_input(), box_seq()
  • Object-oriented: Class methods like Box.from_int(), Signal.from_input()

Both interfaces produce identical results. The functional API mirrors the C API naming while the OO API provides a more Pythonic interface.

Context Managers

The Box and Signal APIs require a compilation context. Use the provided context managers:

from cyfaust.box import box_context

with box_context():
    # box operations here
    ...
from cyfaust.signal import signal_context

with signal_context():
    # signal operations here
    ...