Linking parameters to SNEX
-
For the wave shaping, I found an equation:
(input: a == "overdrive amount" - From 0.1 to 5) z = M_PI * a; s = 1/sin(z) b = 1/a if (x > b) f(x) = 1 else f(x) = sin(z*x)*s
To use it in the SNEX Waveshaper, I added below code to the SNEX code editor. I also added a parameter knob called "Driven" which has a range between 0.1 & 10.0:
float Driven = 0.1f; float getSample(float input) { float z = 3.14f * Driven; float s = 1.0f / Math.sin(z); float b = 1.0f /Driven; return input > b ? input == 1.0f : input == Math.sin(z*Driven)*s; } // These functions are the glue code that call the function above template <typename T> void process(T& data) { .......
It seems like the parameter hasn't linked to the code. Also I hear nothing, normally I should hear big distorted sound :)
Where am I making the mistake?
-
@Fortune the parameters are taken by the function:
template <int P> void setParameter(double v)
where P is the parameter index
You might want to use an enum, but it isn't mandatory -
@ustk Thank you so much, I will check it.
-
Adding
template <int P> void setParameter(double v) { Driven = (float)v; }
Solved the parameter link issue. Thank you so much.
-
@ustk I just wanted to try this snex network compiling with @Fortune s code. What I do is:
Insert a Script FX > Create a new DSP Network File
Then this procedure:
https://www.youtube.com/watch?v=20BUXqh6D80
Terminal says "success" but It throws an
'getError' has C-linkage specified, but returns user-defined type 'scriptnode::Error' which is incompatible with C [-Wreturn-type-c-linkage]
error, you can see it in the video. Also I can't see the compiled DSP network in the scriptnode.What is the missing part?
-
@orange Well, I'm playing with SNEX sometimes but never exported anything because there are so many reported bugs that are still not fixed... I got a major project that needs DSP/SNEX pending for more than 2 years, but in the waiting I focus my attention on other projects that don't need DSP because I'm not confident at all it'll consistently work for marketable projects one day...
Guys who don't release sample based plugins are still the poor children of Hise -
@orange it could be a bunch of things. Did you wrap the SNEX node in a DSP network? Also, remove any unused parameters from the main container.
I'll try to make a full video on how to implement this dsp tonight. -
@ustk said in Linking parameters to SNEX:
Guys who don't release sample based plugins are still the poor children of Hise
Yes unfortunately. But fx stuff is much stronger than it seems
-
@dustbro said in Linking parameters to SNEX:
Did you wrap the SNEX node in a DSP network?
What I do is
Create a new DSP Network File
? Is this wrapping? This is another short video about how I start.https://www.youtube.com/watch?v=Hz_1SvWBpJk
I'll try to make a full video on how to implement this dsp tonight.
A video would be great and would bring some light to this dark area :)
-
@dustbro always getting some errors here but a video about a full working process would be awesome :folded_hands:
@orange in the meantime you'll find some info here : https://forum.hise.audio/topic/4364/snex_node-needs-to-be-wrapped-into-a-compileable-dsp-network
As Christoph explains, you select the SNEX node and click on the small 'cube' icon to wrap it in a DSP network : -
float Drive = 0.1f; float getSample(float input) { return Math.tanh(Drive*input)/Math.tanh(Drive); } template <int P> void setParameter(double v) { Drive = (float)v; }
For the above code, I get bunch of errors below:
ā non-type template argument is not a constant expression using FixBlockType = snex::Types::ProcessData<NumChannels>; ^ ā type 'int' cannot be used prior to '::' because it has no members if constexpr (T::hasCompileTimeSize()) ^ ā static_cast from 'snex::Types::InternalData *' to 'int *' is not allowed return *static_cast<T*>(this); ^ ā type 'typename node<instance<1>>::MetadataClass' (aka 'int') is not a structure or union
-
@orange I would love to help you with that but I'm not that advanced
Maybe try to write your saturation formula in aMath.expr
node, wrap it and see if HISE manages to compile it into a DLL, or if it throws some errors again.
Won't help you much - depending on what you want to do - but it might be useful for debugging purposes... -
@orange Since you don't seem to place your node inside a frame2_block, you don't need the processFrame function so remove it and test if it works...
-
@dustbro said in Linking parameters to SNEX:
I'll try to make a full video on how to implement this dsp tonight.
Hey @dustbro, have you got a chance to do it? Following, please :)
-
@Fortune Not yet. I got a little jammed up with the "day job" :beaming_face_with_smiling_eyes:
-
Finally had a second to make a quick video. I apologize for the poor quality and zero planning... but you get the idea
-
@dustbro Awesome, man ! Thank you very much for taking the time to do it.
I'm usually facing errors while compiling wrapped nodes, but I'll review my process and report back if I find what I was doing wrong.Edit : wrapping and compiling dll is working fine here. (Tested with SNEX and Math.expr nodes).
So clearly I was doing something wrong... I just have to find it out. -
@dustbro That's very helpful, Thank you!
-
FYI I tried the same code in SNEX shaper and got compiling errors. I think something is wrong with that node.
I was previously able to compile shaper nodes so I'll take a closer look at what's going on. -
@dustbro said in Linking parameters to SNEX:
FYI I tried the same code in SNEX shaper and got compiling errors. I think something is wrong with that node.
I was previously able to compile shaper nodes so I'll take a closer look at what's going on.Yes, that's what I've got the above errors I posted were in the snex shaper node. That node has definitely got some issues. But will try in normal snex node too.