TextStudioSignal
public static class TextStudioSignalNormalized signal math shared by component and UI Toolkit integrations.
Methods
Section titled “Methods”
Normalize(float, float, float)
Section titled “Normalize(float, float, float)”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
| Name | Type |
|---|---|
value |
System.Single |
minimum |
System.Single |
maximum |
System.Single |
Returns
System.Single
AudioRms(ReadOnlySpan, float)
Section titled “AudioRms(ReadOnlySpan, float)”public static float AudioRms(ReadOnlySpan<float> samples, float gain = 1)Allocation-free RMS of a caller-owned sample window; nonfinite samples contribute silence.
Parameters
| Name | Type |
|---|---|
samples |
System.ReadOnlySpan{System.Single} |
gain |
System.Single |
Returns
System.Single
BeatPhase(double, float, double, float)
Section titled “BeatPhase(double, float, double, float)”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
| Name | Type |
|---|---|
timeSeconds |
System.Double |
beatsPerMinute |
System.Single |
originSeconds |
System.Double |
beatsPerCycle |
System.Single |
Returns
System.Single
Smooth(float, float, float, float, float)
Section titled “Smooth(float, float, float, float, float)”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
| Name | Type |
|---|---|
current |
System.Single |
target |
System.Single |
deltaTime |
System.Single |
attackSeconds |
System.Single |
releaseSeconds |
System.Single |
Returns
System.Single