Remork and on that note, anybody succeeded in using [Vst~] on Bela?
IIRC that hosts vst2 plugins, so you'd need the vst2 SDK which has been discontinued and removed from public availability by Steinberg to force everyone to move to vst3 (see, the importance of free software?). Even having it, you'd then need to rebuild your vst plugin for ARM, which may be a problem, too...
I have used FAUST's limiter before. It's easy to turn FAUST code into a Pd object with faust2puredata
.
For instance:
- install FAUST on your computer
- create a limiter.dsp
file containing:
declare name "limiter";
import("stdfaust.lib");
process = _ : co.limiter_1176_R4_mono : _;
- execute on your computer:
faust2puredata limiter.dsp
This will create a pd external for you computer architecture in the current folder. Move it where Pd can see it and you can start using it on Pd on your computer.
- execute on your computer:
faust2puredata -tosource limiter.dsp
This generates a source .cpp
file that you can use to build it on Bela. It will output a line like this:
faust.zt7cdV/limiter/limiter.cpp
(where the first part will change every time).
- copy that file to Bela:
scp faust.zt7cdV/limiter/limiter.cpp root@bela.local:
- get on Bela and build the file into a Pd external:
clang++ -std=c++11 -O3 -mtune=cortex-a8 -mfloat-abi=hard -ftree-vectorize -ffast-math -I /usr/local/include/libpd/ -fPIC -shared -Dmydsp=limiter -o limiter~.pd_linux limiter.cpp
- move the external to the pd-externals
folder:
mkdir -p /root/Bela/projects/pd-externals
mv limiter~.pd_linux /root/Bela/projects/pd-externals
- now you can use the [limiter~]
object on Bela
FAUST-created objects will have one control inlet and one control outlet (the leftmost ones), all other inlets/outlets are input and output signals of the FAUST dsp.
In this case, this line:
process = _ : co.limiter_1176_R4_mono : _;
means one input _
goes into co.limiter_1176_R4_mono
, whose output goes to one output _
.
So the resulting external will have two inlets, two outlets. The signal inlet/outlet are the rightmost ones. Just connect your to-be-limited signal through those:
[+~]
|
[limiter~]
|
[dac~]
BONUS STEP: add controls
There are no parameters to be changed for this effect. Digging into FAUST's compressors.lib
you'd see that limiter_1176_R4_mono
is declared as:
limiter_1176_R4_mono = compressor_mono(4,-6,0.0008,0.5);
and compressor_mono
's arguments are: compressor_mono(ratio, threshold, attack, release)
So, the object you just built will be a monophonic compressor with ratio 4, threshold -6dB, very short attack time (0.8ms) and lengthy (0.5s) release time.
If you want to adjust those parameters at runtime, you can edit your limiter.dsp
to look like this:
declare name "limiter";
import("stdfaust.lib");
ratio = hslider("ratio", 4, 1, 20, 0.1);
threshold = hslider("threshold", -6, -80, 0, 0.1);
attack = hslider("attack", 0.0008, 0.0001, 1, 0.0001);
release = hslider("release", 0.5, 0.0001, 1, 0.0001);
process = _ : co.compressor_mono(ratio, threshold, attack, release) : _;
hslider
is a FAUST GUI object. It doesn't actually mean you are going to see a GUI on the Pd object, but it's a convenience method to expose parameters. The numbers that follow the "label"
are: initial value, minimum value, max value, step. As the default values are the same as for the the code above will by default generate a limiter with the same parameters as the limiter_1176_R4_mono
, the above code will behave the same as the previous one out of the box. However, you can now change the default parameters.
Repeat the procedure above to rebuild the object on your computer and on Bela (you have to restart Pd on your computer to force it to load the new limiter~
object).
Now if you bang the leftmost inlet and connect a print
on the leftmost outlet you will get something like this in the Pd console:
print: hslider /limiter/attack 0.0008 0.0008 0.0001 1 0.0001
print: hslider /limiter/ratio 4 4 1 20 0.1
print: hslider /limiter/release 0.5 0.5 0.0001 1 0.0001
print: hslider /limiter/threshold -6 -6 -80 0 0.1
that shows you the parameters available internally. Now, you can send a message to the leftmost inlet to change, e.g.: the attack time:
[attack 0.5(
|
[limiter~]
|
[print]
bang
the first inlet again and the dump will have changed:
print: hslider /limiter/attack 0.5 0.0008 0.0001 1 0.0001
print: hslider /limiter/ratio 4 4 1 20 0.1
print: hslider /limiter/release 0.5 0.5 0.0001 1 0.0001
print: hslider /limiter/threshold -6 -6 -80 0 0.1
(note the first value after attack
is now 0.5
.
Hope this helps.