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.
IBeat extends TimedObject and represents one beat in the song’s rhythmic structure. Beats are produced by Songle’s beat detection analysis and are available through player.data.songMap.beats or the player.getBeats() helper after onVideoReady.
Each beat knows its position within its bar (position), the total number of beats per bar (length), and its global index in the song (index). The progress() method maps the current playback position to a [0, 1] value within the beat, which is ideal for driving smooth animations.
IBeat properties
TimedObject base
When this beat starts, in milliseconds from the beginning of the song.
When this beat ends, in milliseconds. This is the same as the
startTime of the next beat.Beat-specific
Duration of this beat in milliseconds (
endTime - startTime). Read-only.Total number of beats in the bar that this beat belongs to. Typically
4 for 4/4 time, but may vary.This beat’s zero-indexed position within its bar. A value of
0 means this is the downbeat (first beat) of the bar.This beat’s zero-indexed position in the entire song, counting from the first beat.
The beat immediately before this one.
null for the first beat in the song.The beat immediately after this one.
null for the last beat in the song.Methods
Maps the given song position
time (in ms) to a [0, 1] value representing how far through this beat the song currently is.0.0— at the very start of this beat0.5— halfway through1.0— at the end (i.e., the start of the next beat)
Current playback position in milliseconds.
Player query methods
You can query beats through theplayer instance without accessing the song map directly.
getBeats
findBeat
time in milliseconds. Returns null if no beat is found.
Playback position in milliseconds to search at.
Optional search behavior.
PlayerFindOptions is an alias for FindTimedObjectOptions:findBeatChange
TimedObjectsInRange<IBeat> with entered, left, current, previous, and next fields.
Start of the time range in milliseconds (typically the previous frame’s position).
End of the time range in milliseconds (typically the current position).
Using beat progress for animation
Theprogress() method returns a linear [0, 1] ratio. You can apply an easing function from the Ease class to create more expressive visuals:
Detecting downbeats
Checkbeat.position === 0 to identify the first beat of each bar (the downbeat):