TextAlive exposes two related types for structural repetition in music:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TextAliveJp/textalive-app-api/llms.txt
Use this file to discover all available pages before exploring further.
IRepetitiveSegment— a single occurrence of a repeated section (e.g., one chorus).IRepetitiveSegments— a group of same-type segments (e.g., all choruses in the song).
onVideoReady, the full list of groups is at player.data.songMap.segments. Chorus-only segments can be fetched via player.getChoruses().
IRepetitiveSegment properties
TimedObject base
When this segment starts, in milliseconds.
When this segment ends, in milliseconds.
Segment-specific
Duration of this segment in milliseconds (
endTime - startTime). Read-only.Zero-indexed position of this segment within its parent
IRepetitiveSegments group.The previous segment in the same group.
null for the first segment in the group.The next segment in the same group.
null for the last segment in the group.Methods
Maps the given playback position
time (in ms) to a [0, 1] value representing progress through this segment.0.0— beginning of the segment1.0— end of the segment
Current playback position in milliseconds.
IRepetitiveSegments properties
IRepetitiveSegments groups all occurrences of one structural type (e.g., all choruses).
true if this group represents chorus sections. false for other repetitive structures such as verses or bridges.The canonical duration shared by all segments in this group, in milliseconds.
The individual segment occurrences that belong to this group, sorted by
startTime.Player query methods
getChoruses
IRepetitiveSegment objects across all chorus groups. Returns an empty array if no chorus is detected.
findChorus
time. Returns null if the current position is not inside any chorus.
Playback position in milliseconds.
Optional search parameters.
PlayerFindOptions is an alias for FindTimedObjectOptions:findChorusChange
TimedObjectsInRange<IRepetitiveSegment> with entered, left, current, previous, and next.
Start of the query range in milliseconds.
End of the query range in milliseconds.
findChorusBetween(startTime, endTime) is deprecated. Use findChorusChange(startTime, endTime) or findChorus(time) instead.Accessing all segment groups
player.data.songMap.segments holds all IRepetitiveSegments groups, not just choruses. You can inspect each group’s chorus flag to categorize them:
Example: highlight the screen during chorus
Change the background and show a label whenever a chorus section is active:Using progress() within a segment
You can usesegment.progress(position) to animate elements that run through the duration of a structural section: