Coder Social home page Coder Social logo

shakfu / faustlab Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 2.7 MB

An exploratory project to wrap the faust interpreter via cython, pybind11, etc..

License: The Unlicense

CMake 0.35% Makefile 0.37% Cython 2.40% C++ 90.78% Shell 0.08% Python 0.47% Faust 0.05% C 5.51%
cython faust faust-dsp nanobind pybind11 python

faustlab's Introduction

faustlab

An exploratory project to wrap the Faust interpreter and the RtAudio cross-platform audio driver for use by python code.

Implementation Strategy

To get there, the plan was to experiment with several implementations using different wrapping frameworks (cython, pybind11, and nanobind) which could eventually be compared for code size, binary size, performance, etc.

This led to the current implementation status:

subproject framework api audio test interp api
cyfaust cython c++ yes 95%
cfaust cython c yes 80%
nanofaust nanobind c++ yes 80%
pbfaust pybind11 c++ yes 80%

All of the above implementations pass a minimal functional test which produces audio given a faust dsp file (noise.dsp).

The cyfaust implementation has 'graduated' to its own github project with support for the box and signal api and a more modular package organization and additional tests.

The current thinking is not develop the extensions in this project further and to exclusively focus on refining the cyfaust cpp implementation as the DawDreamer project already has a mature and full featured pybind11-based faust implementation, nanobind still needs a bit of time to mature, and the faust c api feels a bit like a second-class citizen compared to the c++ api

So in summary, this project will not be developed further from now on. You can visit the cyfaust project for further work on the faust interpreter and the [DawDreamer] project for a more practical python faust implementation with with Daw-like features.

Usage

Reequires:

  • cmake (main buildsystem)

  • make (build frontend)

  • python3 with dev libraries installed

Developed and tested only on macOS x86_64 and arm64 for the time being.

  1. ./scripts/setup.sh

    • This will download faust into the build directory, configure it, build it, and install the build into a local prefix inside the build directory/

    • The faust executable, staticlib, headers and stdlib from the newly installed local prefix will be copied into the project directory and and will create (and overwrite) the corresponding files in the bin, include, lib and share folders.

  2. make

    • will build all variants {cython, pybind11, nanobind}
  3. make test will test all of the externals for audio or you can test them individually via:

    make test_cyfaust or

    make test_cfaust or

    make test_pyfaust or

    make test_nanofaust

FAQ

Isn't it redundant to do the same thing four different ways?

Probably, but it proved to be a nice way to learn the faust interpreter api and also learn about the idiosyncracies, strengths and weaknesses of each wrapper framework.

Current focus will be on the cyfaust-c++ implementation.

What else did you learn?

Faust is c++ centric so it's best not to use the c-api if you can avoid it.

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. There's a more recent 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.

faustlab's People

Contributors

shakfu avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.