Vixen
02b45cc4
csharp
public sealed class AudioCurve

A parameter's value on one axis, mapped to something audible.

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

Remarks

Normalised on the way in and not on the way out. A curve is asked about a position from 0 to 1, so the same curve can be reused by parameters with different ranges and an editor can draw it without knowing what it is attached to. What comes out is in the target's own unit — decibels for a gain, semitones for a pitch, hertz for a cutoff — because that is what makes a straight line the right default: a linear ramp in decibels sounds linear, and a linear ramp in amplitude does not.

Immutable, and evaluated on the game thread. Nothing here is touched by the audio thread: AudioEngine.Update evaluates every curve once a frame and leaves behind a handful of floats, which is what the render loop reads. So a curve may be as elaborate as an editor lets somebody draw without any of it landing in a device callback.

Fields and properties (2)

Methods (4)

  • public AudioCurve(ReadOnlySpan<AudioCurvePoint> points, AudioCurveInterpolation interpolation = Linear)

    A curve through some points.

  • public static AudioCurve Constant(float value)

    A curve that is the same everywhere.

  • public static AudioCurve Ramp(float from, float to)

    A straight line across the whole range.

  • public float Evaluate(float position)

    What the curve is worth at a position.

Used by (14)

  • AudioAutomationVixen.Audio
  • AudioBusAutomationVixen.Audio
  • AudioCurveAssetVixen.Audio
  • AudioCurveTestsVixen.Audio.Tests
  • AudioParameterSheetVixen.Audio
  • AudioParameterSheetTestsVixen.Audio.Tests
  • BindingVixen.Audio
  • BuiltinParameterTestsVixen.Audio.Tests
  • LayeredEventTestsVixen.Audio.Tests
  • MixControlTestsVixen.Audio.Tests
  • MixerParameterTestsVixen.Audio.Tests
  • MixerParametersVixen.Audio
  • OcclusionTestsVixen.Audio.Tests
  • VoiceParameterTestsVixen.Audio.Tests