Skip to content

Struct AudityLoopSettings

Loop settings for a sample. Positions are clip-rate sample frames, RATE-STAMPED with the frequency they were authored at: Unity’s per-platform import settings can resample a clip (Optimize/Override Sample Rate - including in-editor on a build-target switch), so a bare frame index is not a stable time unit. Bake sites resolve through DarkEffekt.Audity.AudityLoopSettings.ResolveFrames(System.Int32%2cSystem.Int64%2cSystem.Int64%40%2cSystem.Int64%40), which rescales the authored positions onto the clip’s CURRENT rate.

Declaration
[Serializable]
public struct AudityLoopSettings
Declaration
public AudityLoopMode mode
Declaration
public long startSamples

Exclusive; 0 = clip end.

Declaration
public long endSamples

> 0 turns Whole/Region loops into crossfaded loops.

Declaration
[Min(0)]
public float crossfadeSeconds

Shapes the equal-power blend: the crossfade position is warped by t^power before the constant-power curve is evaluated, so the sum of squared gains stays 1 for any value - only the timing of the cross shifts (power < 1 crosses early then lingers; power > 1 holds then crosses late; 1 is the unwarped default). <= 0 (including an unset/never-authored struct) means 1.

Declaration
[Tooltip("Shapes the crossfade curve. 1 = unwarped equal-power (default). < 1 crosses early then lingers; > 1 holds then crosses late. 0 (or unset) is treated as 1. Drag the waveform's crossfade grip vertically to set this.")]
public float crossfadePower

Sample rate DarkEffekt.Audity.AudityLoopSettings.startSamples/DarkEffekt.Audity.AudityLoopSettings.endSamples were authored at (stamped by the loop editor on every write). 0 = unstamped: positions are taken at the clip’s current rate.

Declaration
public int authoredFrequency

ResolveFrames(int, long, out long, out long)

Section titled “ResolveFrames(int, long, out long, out long)”

The loop region in the clip’s CURRENT rate: rescales the authored positions when the clip was imported at a different frequency than they were authored at, and clamps into the clip. endFrames 0 = clip end.

Declaration
public void ResolveFrames(int clipFrequency, long clipFrames, out long startFrames, out long endFrames)
Type Name
System.Int32 clipFrequency
System.Int64 clipFrames
System.Int64 startFrames
System.Int64 endFrames