faust_min 0.1.0
faust_min: ^0.1.0 copied to clipboard
High-fidelity physical modeling synthesis of a flute, powered by Faust. Lightweight, cross-platform, and high-performance PCM generation.
faust_min #
A high-fidelity physical modeling synthesis plugin for Flutter, powered by Faust.
Why faust_min? #
faust_min was born out of the need for stable, high-fidelity audio synthesis on mobile and desktop platforms. While many Flutter audio plugins rely on sample playback or aging C++ libraries like STK (Synthesis ToolKit), faust_min takes a different approach:
- Industrial-Grade Stability: Legacy C++ audio libraries often suffer from thread-safety issues and
SIGSEGVcrashes when used in a modern, multithreaded environment like Flutter's Dart Isolates.faust_minuses re-entrant, state-isolated code generated by Faust, ensuring 100% stability. - Physical Modeling vs. Samples: Instead of playing back static recordings,
faust_minphysically models the acoustics of an instrument in real-time. This allows for infinitely variable, "human" expressions (like dynamic breath pressure and vibrato) that samples cannot replicate. - Performant Concurrency: Designed to be run inside background isolates without blocking the UI,
faust_minis optimized for modern multicore mobile processors.
Features #
- High-Fidelity Flute: A sophisticated waveguide physical model with non-linear jet simulation.
- Raw PCM Interface: Access the generated audio data directly as a stream of floating-point samples.
- Cross-Platform: Support for Android, iOS, Linux, MacOS, and Windows.
- Low Latency: Highly optimized C++ code generated from Faust DSL.
Getting Started #
Installation #
Add faust_min to your pubspec.yaml:
dependencies:
faust_min: ^0.1.0
Usage #
import 'package:faust_min/faust_min.dart';
// Create a new Flute instance
final flute = FaustFlute(sampleRate: 44100);
// Set physical parameters
flute.setFrequency(440.0); // A4
flute.setBreath(0.8); // Blowing pressure
// Render a buffer of PCM data
final buffer = Float32List(1024);
flute.render(buffer);
// Don't forget to release resources
flute.dispose();
Architecture #
This plugin uses Faust (Functional Audio Stream) to define the DSP logic. The Faust code is compiled to highly efficient C++ and exposed to Dart via FFI (Foreign Function Interface).
License #
This project is licensed under the MIT License - see the LICENSE file for details.