logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class MusicFadeCurveEvaluator

    Evaluates the remaining-volume gain of a tail fade-out for a given MusicFadeCurve.
    Platform-agnostic so it can be unit tested and shared between the runtime fade and editor previews.

    Inheritance
    object
    MusicFadeCurveEvaluator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.MusicPlayer.Domain.Services
    Assembly: Serenity.MusicPlayer.Domain.dll
    Syntax
    public static class MusicFadeCurveEvaluator
    Remarks

    Progress t runs from 0 at the start of the fade to 1 at the end; the returned gain runs from 1 (full volume) down to 0 (silence) and is used as a multiplier on the source's starting volume.

    Methods

    Evaluate(MusicFadeCurve, float, float[])

    Returns the volume gain multiplier at fade progress t for the given curve.

    Declaration
    public static float Evaluate(MusicFadeCurve curve, float t, float[] customSamples = null)
    Parameters
    Type Name Description
    MusicFadeCurve curve

    The fade shape to evaluate.

    float t

    Fade progress in the range [0, 1]; values outside are clamped.

    float[] customSamples

    Gain table sampled uniformly over [0, 1], used only when curve is Custom. Falls back to a linear fade when null or empty.

    Returns
    Type Description
    float

    The remaining-volume gain in the range [0, 1] (1 at the start of the fade, 0 at the end).

    In this article
    © 2026 Serenity. All Rights Reserved