Faust is here...
-
much excite :)
-
So as a little teaser that goes beyond hello world: here's a little snippet that includes a much much much better sounding reverb than the stock JUCE / HISE reverb:
// Faust Source File: reverbtest // Created with HISE on 2022-10-12 import("stdfaust.lib"); // approximate reverberation time in seconds ([0.1..60] sec) (T60 - the time for the reverb to decay by 60db when damp == 0 ). Does not effect early reflections t60 = hslider("ReverbTime", 4.2, 0.1, 12, 0.1); // controls damping of high-frequencies as the reverb decays. 0 is no damping, 1 is very strong damping. Values should be between ([0..1]) damp = hslider("Damping", 0.5, 0.0, 1.0, 0.01); // scales size of delay-lines within the reverberator, producing the impression of a larger or smaller space. Values below 1 can sound metallic. Values should be between [0.5..5] size = hslider("Size", 3.5, 0.5, 5.0, 0.01); // controls shape of early reflections. Values of 0.707 or more produce smooth exponential decay. Lower values produce a slower build-up of echoes. Values should be between ([0..1]) early_diff = hslider("Diffusion", 0.707, 0.0, 1.0, 0.01); // depth ([0..1]) of delay-line modulation. Use in combination with mod_freq to set amount of chorusing within the structure mod_depth = hslider("Mod Depth", 0.1, 0.0, 1.0, 0.01); // frequency ([0..10] Hz) of delay-line modulation. Use in combination with modDepth to set amount of chorusing within the structure mod_freq = hslider("Mod Frequency", 0.1, 0.0, 10.0, 0.01); // multiplier ([0..1]) for the reverberation time within the low band low = hslider("LF Gain", 1.0, 0.0, 1.0, 0.01); mid = 1.0; // multiplier ([0..1]) for the reverberation time within the mid band // multiplier ([0..1]) for the reverberation time within the high band high = hslider("HF Gain", 1.0, 0.0, 1.0, 0.01); lowcut = 600;// frequency (100..6000 Hz) at which the crossover between the low and mid bands of the reverb occurs highcut = 5000; // frequency (1000..10000 Hz) at which the crossover between the mid and high bands of the reverb process = re.jpverb(t60, damp, size, early_diff, mod_depth, mod_freq, low, mid, high, lowcut, highcut);
There's absolutely no IP from my side involved here, I'm just wrapping an existing reverb from the library (and there are plenty of other reverbs / delays that can be imported without too much knowledge of the faust language).
https://faustlibraries.grame.fr/
Just be careful about the license of those effects, not all of them are permissively licensed and some can only be used under the GPL license (this particular one should be fine as it's MIT licensed if I read the license header correctly).
So where does this leave SNEX?
SNEX is here to stay and I still think it has a reason of existence as a gateway drug into C++ and more simple tasks (using the ThirdParty code C++ API is pretty much the same as writing SNEX code). Also the integration with HISE is more tight than with Faust (at least at the moment) so Faust is just a (really powerful) addition to the arsenal of tools in HISE.
-
Amazing
You guys rock οΈοΈοΈοΈοΈ @Christoph-Hart @etXzat -
Great job @Christoph-Hart @sletz @etXzat !!! Thank you very much for all the effort!
-
@Christoph-Hart just tried building on osx and this popped up and failed:
-
@DanH Have you installed faust and setup the include directories like described in the build instructions?
-
@Christoph-Hart oops - do I need to do that even if I don't want to use faust right now?
-
@DanH actually no that was an oversight - the idea is that there is absolutely no overhead unless you want to use Faust, then you're in a world of pain setting up all those include paths :)
Try again, it should now build without faust.
-
@Christoph-Hart thanks!
-
@Christoph-Hart OMG this is awesome. Thanks Christoph
-
@Christoph-Hart This is crazy !
-
@etXzat and @Christoph-Hart did most of the hard work of "inside HISE" integration and they have to be thanked for that.
On the Faust side, the project adds to the existing ecosystem (https://faust.grame.fr/community/made-with-faust/) and we are quite happy with that :beaming_face_with_smiling_eyes:
@etXzat or @Christoph-Hart do you have a nice screenshot we could add on the https://faust.grame.fr/community/made-with-faust/ page?
-
What an awesome addition! Thanks for all the effort.
So I compiled Hise with Faust enabled and made a Faust node in Scriptnode using the reverb example (in a dry/wet split node) - it compiled inside scriptnode like a charm and sounds just great :)
To make sure everything works as expected in a compiled plugin I at first compiled as an FX Plugin with leaving the network "open" - it compiled without errors. (AU Mac M1) but inside the DAW the test plugin showed but the reverb was not audible, like if the node was bypassed.
So I tried compiling the network as .dll first. Once I hit the compile button HISE instantly crashed and also the HISE preset crashes instantly now when I try to open it again.
Did I miss something?
Thanks for the help! -
but inside the DAW the test plugin showed but the reverb was not audible, like if the node was bypassed.
This is expected behavior - the faust JIT compiler is not part of an exported plugin, so it will be replaced by a dummy node. However I can add an error message that will complain if you trying to export a plugin with a non-compiled faust node (I have a system for this in place for other nodes like SNEX nodes and expression nodes so it shouldn't be too much effort).
Once I hit the compile button HISE instantly crashed and also the HISE preset crashes instantly now when I try to open it again.
This isn't expected behaviour :)
Can you run a debug build of HISE to see the stack trace where it crashes? Run HISE with the Xcode debugger which should point you to the stack location causing the crash.
-
@Christoph-Hart not op but having the same problem on an Intel Mac ( OSX 12.5.1/ Xcode 13.1), so hopefully this helps. I printed a full stack trace after replicating the error in Xcode debug and found this:
* thread #32, name = 'Compile DSP networks', stop reason = EXC_BAD_ACCESS (code=2, address=0x70000e940ce0) frame #0: 0x0000000121179549 libfaust.2.dylib`SignalPromotion::transformation(CTree*) + 25
and this
* frame #289: 0x0000000110679c6b HISE Debug`faust::generateAuxFilesFromFile(filename="/Users/me/vstproject/DspNetworks/CodeLibrary/faust/freverb.dsp", argc=17, argv=0x0000600000b2f810, error_msg="") at libfaust.cpp:15:10
First time debugging, so apologies if this isn't the needed info. Loving the results of Faust in Scriptnode, can't wait to start implementing hardcoded effects!
-
Hmmm, actually I can reproduce that here too (with the
re.jpverb
example I posted above) and it crashes inside the Faust dll. I wrote this on Windows where it didn't crash, but it seems to reliably bring down macOS.It's also always in
SignalPromotion::transformation(CTree*)
, and it crashes whenevergenerateAuxFilesFromFile()
is called (so it also crashes when clicking on the SVG graph popup button)@sletz is this a known issue in Faust?
Also for the sake of readability I would suggest to create seperate topics about these kind of technical issues and leave this thread to rather generic discussions about Faust - remember we have a new subforum for Faust :)
-
@Christoph-Hart This is not a known problem. What is the DSP code? Do you have the full log? (possibly with a debug version of libfaust to get the precise crash line number?)
-
@sletz The exact code I posted above (the example that takes the
jpreverb
and wraps a few parameters around it.https://forum.hise.audio/topic/6505/faust-is-here/9
If I load that in HISE, the reverb loads and the JIT compiler works perfectly, but anytime I call
generateAuxFilesFromFile
(so either when creating the SVG images or when exporting to C++ during the DLL compilation) it always crashes at said location.I haven't build the libfaust Debug build yet so the stack trace only gives me the last function (might be a good idea going forward though), but it's super easily reproducible on macOS (on Windows it works fine).
- Load up HISE
- create a scriptnode patch
- create a faust node
- paste in the example code, compile
Click on the
eye
icon which opens the SVG popup. It will create the SVG files for a few seconds, then crash in the method above. -
@Christoph-Hart just a quick confirmation from my side - same error in Xcode - I just compiled the compressor demo without problems so itβs def related to```
generateAuxFilesFromFile
-
@ps I cannot reproduce the error here with latest Faust GitHub master-dev branch, on Intel and macOS 10.13 :
- compiled libfaust in shared mode (so make all && sudo make install)
- had to add -lfaust and /use/local/lib in Xcode generated project to properly link the library
- then create a new project ScripNodeFX, faust, copied the jpverb DSP code
- compile so I see the GUI with buttons
- opened the SVG file
- no crash...