17.2. Cycle-space time primitives: TimeSpan, Hap, and cycle helpers
Module strudel_time
17.2.1. Structures
- TimeSpan
- Fields:
start : double - Inclusive start position in cycles.
stop : double - Exclusive end position in cycles.
- Hap
- Fields:
17.2.2. Cycle math
- cyclePos(t: double): double
Fractional position within the current cycle (0.0–1.0).
- Arguments:
t : double
- sameCycle(t: double): double
Cycle number containing time position t (integer part as double).
- Arguments:
t : double
- splitSpans(span: TimeSpan): array<TimeSpan>
Split a time span at integer cycle boundaries. Example: splitSpans(TimeSpan(0.75, 2.25)) returns [(0.75,1.0), (1.0,2.0), (2.0,2.25)].
- Arguments:
span : TimeSpan