SpectrumFrame

One analysed moment of audio, ready to draw.

It is published whole and never written afterwards: every analysis allocates new arrays, so a frame a drawing holds does not change underneath it. Several views share one frame, and the array properties are plain arrays for compatibility, so treat them as read-only and copy an array before changing it. Most values are in 0..1. The waveforms (scope, scopeLeft and scopeRight) are raw amplitude with nominal full scale one, and ptsMicros, bpm, trend and beatInSeconds carry their own units.

power contains raw unweighted measurements, programme contains independently timed momentary K-weighted loudness, and drivers contains display heights under one shared gain. Legacy relative level names alias those same heights; no band or drawing has a private gain.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Local analysis continuity within generation, including queue gaps and format changes.

Link copied to clipboard

How much there is to hear, 0 to 1: zero while the clock is held or the audio is silent, one from a quiet pad upwards.

Link copied to clipboard

Whether the short analysis window is available. Silence is AnalysisAvailability.Ready.

Link copied to clipboard

Shared-gain fast display height per ERB band, low frequency first.

Link copied to clipboard

Compatibility alias of bands, with the same gain and smoothing.

Link copied to clipboard

Legacy bar phase. The live pulse tracker does not establish meter and publishes zero.

Link copied to clipboard
val bass: Float

Fast height for integrated energy below 250 Hz, including LFE.

Link copied to clipboard

Compatibility alias of bass.

Link copied to clipboard
val beat: Float

Scalar onset energy projection, from hits only. Player views project delivered events; a raw analysis reports newly detected hits whose individual times are in detections, not ptsMicros. A detection below AudioDetection.HIT_CONFIDENCE stays in events and in detections with its own confidence, and is not projected here.

Link copied to clipboard

Compatibility projection of usable beat support, or zero. Diagnostic scores are in rhythm.

Link copied to clipboard

Seconds until the next beat is expected, or -1 with no tempo.

Link copied to clipboard

Where we are between one beat and the next, 0 to 1.

Link copied to clipboard
val bpm: Float

Beats per minute, or 0 before a tempo has been found.

Link copied to clipboard

True while the music has thinned right out.

Link copied to clipboard

Where the weight of the spectrum sits. Bright music is high.

Link copied to clipboard

Short-term pitch-class profile from the long key window, C first, each pitched analysis peaking at one. It decays to zero during unpitched audio.

Link copied to clipboard

How busy it is. 0 is nothing happening, 1 is eight or more onsets a second.

Link copied to clipboard

Original detector publication and completion watermark, before per-view delivery.

Link copied to clipboard

Fast/slow/peak energy heights with one shared bounded gain and saturation diagnostics.

Link copied to clipboard

True on the one analysis where the music comes back after having gone away.

Link copied to clipboard

Jumps to 1 on a drop and falls over about a second.

Link copied to clipboard

Compatibility alias of the shared-gain fast overall energy height.

Link copied to clipboard

Ordered events delivered once to this view, including per-event lateness and discard counts.

Link copied to clipboard

How spread out the spectrum is. A tone is near 0, noise and distortion near 1.

Link copied to clipboard

Continuous audio identity, matching the player's audible clock for player-fed analysis.

Link copied to clipboard

Whether ptsMicros is known. Zero and negative timestamps can both be valid.

Link copied to clipboard
val hat: Float

Strength of the strongest high-transient hit, 0..1. Does not identify a hi-hat or cymbal.

Link copied to clipboard
Link copied to clipboard

True while the playback clock stands still: the levels are kept, but nothing is heard.

Link copied to clipboard

The key supported by pitched audio, separately timed, or null when unknown.

Link copied to clipboard

The key's confidence, 0 to 1, and zero while the key is unknown.

Link copied to clipboard

The known key on the circle of fifths, 0 to 1, with a minor key at its relative major.

Link copied to clipboard
val kick: Float

Strength of the strongest low-transient hit, 0..1. Does not identify a kick drum.

Link copied to clipboard

Fast attack envelopes of hits, measured in audio time so no display can miss one.

Link copied to clipboard

Shared-gain fast overall energy height. Raw power is available separately in power.

Link copied to clipboard

Compatibility alias of level.

Link copied to clipboard

Shared-gain slow overall energy height (100 ms rise and 2 s fall).

Link copied to clipboard

Shared-gain fast overall energy height, used for short-versus-slow section contrast.

Link copied to clipboard
val mid: Float

Energy from 250 Hz to 2 kHz, which is most of what a voice or a guitar occupies.

Link copied to clipboard

Compatibility alias of mid.

Link copied to clipboard
val mood: Float

Calm at 0, lively at 1. Moves over bars, not frames.

Link copied to clipboard

Rate shared by clocks and continuous motion; attacks remain distinct from section mood.

Link copied to clipboard

How much energy is arriving right now, gate or no gate.

Link copied to clipboard

How hard the hit actually was, rather than how surprising. A soft hit reads soft.

Link copied to clipboard

The falling cap above each bar.

Link copied to clipboard

Legacy phrase phase. The live pulse tracker does not establish phrases and publishes zero.

Link copied to clipboard

Calibrated short-window power, without display scaling. Null until a complete window exists.

Link copied to clipboard

Independently timed ungated 400 ms programme measurement, including unavailable/warmup.

Link copied to clipboard

The media timestamp of the audio this was measured from. Consult hasTimestamp for validity.

Link copied to clipboard

Jumps to beat when one lands, then falls away. This is what a flash or a kick reads.

Link copied to clipboard

Pulse rate and phase evidence, separately timed and unavailable until analysis is ready.

Link copied to clipboard

The newest slice of the waveform, for an oscilloscope.

Link copied to clipboard

The newest samples of the left channel, raw. Plotted against scopeRight this is what a vectorscope shows: a line for mono, an open shape for a wide mix. Mono audio gives scope.

Link copied to clipboard

Exact mono trace interval and trigger, null before a complete input window.

Link copied to clipboard

The newest samples of the right channel. See scopeLeft.

Link copied to clipboard

Strength of the strongest body/crack-transient hit, 0..1. Does not identify a snare.

Link copied to clipboard
Link copied to clipboard

Exact paired trace interval and trigger, null before a complete input window.

Link copied to clipboard

This analysis's structural publication and watermark, separate from the transient detections.

Link copied to clipboard

Energy above 2 kHz. Cymbals, consonants and air.

Link copied to clipboard

Compatibility alias of treble.

Link copied to clipboard

loudShort against loudLong. Above 1 the music is arriving, below 1 it is leaving.

Link copied to clipboard

Recommended trace amplitude multiplier, from the same gain as every energy driver.

Link copied to clipboard

How wide the stereo image is. 0 is mono, 1 is fully out of phase.

Functions

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

The bar value that fraction of the bars are below, using the relative bars.