Faust feedback delay and envelope controlled flanger

Started by Digital Larry, March 29, 2020, 09:14:08 PM

Previous topic - Next topic

Digital Larry

I took a class in Faust last year, then sort of forgot about it, but wanted to get back into it.  I am more interested in designing interesting sounding algorithms than actually building pedals.  I know that makes me a bad person  ;D.  Here's a patch you can use with your laptop and a headset/mic.  If you use the built in mic and speakers, it will feed back.



It's a mono 1 second delay with adjustable feedback, feeding into a flanger with adjustable LFO offset, depth, and speed, along with envelope amount and envelope release time.  As implemented it's an instantaneous attack with adjustable release, however other blocks are available which let you adjust attack and release independently.  The envelope adds onto the LFO sweep, and also I thought that I programmed the envelope to add onto the LFO frequency, but after a certain level of complexity, some of these things become harder to audition.

What's cool is that YOU sitting there at home with your computer and headset mic, can try this RIGHT NOW by visiting:

https://faust.grame.fr/editor/

then copying and pasting the code below into the editor and clicking on the "run" triangle.  Pretty sure it works on Chrome and Firefox.

If you want to see a visualization of a hierarchical block diagram, click on the little "painting" icon on the left side.



Next I will adjust this a bit and copy it to my Linux laptop down by my guitar setup.  Using a USB audio interface for I/O, I can build a "Jack QT" application that will be a block I can use (along with any others I create or find) to make a signal processing chain there.  For that I'm using Ubuntu Studio 19.10 and I compiled the Claudia routing session manager.  I'm using a Behringer 4-channel audio interface but just doing it mono for the time being.  Theoretically I could use all 4 I/O which would be pretty wild.  If I wanted to use MIDI I can map controller messages to sliders.

I can also build it for the Hoxton Owl or make a VST or LV2 plugin for use with a DAW or something like the Mod Duo DSP stompboxes.  That is pretty flipping cool if you ask me.

The only limitation when using with a stompbox is that you have to simplify the UI, which I don't really like to do, at least at this stage when experimenting with what is possible that you usually never encounter.  Supposedly Faust also supports Teensy and I'll see if it will run on the ESP-32 board I have.  I'm somewhat skeptical as it's relatively easy to ask too much of that one.

import("stdfaust.lib");
delay = vslider("[1]Delay", 0.1, 0.05, 1.0, 0.01) : si.smoo;
feedback = vslider("[2]Feedback", 0.1, 0.05, 0.98, 0.01) : si.smoo;
flaDelay = vslider("[3]Flange Dly", 256, 5, 511, 1) : si.smoo;
flaFeedback = vslider("[4]Flange Fb", 0.1, 0, 0.95, 0.01) : si.smoo;
flaLFORate = vslider("[5]Rate", 0.05, 0, 3, 0.01) : si.smoo;
flaLFOWidth = vslider("[6]Width", 0.25, 0, 1.0, 0.01) : si.smoo;
flaEnvRls = vslider("[7]Env Rls", 0.25, 0.1, 0.5, 0.01) : si.smoo;
flaLFOEnv = vslider("[8]Env LFO", 0.1,0,1,0.01): si.smoo;
flaLFO = os.lf_trianglepos(flaLFORate * 1 + flaLFOEnv);
flaMod(env) = flaLFOWidth * (flaLFO + 1 + env) ;
flanger(env,x) = x:pf.flanger_mono(512, flaDelay * flaMod(env), 0.8, flaFeedback, 1);
envMod = an.amp_follower(flaEnvRls) : vbargraph("[0]Env", 0, 1.0);
process = + <: hgroup("Delay", envMod,  ef.echo(1.0, delay, feedback) : flanger);


For a little perspective, the above Faust code generated about 23,000 lines of C++ code, which I'm really glad I did not have to write!

Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer