Some Faust errors on Hise
-
Hello guys.
I've just started to tweak the Faust library on my M1 Mac (Xcode 13.1 - Monterey), some examples are great and working.
But I am getting sime kind of errors with some of them. So here are the codes and errors, are these bugs or is there any way to fix them? @Christoph-Hart @etXzat @sletz
import("stdfaust.lib"); diode_clipper(in1) = wd.buildtree(tree) with{ // declare components d1(i) = wd.u_diodeAntiparallel(i, 2.52*10^-9, 25.85*10^-3, 1, 1); vin(i) = wd.resVoltage(i, 4700, in1); c1(i) = wd.capacitor_Vout(i, 47.0e-9); // declare connection tree tree = d1 : (wd.parallel : (vin, c1)); }; process = diode_clipper;
declare name "phaserFlangerLab"; import("stdfaust.lib"); fx_stack = vgroup("[1]", dm.sawtooth_demo) <: vgroup("[2]", dm.flanger_demo) : vgroup("[3]", dm.phaser2_demo); level_viewer(x,y) = attach(x, vgroup("[4]", dm.spectral_level_demo(x+y))),y; process = fx_stack : level_viewer;
//Chua's diode circuit //original circuit featuring Chua's diode taken from Kurt Werner thesis //for reference, see Meerkotter and Scholz, "Digital Simulation of Nonlinear Circuits by Wave Digital Filter Principles" wdf = library("wdmodels.lib"); import("stdfaust.lib"); //create circuit components c1(i) = wdf.capacitor_output(i, 5.5*10^(-9)); r2(i) = wdf.resistor_output(i, 1.6*10^3); //resistance must be slightly higher than original document, currently unsure why. l3(i) = wdf.inductor_output(i, 7.07*10^(-3)); c4(i) = wdf.capacitor_output(i, 49.5*10^(-9)); d1(i) = wdf.u_chua(i, -500*10^-6, -800*10^-6, 1); //I've added a voltage injection for agitation purposes. the system will always initialize with zeros, so adding an impulse will get oscillations started. vInject(i) = wdf.series_voltage(i, button("impulse")*5 : ba.impulsify); //input tree structure treeChua = d1 : (wdf.parallel : (c1, (wdf.series : (r2, (wdf.parallel : (l3, (vInject :c4))))))); chua = wdf.buildtree(treeChua); process = chua;
-
@Steve-Mohican
In the first example you only have one in- and one output, while the hise core.faust node expects 2 ins and outs.
you can make it process stero channels by changing the process line as follows:process = sp.stereoize(diode_clipper);
In the second exapmple, there's an 15 band analyzer included, each band displayed by an "bargraph" module, which HISE interprets as a modulation source. Since HISE only accepts 4 moulation sources per node, this will lead to an error. You can just delete the ": level_viewer" from the process line, then the example works, but without analyzer.
The last one is somehow mystic (at least to me). There are a lot of functions that are not part of the included libray "wdmodels.lib". You can have a look at the contents of the library here.
-
@Steve-Mohican in the last example, I think you have to use capacitor_Vout instead of capacitor_output
-
@Dan-Korneff Yeah, i thought about that too, but since i have no clue of electrics, i kept that advice for me... . Maybe the example code is outdated and the library was updated in the meantime?
-
Since HISE only accepts 4 moulation sources per node
BTW this is just an arbitrary limitation and you can raise that with a preprocessor constant if you need more but it has a small impact on CPU usage so I picked whatever sensible value I thought makes sense.
-
@Christoph-Hart What would i have to type into the preprocessor definitions to extend the modulation sources amount?
-
It's called
HISE_NUM_MAX_FAUST_MOD_SOURCES
. -
@toxonic Thank you so much for the tips, Faust is very good and it'j so enjoying to use it :)
-
@Dan-Korneff I'll try this ASAP, thank you so much!
-
I am trying to run the reverbs from here: https://faustdoc.grame.fr/examples/reverb/
But I get the below errors on most of them. How to overcome this?
For example, the below one gives this error:
declare name "zitaRevFDN"; declare version "0.0"; declare author "JOS, Revised by RM"; declare description "Reverb demo application based on zita_rev_fdn."; import("stdfaust.lib"); process = dm.zita_rev_fdn_demo;
-
@harris-rosendahl Seems related to this:
https://forum.hise.audio/topic/7024/faust-channel-mismatch-how-to-tackle-it -
@ustk Thank you for the suggestion. I think this duplicating solution doesn't work every time. Maybe because of this is the demo.
This doesn't work
declare name "zitaRevFDN"; declare version "0.0"; declare author "JOS, Revised by RM"; declare description "Reverb demo application based on zita_rev_fdn."; import("stdfaust.lib"); process = dm.zita_rev_fdn_demo, dm.zita_rev_fdn_demo;
-
@harris-rosendahl i just took a look at the faust library description in the web, it seems, that this demo has 8 channels....
-
@toxonic So we can't convert it to stereo? Most of the reverbs give this error on that library page
-
@harris-rosendahl
It's always a good idea to check the examples in the Faust Web IDE (just google for it), and have a look at the diagram. There you can see, if you can simply converst a mono channel code to stereo, or if there are other channel issues:
Which reverb for example has a channel mismatch in HISE too? -
I see that, thank you so much.
Which reverb for example has a channel mismatch in HISE too?
I've come across this error on
reverbTester
,reverbDesigner
,fdnRev
andzitaRevFDN
. And as I see in the diagrams, all of them have multiple input channels.Regarding the JPVerb and Greyhole reverbs, on the Web IDE page the GRAME License has been declared.
But the license of these reverbs has been declared as GPL2+ here: https://github.com/grame-cncm/faustlibraries/blob/master/reverbs.lib
So that means these reverbs can't be used without sharing the source code? So this is not MIT License as @Christoph-Hart shared here: https://forum.hise.audio/topic/6505/faust-is-here/9
I think Licensing is very tricky in Faust :)
-
Licence of Faust functions in libraries are the choice of the contributors. Some are GPL, some MIT/BSD like...or others. Each function can have its own licensing scheme, which is usually described as a
declare licence XXX
line (see https://github.com/grame-cncm/faustlibraries/blob/master/aanl.lib#L261 for instance). -
@Christoph-Hart Any way to get more than 16 mod sources? My Faust synth needs a lot of them :)