Linking parameters to SNEX
-
@dustbro Again, thank you for putting us on the right path :)
I made some tests and found out some things, so I'll leave that here if others are also having problems wilth compiling the DLL.
What I did before, and what generated error when compiling my networks : I always enabled "Allow compilation" of the whole network >> this generates errors. You only wrap and compile into the dll, the
node
or thechain
containing the graph. ( @DanH )I tried to compile more complex networks, but some nodes seem to throw errors during the DLL compilation process. (i.e. the
xFader.node
).
Also, avoid renaming chains/nodes/etc... during the wrapping process. I'm not sure but HISE doesn't seem to like it.I managed to compile a
SNEX
& aMath.expr
node and it's working fine. I also managed to compile a chorus & a delay into a DLL, then compiling the whole plugin, for the sake of comparing performances. For a simple graph, there's not much of a difference (on HISE's perfLabel, there's about 1-2% of performance gain, but it's worth testing it with more complex graphs).I'll make some more tests during the next days...
EDIT :
I'll update a list of the nodes which produce errors when compiling :control.xfader
control.converter
-
@dustbro Thank you so much for this awesome tutorial.
@Christoph-Hart it would be very helpful, if there are some snex examples (one parameter or multiple parameters, different DSP examples...etc.) at least in Hise Tutorial projects. Can you add please?
Otherwise most of us won't be able to use this beauty. The SNEX documentation is very lacking. Maybe still not ready to use since there are lots of errors and bugs?
-
@dustbro Thank you man! One question about multi parameters. You've used this for one parameter (a = Drive knob):
template <int P> void setParameter(double v) { if (P == 0) { a = (float)v; } }
If we use 2 parameters (let's say a and c), would it be like this? Or anything more needed?
template <int P> void setParameter(double v) { if (P == 0) { a = (float)v; } else if (P == 1) { c = (float)v; } }
-
@Steve-Mohican You got it! (P==1) (P==2) etc...
-
@Steve-Mohican @dustbro It's easier to use an enum:
enum MyParameters { Gain = 0, whatever1, whatever2 } template <int P> void setParameter(double v) { if (P == MyParameters::Gain) { a = (float)v; } else if (P == MyParameters::whatever1) { b = (float)v * 2.0f; } else if (P == MyParameters::whatever2) { c = (float)v / 4.5f; } }