Vixen
02b45cc4
csharp
public sealed class BiquadFilterEffect

A second-order filter across every channel of a bus.

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

Remarks

The other half of docs/plan/14's "effects (reverb, filter)". One biquad is enough for the jobs a game actually asks for — the muffled low-pass behind a wall, the telephone band-pass on a radio voice, the high-pass that keeps rumble out of a music bus — and chaining two of them on the same bus gives 24 dB an octave for the cases that want it.

Transposed direct form II, which is the form with the best numerical behaviour at float precision and needs two state values per channel rather than four.

Fields and properties (7)

  • public BiquadFilterKind Kind

    Which shape it is.

  • public float Frequency

    The cutoff or centre frequency, in hertz.

  • public float Q

    Resonance. 0.7071 is flat; higher peaks at the cutoff.

  • public float GainDb

    Boost or cut in decibels, for the peaking and shelf shapes.

  • public bool Enabled

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

  • public BiquadCoefficients Coefficients

    The coefficients currently in use.

  • public IReadOnlyList<string> Properties

    The knobs this effect will answer to, by name.

Methods (5)

  • 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)

    Processes a block in place.

  • 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 (8)

  • AudioEffectTestsVixen.Audio.Tests
  • AudioRoutingTestsVixen.Audio.Tests
  • EqualizerEffectVixen.Audio
  • FilterEffectAssetVixen.Audio
  • MixControlServerTestsVixen.Audio.Tests
  • MixControlTestsVixen.Audio.Tests
  • MixerAssetTestsVixen.Audio.Tests
  • MixerParameterTestsVixen.Audio.Tests