A first example to demonstrate the workflow is a simple MIDI controlled stereo volume control that runs on Core 1.
Here is the Faust code for the MIDI controlled stereo volume. Note that the metadata string “[midi:ctrl 2]” is used to map MIDI continuous controller 2 (CC-2) to control the gain slider.
//--------------------------------------------------------- // Volume control in dB with MIDI control (CC-1, modWheel) //--------------------------------------------------------- import("stdfaust.lib"); gain = vslider("Volume[midi:ctrl 2] [tooltip CC-1]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo; process = _,_: *(gain), *(gain);
The block diagram button can be used to generate a hierarchical block diagram for an algorithm.
This block diagram is hierarchical. Here are a few of the hierarchical levels:
Export/compile to a specific platform
button sam
sam-source-midi
and then Export
:fast_pow2.h
samFaustDSP.cpp
samFaustDSP.h
When you run the project through the debugger, you will be able to control the volume by turning the POT labeled HADC0
.