How can I switch between Peak and RMS input level for a custom noise gate?
-
Hi everyone,
I'm working on a custom noise gate in Scriptnode, and it's mostly functional now.
I'm analyzing the input signal level using both Peak and RMS, and using a compare node to control the gate.In the screenshot below, you'll see that:
I’ve added both RMS and Peak nodes (thanks to Griffinboy),
But currently, only the Peak level is used as the input to the compare node.
Now I’d like to improve this by giving the user the option to choose between Peak or RMS for the gate detection.
What I’m looking for:
A way to store or hold both values (Peak and RMS),Then dynamically select one based on a selector knob (e.g. 0 = Peak, 1 = RMS),
And route the selected value into the compare node.
Is there a way to do this using only built-in Scriptnode nodes?
Or would I need to go into SNEX or write a custom node in C++?
-
@Yinxi input_toggle node
-
@aaronventure said in How can I switch between Peak and RMS input level for a custom noise gate?:
input_toggle node
Thanks
Didn’t know about the input_toggle node, that’s exactly what I needed. I should’ve looked a bit deeper before askingBy the way, is there a way to have more than two input options with something similar? Like selecting between 3 or more sources instead of just toggling between 2?
-
@Yinxi yup, just keep chaining the input toggles
-
@aaronventure said in How can I switch between Peak and RMS input level for a custom noise gate?:
@Yinxi yup, just keep chaining the input toggles
cant he just use a branch container? - Or did I not understand the requirement?
-
@Lindon you can, but then you need the actual nodes in there and if you want to cable them, that requires additional peak nodes. or you cable the values into add notes in the branch node, and after the branch node use a peak node to pick the value up again and cable it wherever you want.
the chained input-toggles let you keep it all in cables.
you can also use the xfader in switch mode. Just set the max of the Select parameter to whatever your desired number of branches is.
HiseSnippet 1126.3ocyW0kSibDDtaCiAb1jrqzd.7irQHjcVv.JJheL3DmD.qcHn8MT6dZia4d5dzL8.3Dk2y8HWjbKxS4Nr2fjpldr83eBArRhhQBb82zeUUeU0CchMbQRhIlPqb0vHAg9BO+gZa+l8YRMo8oD5m3cNKwJhq5TcxvHVRhHfPoq7UnB5FqRx97gCOgoXZtXhJB4ZijK9NYnzNQami9VoR0hEHtRFVv6cNpM2naZTlT.Oq3UiDw3CX2JtfgtUxi70rj9D5m40sNul3sc4LVW1Ah82e2t6r+dGvD0Cpu2tMNX2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