Home
Faust and the Web Audio API
The Web Audio API specification describes a high-level JavaScript API for processing and synthesizing audio in web applications. The primary paradigm is of an audio routing graph, where a number of AudioNode objects are connected together to define the overall audio rendering. The actual processing will primarily take place in the underlying implementation (typically optimized Assembly / C / C++ code), but direct JavaScript processing and synthesis is also supported.
The Faust2 branch has been updated with a new JavaScript backend that allows to generate code to be used in this context. New architecture files have been developed to embed this generated code and do Faust audio processing directly in a browser.
Use the following command to generate the JavaScript code :
faust -lang -js foo.dsp
The new webaudio.js architecture file can be used to produce JavaScriptAudioNodes from Faust dsp. For instance :
faust -lang -js -a webaudio.js freeverb.dsp -o freeverb.js
will produce a JavaScriptAudioNode freeverb. Note that each file will define a create_FOO constructor to be used to create the corresponding audio node, like for instance: new create_freeverb(context, ui, meta, buffer_size); to create a freeverb audio node. The constructor expects: the audio context, a UI builder and a Meta builder (see their abstract definition in faustui.js) and the buffer size. You can use :
make jsaudio
target in examples folder to compile all JavaScriptAudioNodes from Faust dsp. Web Audio API html pages can be generated to embed each Faust process. Run :
make webaudio
in examples folder to compile all html pages from Faust dsp.
Faust audio nodes then can also be "combined" directly using the WebAudio API, as demonstrated in webaudio-loader.html architecture file, where a karplus effect is sent in a freeverb.
We have tested with Safari and Chrome an OSX. Note that you'll need a development version of Safari available here. Note also that Chrome JavaScript implementation is *much faster* then Safari/Webkit one. Use Chrome for any "decent" performance.
Because WebAudio API still does not have access to audio inputs, we just allow the user to load a sound file to be processed by the Faust effects (see the Soundfile button at the bottom of the generated page, the loaded file is supposed to be located in the same folder of the html web page)
Note that Chrome cannot access local files for some obscure security reason, so you'll have to open it with the --allow-file-access-from-files parameter, like the following on OSX:
open "/Applications/Google Chrome.app" --args --allow-file-access-from-files
An online example of Karplus can be tested here.
Known issues:
- noise and osc generator still do not work correctly.
- implemented UI elements are : sliders, (but all will be displayed horizontally) buttons and num entries.
- layout is currently quite basic.
Faust-LV2 documentation
Albert Gräf <Dr.Graef@t-online.de>, January 28, 2012
This project provides an LV2 plugin architecture for the Faust programming language. The package contains the Faust architecture and templates for the needed LV2 manifest (ttl) files, a few sample plugins written in Faust, and some generic waf build scripts for compiling the plugins.
faust-lv2 is free and open source software. The latest version of the software can be found at http://faust-lv2.googlecode.com. The pdf version of this document can be found here: http://wiki.faust-lv2.googlecode.com/hg/doc/_build/latex/faust-lv2.pdf
Faust Architecture for LV2 Audio and MIDI Plugins
Albert Gräf (Dept. of Computer Music of Johannes Gutenberg University of Mainz), author of the Pure programming language and several important contributions to Faust, has just released the first Faust architecture for LV2 audio and MIDI plugins. LV2 is the new open-source audio and MIDI plugin standard for Linux and other Unix-like systems, successor of the LADSPA standard. The aim of this architecture is to provide an LV2 implementation which supports both audio (pure signal processing) and instrument (MIDI -> audio) plugins.
http://code.google.com/p/faust-lv2/
Welcome
Welcome to the new Faust website, the web-based audio development platform and its online compiler for the Faust programming language.
This platform will provide you with everything needed to develop real-time audio applications and plug-ins. For instance go to the Online Examples and choose a Faust code from the catalog, then select your audio target and get a ready to run binary code! Feel free to modify the Faust code and recompile it. Then share your best examples with others inside the catalog.
You will find much more on the web site. Read the documentation and check the video tutorials to get started with Faust programming.
Enjoy!




