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.
Assembly: DarkEffekt.Audity.Runtime
Section titled “Assembly: DarkEffekt.Audity.Runtime”[Serializable]public struct AudityLoopSettingsFields
Section titled “Fields”public AudityLoopMode modestartSamples
Section titled “startSamples”public long startSamplesendSamples
Section titled “endSamples”Exclusive; 0 = clip end.
public long endSamplescrossfadeSeconds
Section titled “crossfadeSeconds”> 0 turns Whole/Region loops into crossfaded loops.
[Min(0)]public float crossfadeSecondscrossfadePower
Section titled “crossfadePower”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.
[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 crossfadePowerauthoredFrequency
Section titled “authoredFrequency”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.
public int authoredFrequencyMethods
Section titled “Methods”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.
public void ResolveFrames(int clipFrequency, long clipFrames, out long startFrames, out long endFrames)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
clipFrequency |
System.Int64 |
clipFrames |
System.Int64 |
startFrames |
System.Int64 |
endFrames |