SpectrumTimeline

class SpectrumTimeline(val capacity: Int = 128)

Bounded analysis history aligned to the audible media clock.

One thread pushes; any thread reads or resets. Reset replaces the whole history, so work already publishing into the retired history cannot return to the new one. Each atomic slot carries its sequence number: a wrapped slot cannot be mistaken for the older entry a reader was examining.

Constructors

Link copied to clipboard
constructor(capacity: Int = 128)

Properties

Link copied to clipboard
Link copied to clipboard

Bounded event retention and detection-completion diagnostics for the current history.

Link copied to clipboard

The continuous audio timeline this history accepts.

Link copied to clipboard

Current feature retention, including evictions by count, media time or payload size.

Link copied to clipboard

Local continuity identity. Also changes on a dropped visual block or an analysis reset.

Link copied to clipboard

Structural event retention and the structural watermark for the current history.

Functions

Link copied to clipboard
fun ahead(ptsMicros: Long, seconds: Float): SpectrumFrame?

Actual, already analysed audio seconds ahead. Null beyond the available horizon or across a gap; a past frame never substitutes for an unavailable future. Invalid offsets return null.

Link copied to clipboard
fun SpectrumTimeline.asFuture(positionMicros: () -> Long): VizFuture

Lets a drawing see the audio that has been analysed but has not been played yet.

Link copied to clipboard
fun at(ptsMicros: Long): SpectrumFrame?

Newest retained analysis at or before ptsMicros, expiring after 100 ms without new data.

Link copied to clipboard

Contiguous ready media seconds ahead, stopping at missing data or a gap over 100 ms.

Link copied to clipboard
fun clear()
Link copied to clipboard

A new independent consumer, initially discarding events at or before its first sample time.

Link copied to clipboard
fun interpolated(ptsMicros: Long): SpectrumFrame?

Continuous interpolation within one generation; unavailable data expires after 100 ms.

Link copied to clipboard

The newest retained analysis, without alignment.

Link copied to clipboard
fun nextEvent(ptsMicros: Long, kind: AudioEventKind): AudioEvent?

Next retained or mapped event of kind strictly after ptsMicros, from any source, preserving its original identity. Live structural confirmations lie in the past and rarely qualify.

Link copied to clipboard
fun nextOnsetSeconds(ptsMicros: Long): Float

Seconds until the next retained onset, or -1 when none has been observed.

Link copied to clipboard
fun push(frame: SpectrumFrame)

Publishes only frames matching both generation and revision of this history.

Link copied to clipboard
fun reset(generation: Generation)

Retires history and advances revision. An older audio generation is ignored.

Link copied to clipboard
fun sample(ptsMicros: Long, previousPtsMicros: Long): SpectrumFrame?

Scalar event projection over (previousPtsMicros, ptsMicros]. Continuous features are interpolated. This compatibility projection retains the strongest hit of each kind and does not preserve event multiplicity. It must not be used to count events.