logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class FeedbackPulseExpander

    Pure expansion of a pulsing vibration — an authored frequency and duty cycle — into the concrete FeedbackPatternStep sequence a pattern player walks. Engine-free and directly unit-testable, mirroring FeedbackScaler's role as the single place a shaping rule lives.

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

    Methods

    Expand(FeedbackIntensity, float, float, float)

    Expands a peak impulse pulsing at frequencyHertz with the given dutyCycle into an ordered step sequence covering totalDurationSeconds.

    Declaration
    public static IReadOnlyList<FeedbackPatternStep> Expand(FeedbackIntensity peak, float frequencyHertz, float dutyCycle, float totalDurationSeconds)
    Parameters
    Type Name Description
    FeedbackIntensity peak

    Peak low/high motor amplitudes each pulse reaches (its own Duration is ignored — the on-time of each step is derived from dutyCycle instead).

    float frequencyHertz

    Pulses per second. At or below zero, the whole duration collapses into a single continuous step (no pulsing).

    float dutyCycle

    Fraction of each period the motor is on, clamped to (0, 1].

    float totalDurationSeconds

    Total length of the expanded sequence, in seconds; clamped to non-negative.

    Returns
    Type Description
    IReadOnlyList<FeedbackPatternStep>

    The ordered pulse steps: one step per period (StartOffsetSeconds = i / frequencyHertz, on-time = dutyCycle / frequencyHertz), step count = ceil(frequencyHertz * totalDurationSeconds), with the last step's on-time truncated so no step runs past totalDurationSeconds.

    In this article
    © 2026 Serenity. All Rights Reserved