VizRenderState

class VizRenderState(val frame: SpectrumFrame, val timeSeconds: Float, val deltaSeconds: Float, val palette: VizPalette, val musicTime: Float = timeSeconds, val future: VizFuture? = null)

Everything a drawing needs to know about this instant.

Two clocks live here on purpose. timeSeconds is the wall clock and never stops. musicTime only moves while there is something to listen to, so anything driven by it stands still in a silence instead of drifting on alone. stepSeconds is the frame's share of that: the seconds to move a camera or a path by, and zero while the player is paused or the audio is silent.

Constructors

Link copied to clipboard
constructor(frame: SpectrumFrame, timeSeconds: Float, deltaSeconds: Float, palette: VizPalette, musicTime: Float = timeSeconds, future: VizFuture? = null)

Properties

Link copied to clipboard
val air: Float

Fine detail follows high frequencies and short cymbal envelopes.

Link copied to clipboard

Weight and attack are separate from section mood: a kick moves the picture NOW.

Link copied to clipboard
val body: Float

Sustained voices/instruments bend surfaces instead of triggering a drum flash.

Link copied to clipboard
val calm: Float

The other way round, because half the uses want it that way.

Link copied to clipboard

Seconds since the surface's previous step. Move particles by this, not by a fixed step. It is 0 when the surface draws the same step again, so no stretch of time is counted twice.

Link copied to clipboard

How hard the music is pushing: loud for this song AND busy.

Link copied to clipboard

How loud this moment is for this song, 0 to 1.

Link copied to clipboard

The analysed audio, already lined up with what is audible.

Link copied to clipboard

The queued audio that has been analysed but not yet heard, when a player supplies one.

Link copied to clipboard

How much of the light the picture may give this frame, 0 to 1.

Link copied to clipboard
val mood: Float

Calm at 0, lively at 1.

Link copied to clipboard

How much of the picture's own movement to keep, 0 to 1.

Link copied to clipboard

Seconds of music, not of clock: it advances with how much is playing. Prefer this for anything whose speed should belong to the song.

Link copied to clipboard

Seconds until the next onset that is already in the queue, or -1 when it is not known.

Link copied to clipboard
Link copied to clipboard

Audible presence; quiet sustained music should still occupy a scene.

Link copied to clipboard

Seconds of audible time this frame, for anything that travels: deltaSeconds while there is something to hear, zero while the player is paused or the audio is silent. Springs and fades keep settling on deltaSeconds; a camera, a ground or a scrolling field moves by this.

Link copied to clipboard

Texture density, independent of how loud the track was mastered.

Link copied to clipboard

Seconds since this visualiser started. Use it for anything that must never stop.

Functions

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

Continuous features seconds from now, or null when unavailable. For a future hit and its strength, use VizFuture.nextEvent; feature-window times are separate from event times.

Link copied to clipboard
fun anticipation(window: Float = 0.15f): Float

How close the next onset is, 1 right on it and 0 further away than window.

Link copied to clipboard
fun paced(base: Float): Float

A speed, scaled by how lively the music is.

Link copied to clipboard
fun percentile(fraction: Float): Float

The value that fraction of this frame's bars sit below.