Skip to content

TextStudioSignal

ClassTextStudioTextStudio
public static class TextStudioSignal

Normalized signal math shared by component and UI Toolkit integrations.

public static float Normalize(float value, float minimum = 0, float maximum = 1)

Maps a finite source range into [0,1]. Reversed ranges invert the signal.

Parameters

NameType
valueSystem.Single
minimumSystem.Single
maximumSystem.Single

Returns

System.Single

public static float AudioRms(ReadOnlySpan<float> samples, float gain = 1)

Allocation-free RMS of a caller-owned sample window; nonfinite samples contribute silence.

Parameters

NameType
samplesSystem.ReadOnlySpan{System.Single}
gainSystem.Single

Returns

System.Single

public static float BeatPhase(double timeSeconds, float beatsPerMinute, double originSeconds = 0, float beatsPerCycle = 1)

Clock-based beat phase in [0,1), with no accumulated delta-time drift.

Parameters

NameType
timeSecondsSystem.Double
beatsPerMinuteSystem.Single
originSecondsSystem.Double
beatsPerCycleSystem.Single

Returns

System.Single

public static float Smooth(float current, float target, float deltaTime, float attackSeconds, float releaseSeconds)

Frame-rate-independent attack/release smoothing. Seconds are exponential time constants.

Parameters

NameType
currentSystem.Single
targetSystem.Single
deltaTimeSystem.Single
attackSecondsSystem.Single
releaseSecondsSystem.Single

Returns

System.Single