Closed salkin-mada closed 3 years ago
okay. yes we should do it on the cpp
side instead.
clipping or with a sc cpp linlin method?
template <typename T> T inline linlin(T x, T in_min, T in_max, T out_min, T out_max) {
if (x <= in_min)
return out_min;
if (x >= in_max)
return out_max;
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
I think it is probably simplest to do what you did before ( * 4) on the input value but do it in the next
function in the cpp file for this plugin and then wrap that in sc_clip
(which is equivalent to clip in sclang) or sc_clip2
(which is equivalent to clip2 in sclang)
the sc_clip functions are defined in the https://github.com/supercollider/supercollider/blob/develop/include/plugin_interface/SC_InlineBinaryOp.h headerfile which I think is already included in the plugin, otherwise include SC_InlineBinaryOp.h
to make it work
sorry - this was fixed in 0.3.0d on the c++ side. But thanks!!
This is just a cozy cozy res val normalization PR. Close/Reject it at will :)~ First I just did a
in0( Resonance * 4.0f )
in line 19 and 39 (VadimFilter.cpp). Though a mult of4.0
on the.sc
side gets the job done. Hacky. But normalized res values are nice.