Smoother for Snex Parameters
-
Turning knobs is causing some zipper noise, depending on the dsp code in the Snex.
How can we add a smoother to a parameter inside Snex?
-
@orange There is one already. You can even adjust the smoothing time :)
-
@dustbro you might need to add a fix32 block around it or you still might hear the zipper noises from the once-per-buffer update of the smoother.
-
@Christoph-Hart In my experiments, I actually have to wrap all of my dsp in a sample accurate container. It not only removed unwanted artifacts, but made offline bounces work properly.
-
@dustbro Yeah, that shouldn't be necessary.
BTW, there's a inbuilt smoothed float type in SNEX, which might be better (from a design perspective it's more elegant to smooth the parameters that you need directly in the algorithm / node so that you don't have to add this construct around it anytime you try to change its parameters:
template <int NV> struct simple_ramp_test { SNEX_NODE(simple_ramp_test); sfloat value = 1.0f; // Initialise the processing specs here void prepare(PrepareSpecs ps) { // uses the sample rate from the processing specs // to create a 100ms ramp. value.prepare(ps.sampleRate, 100.0); } // Reset the processing pipeline here void reset() { // reset the ramp when this is called value.reset(); } // Process the signal here template <typename ProcessDataType> void process(ProcessDataType& data) { for(auto& s: data[0]) { s *= value.advance(); } } // Process the signal as frame here template <int C> void processFrame(span<float, C>& data) { } // Process the MIDI events here void handleHiseEvent(HiseEvent& e) { } // Use this function to setup the external data void setExternalData(const ExternalData& d, int index) { } // Set the parameters here template <int P> void setParameter(double v) { // set the ramp target in the parameter callback value.set((float)v); } };
Example use:
HiseSnippet 1082.3ocwW0saaaCElxILa1ocnsXO.9xTfr.6tttArKZichGL1RpPUVPuyfghNlvTjBTTI1aX2uGq8H02fsyQTNRJwHnwHayWj3ye77wyuzgVCWjkYrjf1msLUPBdBMZo1Ma3LlTSFeDI3qnmvxbBaWOqAKSYYYhXRPvV+DxHn81jhOe5sCXJllKpXQHmajbwuHSjtJtgu6mkJ0HVr3LYRMse86FyM5gFkIGvyVzdjTFeN6RwoLTsVTRvNGGKcFaji4DYfNCLwKilYtV60+bYl7Bk.I5ShfCxylLblTEGt5tlQHAaGVcy2xey+Z5IxX4M7qh.OqPP2JKpGCBZcePp+C.RA0fz1dH8bZD2J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(you might have to manually create a SNEX node file called
simple_ramp_test
and paste the code above -
@Christoph-Hart I'll try to make a test example to see if I can pinpoint the issue. I was getting Buffer crashes without the frame container.
-
@Christoph-Hart & @dustbro Thank you for the tip guys.
@dustbro said in Smoother for Snex Parameters:
I'll try to make a test example to see if I can pinpoint the issue. I was getting Buffer crashes without the frame container.
Does the node requires fast calculations? I think Frame nodes are especially for fast operations (like detailed, more accurate signal analyzing...etc.) and maybe there is some overload.