Vixen
02b45cc4
csharp
public sealed class GateEffect

Turns the signal down when there is nothing worth hearing in it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The other side of the compressor. A compressor bends everything above a threshold towards a lower level; a gate bends everything below one towards silence. Same detector, same attack and release, mirrored gain computer — which is why it is a hundred lines and not a subsystem.

What it is actually for is an open microphone. Thirty players in a voice session are thirty room tones, thirty fans and at least one mechanical keyboard, summed. Each is inaudible alone and the sum is a wash that never stops. Nothing else in the mixer removes it: a fader would take the speech with it, and a filter would only make it duller.

HoldSeconds is not optional. Speech dips below any useful threshold between syllables, and a gate with no hold slams shut in the gaps — which is the chattering that makes gated dialogue sound worse than ungated. The hold keeps it open through the dip and the release closes it gently afterwards.

RangeDb rather than silence. A gate that closes to nothing is obvious, because the room tone it was hiding stops dead the moment somebody speaks and returns when they finish. Closing to −40 or −60 dB removes the wash and leaves the transition inaudible, which is what a broadcast gate does and why they are set that way.

It is an ISidechainEffect, so a bus can be gated by another bus — which is how a music bed is opened only while a radio channel is transmitting.

Fields and properties (10)

  • public float ThresholdDb

    The level below which the gate starts closing.

  • public float KneeDb

    How far below the threshold it must fall before the gate is fully shut.

  • public float RangeDb

    How far down a closed gate goes. Negative decibels; zero would be no gate at all.

  • public float AttackSeconds

    How quickly it opens.

  • public float HoldSeconds

    How long it stays open after the signal has fallen back below the threshold.

  • public float ReleaseSeconds

    How slowly it closes once the hold has run out.

  • public bool Enabled

    Whether it does anything. A bypassed effect costs one branch a block.

  • public float GainReductionDb

    How far down the gate has the signal as of the end of the last block. Zero is wide open.

  • public bool IsOpen

    Whether the detector says somebody is talking.

  • public IReadOnlyList<string> Properties

    The knobs this effect will answer to, by name.

Methods (6)

  • public void Prepare(in AudioFormat format, int maxFrames)

    Sizes and clears every buffer the effect needs.

  • public void Process(Span<float> buffer, int frameCount, int channels)
  • public void Process(Span<float> buffer, ReadOnlySpan<float> key, int frameCount, int channels)

    Processes a block against a key signal.

  • public void Reset()

    Throws away everything the effect remembers about what came before.

  • public bool TrySetProperty(string name, float value)

    Sets one of the effect's knobs by name, for automation.

  • public bool TryGetProperty(string name, out float value)

    Reads one of the effect's knobs by name.

Used by (5)

  • CaptureTestsVixen.Audio.Tests
  • GateEffectAssetVixen.Audio
  • GateTestsVixen.Audio.Tests
  • MixControlTestsVixen.Audio.Tests
  • VoiceSenderVixen.Audio.Codecs