Vixen
02b45cc4
csharp
public sealed class PhaserEffect

A chain of all-pass filters being swept, which puts moving notches in the sound.

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

Remarks

Not a flanger, and the difference is the reason both exist. A flanger delays a copy and interferes it with the original, so its notches land at whole multiples of one frequency — a harmonic comb, which the ear hears as pitched. A phaser shifts the phase of a copy with all-pass sections, so its notches land wherever the sections put them, unrelated to each other. That is why a flanger sounds like a jet and a phaser sounds like a swirl.

An all-pass filter changes nothing you can hear on its own. Its magnitude response is flat — every frequency comes out at the level it went in — and all it does is delay some frequencies more than others. Adding it back to the dry signal is what turns that phase difference into cancellation, and sweeping where the phase rotates is what makes the cancellation move.

Stages come in pairs. Each first-order section contributes one notch to the sum, so four stages is the classic four-notch phaser and eight is the lush one. An odd number works and is unusual.

Fields and properties (10)

  • public int Stages

    How many all-pass sections, and therefore how many notches.

  • public float MinFrequency

    The bottom of the sweep, in hertz.

  • public float MaxFrequency

    The top of the sweep, in hertz.

  • public float RateHz

    How many times a second the sweep goes round.

  • public float Feedback

    How much of the output feeds back in, which sharpens the notches.

  • public float StereoSpread

    How far apart the channels are swept, as a fraction of the cycle.

  • public float Wet

    How much of the phase-shifted signal to add.

  • public float Dry

    How much of the untouched signal to keep.

  • public bool Enabled

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

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

  • MixControlTestsVixen.Audio.Tests
  • MixerAssetTestsVixen.Audio.Tests
  • ModulationEffectTestsVixen.Audio.Tests
  • PhaserEffectAssetVixen.Audio