(Unwanted) ScriptNode Distortion
-
I'm sure this is me not doing something(s) correctly, and I'm wondering if someone can help here.
It's a simple (compiled) stereo-to-mono mixer, taken from one of the examples. Polyphonic.
I put a gain stage at the end in case I was clipping, but the signal meters seem to indicate I'm not.
I tried various mixing algorithms, though RMS is the one I'd like.Any ideas? Thanks.
<?xml version="1.0" encoding="UTF-8"?> <Network ID="prismDualMicMixer" Version="0.0.0" AllowPolyphonic="1" AllowCompilation="1"> <Node FactoryPath="container.chain" ID="prismDualMicMixer" Bypassed="0" ShowParameters="1"> <Nodes> <Node ID="multi" FactoryPath="container.multi" Bypassed="0"> <Nodes> <Node ID="gain" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> <Node ID="gain1" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters/> </Node> <Node ID="xfader" FactoryPath="control.xfader" Bypassed="0"> <Parameters> <Parameter MinValue="0.0" MaxValue="1.0" ID="Value" Automated="1"/> </Parameters> <Properties> <Property ID="Mode" Value="Linear"/> <Property ID="NumParameters" Value="2"/> </Properties> <SwitchTargets> <SwitchTarget> <Connections> <Connection NodeId="gain2" ParameterId="Gain"/> </Connections> </SwitchTarget> <SwitchTarget> <Connections> <Connection NodeId="gain3" ParameterId="Gain"/> </Connections> </SwitchTarget> </SwitchTargets> </Node> <Node ID="split" FactoryPath="container.split" Bypassed="0"> <Nodes> <Node ID="chain" FactoryPath="container.chain" Bypassed="0"> <Nodes> <Node ID="matrix" FactoryPath="routing.matrix" Bypassed="0"> <Properties> <Property ID="EmbeddedData" Value="73.3o8BJ+RKIy7R22DKonLqfAFY0uRyM37KsnjS04LRLu7RMmhAJFiLw.CL.kuAf3CjKCAmZdo.lCiHjzPP7+OP.HIgygA.dpaGWB"/> </Properties> <Parameters/> </Node> <Node ID="gain2" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters/> </Node> <Node ID="chain1" FactoryPath="container.chain" Bypassed="0"> <Nodes> <Node ID="matrix1" FactoryPath="routing.matrix" Bypassed="0"> <Properties> <Property ID="EmbeddedData" Value="74.3o8BJ+RKIy7R22DKonLqfAFY0uRyM37KsnjS04LRLu7RMmhAJFiLw.CL.kuAf3+efffSMuTfyApjFBhOi.ULHIAygAP..TXzcbI"/> </Properties> <Parameters/> </Node> <Node ID="gain3" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters/> </Node> </Nodes> <Parameters/> </Node> <Node ID="gain4" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters> <Parameter ID="PARAMnodefxMicMixerPreGainLeft" MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" Value="0.0"> <Connections> <Connection NodeId="gain" ParameterId="Gain"/> </Connections> </Parameter> <Parameter ID="PARAMnodefxMicMixerPreGainRight" MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" Value="0.0"> <Connections> <Connection NodeId="gain1" ParameterId="Gain"/> </Connections> </Parameter> <Parameter ID="PARAMnodefxMicMixerPan" MinValue="0.0" MaxValue="1.0" Value="0.502"> <Connections> <Connection NodeId="xfader" ParameterId="Value"/> </Connections> </Parameter> <Parameter ID="PARAMnodefxMicMixerFinalGain" MinValue="-100.0" MaxValue="0.0" Value="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309"> <Connections> <Connection NodeId="gain4" ParameterId="Gain"/> </Connections> </Parameter> </Parameters> </Node> </Network>
-
@clevername27 Can you post a snippet?
-
@aaronventure Thank you for your offer - I'm cooking up the simplest example I can - is taking a bit.
-
@aaronventure Thanks again for your offer. Here are my ScriptNode patches. The two issues I'm experiencing (when any are enabled):
- Significant, audible distortion. With my ScriptNodes disabled, the audio of my plugin is fine—it completely phase-cancels the original audio (when inverted).
- Inconsistent, frequent audible artefacts. It sounds like specific audio buffers are not being filled on time.
My ScriptNodes, themselves, are simple and avoid complex processes (e.g., convolution.)
The plugin itself is largely just a Sampler component with periodic-interface stuff in the deferred thread. (Without ScriptNodes, no amount of plugin instances seem to move the DAW's processor usage indicator.)
I am obviously am doing something(s) very, very wrong here. 🫠
ScriptNode #1
<?xml version="1.0" encoding="UTF-8"?> <Network ID="prismDualMicMixer" Version="0.0.0" AllowPolyphonic="1" AllowCompilation="1"> <Node FactoryPath="container.chain" ID="prismDualMicMixer" Bypassed="0" ShowParameters="1"> <Nodes> <Node ID="multi" FactoryPath="container.multi" Bypassed="0"> <Nodes> <Node ID="gain" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> <Node ID="gain1" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Automated="1"/> </Parameters> </Node> </Nodes> <Parameters/> </Node> <Node ID="xfader" FactoryPath="control.xfader" Bypassed="0"> <Parameters> <Parameter MinValue="0.0" MaxValue="1.0" ID="Value" Automated="1"/> </Parameters> <Properties> <Property ID="Mode" Value="Linear"/> <Property ID="NumParameters" Value="2"/> </Properties> <SwitchTargets> <SwitchTarget> <Connections> <Connection NodeId="gain2" ParameterId="Gain"/> </Connections> </SwitchTarget> <SwitchTarget> <Connections> <Connection NodeId="gain3" ParameterId="Gain"/> </Connections> </SwitchTarget> </SwitchTargets> </Node> <Node ID="split" FactoryPath="container.split" Bypassed="0"> <Nodes> <Node ID="chain" FactoryPath="container.chain" Bypassed="0"> <Nodes> <Node ID="matrix" FactoryPath="routing.matrix" Bypassed="0"> <Properties> <Property ID="EmbeddedData" Value="73.3o8BJ+RKIy7R22DKonLqfAFY0uRyM37KsnjS04LRLu7RMmhAJFiLw.CL.kuAf3CjKCAmZdo.lCiHjzPP7+OP.HIgygA.dpaGWB"/> </Properties> <Parameters/> </Node> <Node ID="gain2" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters/> </Node> <Node ID="chain1" FactoryPath="container.chain" Bypassed="0"> <Nodes> <Node ID="matrix1" FactoryPath="routing.matrix" Bypassed="0"> <Properties> <Property ID="EmbeddedData" Value="74.3o8BJ+RKIy7R22DKonLqfAFY0uRyM37KsnjS04LRLu7RMmhAJFiLw.CL.kuAf3+efffSMuTfyApjFBhOi.ULHIAygAP..TXzcbI"/> </Properties> <Parameters/> </Node> <Node ID="gain3" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters/> </Node> </Nodes> <Parameters/> </Node> <Node ID="gain4" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters> <Parameter ID="PARAMnodefxMicMixerPreGainLeft" MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" Value="0.0"> <Connections> <Connection NodeId="gain" ParameterId="Gain"/> </Connections> </Parameter> <Parameter ID="PARAMnodefxMicMixerPreGainRight" MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" Value="0.0"> <Connections> <Connection NodeId="gain1" ParameterId="Gain"/> </Connections> </Parameter> <Parameter ID="PARAMnodefxMicMixerPan" MinValue="0.0" MaxValue="1.0" Value="0.502"> <Connections> <Connection NodeId="xfader" ParameterId="Value"/> </Connections> </Parameter> <Parameter ID="PARAMnodefxMicMixerFinalGain" MinValue="-100.0" MaxValue="0.0" Value="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309"> <Connections> <Connection NodeId="gain4" ParameterId="Gain"/> </Connections> </Parameter> <Parameter ID="Mega Gain" MinValue="0.0" MaxValue="1.0" Value="0.2286875"> <Connections> <Connection NodeId="gain1" ParameterId="ResetValue"/> </Connections> </Parameter> </Parameters> </Node> </Network>
ScriptNode #2
<?xml version="1.0" encoding="UTF-8"?> <Network ID="prismMicPositioner" Version="0.0.0" AllowCompilation="1" AllowPolyphonic="1"> <Node FactoryPath="container.chain" ID="prismMicPositioner" Bypassed="0" ShowParameters="1"> <Nodes> <Node ID="svf_eq" FactoryPath="filters.svf_eq" Bypassed="0"> <ComplexData> <Filters> <Filter Index="-1"/> </Filters> </ComplexData> <Parameters> <Parameter MinValue="20.0" MaxValue="20000.0" SkewFactor="0.2299045622348785" ID="Frequency" Automated="1"/> <Parameter MinValue="0.300000011920929" MaxValue="9.899999618530273" SkewFactor="0.2647178173065186" ID="Q" Value="1.0"/> <Parameter MinValue="-18.0" MaxValue="18.0" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1.0" SkewFactor="0.3010300099849701" ID="Smoothing" Value="0.009999999776482582"/> <Parameter MinValue="0.0" MaxValue="4.0" StepSize="1.0" ID="Mode" Value="3.0"/> <Parameter MinValue="0.0" MaxValue="1.0" StepSize="1.0" ID="Enabled" Value="1.0"/> </Parameters> </Node> <Node ID="fix_delay" FactoryPath="core.fix_delay" Bypassed="0"> <Parameters> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="DelayTime" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1024.0" StepSize="1.0" ID="FadeTime" Value="512.0"/> </Parameters> </Node> <Node ID="gain" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters> <Parameter ID="mpDistanceAttenuation" MinValue="-100.0" MaxValue="0.0" Value="-3.299998559057726" StepSize="0.1000000014901161" SkewFactor="5.422270774841309"> <Connections> <Connection NodeId="gain" ParameterId="Gain"/> </Connections> </Parameter> <Parameter ID="mpDelayTime" MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" Value="0.0"> <Connections> <Connection NodeId="fix_delay" ParameterId="DelayTime"/> </Connections> </Parameter> <Parameter ID="mpHighFreqCutoffAttenuation" MinValue="-18.0" MaxValue="18.0" Value="-7.120125000000002"> <Connections> <Connection NodeId="svf_eq" ParameterId="Gain"/> </Connections> </Parameter> <Parameter ID="mpHighFreqInHz" MinValue="20.0" MaxValue="20000.0" SkewFactor="0.2299045622348785" Value="2281.682704754448"> <Connections> <Connection NodeId="svf_eq" ParameterId="Frequency"/> </Connections> </Parameter> </Parameters> </Node> </Network>
ScriptNode #3
This one uses a short Faust script, but employs only minimal code-level audio-processing.
<?xml version="1.0" encoding="UTF-8"?> <Network ID="prismFaustTransientShaper" Version="0.0.0" AllowPolyphonic="1" AllowCompilation="1"> <Node FactoryPath="container.chain" ID="prismFaustTransientShaper" Bypassed="0" ShowParameters="1"> <Nodes> <Node ID="faust1" FactoryPath="core.faust" Bypassed="0"> <Properties> <Property ID="ClassId" Value="whetstone"/> <Property ID="NumParameters" Value="1"/> </Properties> <Parameters> <Parameter MinValue="-12.0" MaxValue="12.0" StepSize="0.1000000014901161" ID="Attack" Automated="1"/> <Parameter MinValue="-12.0" MaxValue="12.0" StepSize="0.1000000014901161" ID="Sustain" Automated="1"/> <Parameter MinValue="10.0" MaxValue="20000.0" StepSize="10.0" ID="Low Cutoff" Automated="1"/> <Parameter MinValue="20.0" MaxValue="20000.0" StepSize="10.0" ID="High Cutoff" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1.0" StepSize="1.0" ID="Monitor selected band" Value="0.0"/> </Parameters> <SwitchTargets> <SwitchTarget> <Connections/> </SwitchTarget> </SwitchTargets> </Node> <Node ID="gain" FactoryPath="core.gain" Bypassed="0"> <Parameters> <Parameter MinValue="-100.0" MaxValue="21.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="Gain" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="Smoothing" Value="20.0"/> <Parameter MinValue="-100.0" MaxValue="0.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" ID="ResetValue" Value="0.0"/> </Parameters> </Node> </Nodes> <Parameters> <Parameter ID="tsAttack" MinValue="-12.0" MaxValue="12.0" StepSize="0.1000000014901161" Value="-1.599999845027925"> <Connections> <Connection NodeId="faust1" ParameterId="Attack"/> </Connections> </Parameter> <Parameter ID="tsSustain" MinValue="-12.0" MaxValue="12.0" StepSize="0.1000000014901161" Value="11.80000035464763"> <Connections> <Connection NodeId="faust1" ParameterId="Sustain"/> </Connections> </Parameter> <Parameter ID="tsLowCutoff" MinValue="10.0" MaxValue="20000.0" StepSize="1.0" Value="10.0"> <Connections> <Connection NodeId="faust1" ParameterId="Low Cutoff"/> </Connections> </Parameter> <Parameter ID="tsHighCutoff" MinValue="20.0" MaxValue="20000.0" StepSize="1.0" Value="17788.0"> <Connections> <Connection NodeId="faust1" ParameterId="High Cutoff"/> </Connections> </Parameter> <Parameter ID="tsGainBalance" MinValue="-100.0" MaxValue="21.0" StepSize="0.1000000014901161" SkewFactor="5.422270774841309" Value="-100.0"> <Connections> <Connection NodeId="gain" ParameterId="Gain"/> </Connections> </Parameter> </Parameters> </Node> </Network>
ScriptNode #4
<?xml version="1.0" encoding="UTF-8"?> <Network ID="prismPhaseDelay" Version="0.0.0" AllowCompilation="1" AllowPolyphonic="1"> <Node FactoryPath="container.chain" ID="prismPhaseDelay" Bypassed="0" ShowParameters="1"> <Nodes> <Node ID="multi" FactoryPath="container.multi" Bypassed="0"> <Nodes> <Node ID="chain" FactoryPath="container.chain" Bypassed="0"> <Nodes> <Node ID="converter" FactoryPath="control.converter" Bypassed="0"> <Properties> <Property ID="Mode" Value="Samples2Ms"/> </Properties> <ModulationTargets> <Connection NodeId="fix_delay" ParameterId="DelayTime"/> </ModulationTargets> <Parameters> <Parameter MinValue="0.0" MaxValue="48000.0" StepSize="1.0" ID="Value" Automated="1"/> </Parameters> </Node> <Node ID="fix_delay" FactoryPath="core.fix_delay" Bypassed="0"> <Parameters> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="DelayTime" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1024.0" StepSize="1.0" ID="FadeTime" Value="512.0"/> </Parameters> </Node> </Nodes> <Parameters/> </Node> <Node ID="chain1" FactoryPath="container.chain" Bypassed="0"> <Nodes> <Node ID="converter1" FactoryPath="control.converter" Bypassed="0"> <Properties> <Property ID="Mode" Value="Samples2Ms"/> </Properties> <ModulationTargets> <Connection NodeId="fix_delay1" ParameterId="DelayTime"/> </ModulationTargets> <Parameters> <Parameter MinValue="0.0" MaxValue="48000.0" StepSize="1.0" ID="Value" Automated="1"/> </Parameters> </Node> <Node ID="fix_delay1" FactoryPath="core.fix_delay" Bypassed="0"> <Parameters> <Parameter MinValue="0.0" MaxValue="1000.0" StepSize="0.1000000014901161" SkewFactor="0.3010300099849701" ID="DelayTime" Automated="1"/> <Parameter MinValue="0.0" MaxValue="1024.0" StepSize="1.0" ID="FadeTime" Value="512.0"/> </Parameters> </Node> </Nodes> <Parameters/> </Node> </Nodes> <Parameters/> </Node> </Nodes> <Parameters> <Parameter ID="left_delay" MinValue="0.0" MaxValue="48000.0" Value="0.0" StepSize="1.0"> <Connections> <Connection NodeId="converter" ParameterId="Value"/> </Connections> </Parameter> <Parameter ID="right_delay" MinValue="0.0" MaxValue="48000.0" Value="0.0" StepSize="1.0"> <Connections> <Connection NodeId="converter1" ParameterId="Value"/> </Connections> </Parameter> </Parameters> </Node> </Network>
I lay my code-level hat at your feet.
-
@clevername27 can you create a snippet where you have these networks set up in a mock context that you want to use them in?
E.g. as FX on the master, or for instruments (use waveform synth as a default).
-
@aaronventure I will try—the plugin is 15,000 lines of code, and I'd still need to process the data into its current form when it enters the ScriptNodes. I'll work on it. Thank you.