diff --git a/ProjectObsidian/ProtoFlux/Audio/AudioAdder.cs b/ProjectObsidian/ProtoFlux/Audio/AudioAdder.cs index 7ed9c25..6c9e1d1 100644 --- a/ProjectObsidian/ProtoFlux/Audio/AudioAdder.cs +++ b/ProjectObsidian/ProtoFlux/Audio/AudioAdder.cs @@ -17,7 +17,7 @@ public class AudioAdderProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => AudioInput.ChannelCount; + public int ChannelCount => AudioInput?.ChannelCount ?? 0; public void Read(Span buffer) where S : unmanaged, IAudioSample { diff --git a/ProjectObsidian/ProtoFlux/Audio/AudioMultiply.cs b/ProjectObsidian/ProtoFlux/Audio/AudioMultiply.cs index cb5c57d..9d6f0d1 100644 --- a/ProjectObsidian/ProtoFlux/Audio/AudioMultiply.cs +++ b/ProjectObsidian/ProtoFlux/Audio/AudioMultiply.cs @@ -17,7 +17,7 @@ public class AudioMultiplyProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => AudioInput.ChannelCount; + public int ChannelCount => AudioInput?.ChannelCount ?? 0; public void Read(Span buffer) where S : unmanaged, IAudioSample { diff --git a/ProjectObsidian/ProtoFlux/Audio/AudioSubtractor.cs b/ProjectObsidian/ProtoFlux/Audio/AudioSubtractor.cs index 112e452..86f9ba5 100644 --- a/ProjectObsidian/ProtoFlux/Audio/AudioSubtractor.cs +++ b/ProjectObsidian/ProtoFlux/Audio/AudioSubtractor.cs @@ -17,7 +17,7 @@ public class AudioSubtractorProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => AudioInput.ChannelCount; + public int ChannelCount => AudioInput?.ChannelCount ?? 0; public void Read(Span buffer) where S : unmanaged, IAudioSample { diff --git a/ProjectObsidian/ProtoFlux/Audio/BandPassFilterNode.cs b/ProjectObsidian/ProtoFlux/Audio/BandPassFilterNode.cs index 4edeb13..b09e85b 100644 --- a/ProjectObsidian/ProtoFlux/Audio/BandPassFilterNode.cs +++ b/ProjectObsidian/ProtoFlux/Audio/BandPassFilterNode.cs @@ -22,7 +22,7 @@ public class BandPassFilterProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => AudioInput.ChannelCount; + public int ChannelCount => AudioInput?.ChannelCount ?? 0; private BandPassFilterController _controller = new(); diff --git a/ProjectObsidian/ProtoFlux/Audio/ButterworthFilterNode.cs b/ProjectObsidian/ProtoFlux/Audio/ButterworthFilterNode.cs index ac7016d..a93e49d 100644 --- a/ProjectObsidian/ProtoFlux/Audio/ButterworthFilterNode.cs +++ b/ProjectObsidian/ProtoFlux/Audio/ButterworthFilterNode.cs @@ -22,7 +22,7 @@ public class ButterworthFilterProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => AudioInput.ChannelCount; + public int ChannelCount => AudioInput?.ChannelCount ?? 0; private ButterworthFilterController _controller = new(); diff --git a/ProjectObsidian/ProtoFlux/Audio/EMA_IIR_SmoothSignalNode.cs b/ProjectObsidian/ProtoFlux/Audio/EMA_IIR_SmoothSignalNode.cs index 29820aa..6a30eb9 100644 --- a/ProjectObsidian/ProtoFlux/Audio/EMA_IIR_SmoothSignalNode.cs +++ b/ProjectObsidian/ProtoFlux/Audio/EMA_IIR_SmoothSignalNode.cs @@ -18,7 +18,7 @@ public class EMA_IIR_SmoothSignalProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => AudioInput.ChannelCount; + public int ChannelCount => AudioInput?.ChannelCount ?? 0; public void Read(Span buffer) where S : unmanaged, IAudioSample { diff --git a/ProjectObsidian/ProtoFlux/Audio/PhaseModulatorNode.cs b/ProjectObsidian/ProtoFlux/Audio/PhaseModulatorNode.cs index e0e48f0..ab13cdc 100644 --- a/ProjectObsidian/ProtoFlux/Audio/PhaseModulatorNode.cs +++ b/ProjectObsidian/ProtoFlux/Audio/PhaseModulatorNode.cs @@ -21,7 +21,7 @@ public class PhaseModulatorProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => MathX.Min(AudioInput.ChannelCount, AudioInput2.ChannelCount); + public int ChannelCount => MathX.Min(AudioInput?.ChannelCount ?? 0, AudioInput2?.ChannelCount ?? 0); public void Read(Span buffer) where S : unmanaged, IAudioSample { diff --git a/ProjectObsidian/ProtoFlux/Audio/RingModulatorNode.cs b/ProjectObsidian/ProtoFlux/Audio/RingModulatorNode.cs index c2f23e6..8b9e05c 100644 --- a/ProjectObsidian/ProtoFlux/Audio/RingModulatorNode.cs +++ b/ProjectObsidian/ProtoFlux/Audio/RingModulatorNode.cs @@ -22,7 +22,7 @@ public class RingModulatorProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => MathX.Min(AudioInput.ChannelCount, AudioInput2.ChannelCount); + public int ChannelCount => MathX.Min(AudioInput?.ChannelCount ?? 0, AudioInput2?.ChannelCount ?? 0); public void Read(Span buffer) where S : unmanaged, IAudioSample { diff --git a/ProjectObsidian/ProtoFlux/Audio/SineShapedRingModulatorNode.cs b/ProjectObsidian/ProtoFlux/Audio/SineShapedRingModulatorNode.cs index 8df9049..0a12183 100644 --- a/ProjectObsidian/ProtoFlux/Audio/SineShapedRingModulatorNode.cs +++ b/ProjectObsidian/ProtoFlux/Audio/SineShapedRingModulatorNode.cs @@ -21,7 +21,7 @@ public class SineShapedRingModulatorProxy : ProtoFluxEngineProxy, IAudioSource public bool IsActive => Active; - public int ChannelCount => MathX.Min(AudioInput.ChannelCount, AudioInput2.ChannelCount); + public int ChannelCount => MathX.Min(AudioInput?.ChannelCount ?? 0, AudioInput2?.ChannelCount ?? 0); public void Read(Span buffer) where S : unmanaged, IAudioSample {