Performing4 of 8

Audio analysis

Level, bands, spectrum, onsets, BPM.

Operatour analyses a system input device. The analysis reaches every layer through the audio contract and, from v1, drives every audio modulator.

Getting sound in: its own page.

input mic · loopback analysis level · bassmid · high spectrum · onsets bpm · beatPhase window.sialk the published contract your sketch reads it, and moves compositor GPU, every layer the wall
Analysed once, handed to every layer through the versioned contract. Sketches read it directly, zero setup.

What it measures

Value What it is
level Broadband loudness, smoothed. 0-1.
bass Roughly 20-250 Hz. 0-1.
mid Roughly 250-2000 Hz. 0-1.
high Roughly 2000-16000 Hz. 0-1.
spectrum 64 bins, log-spaced across 20 Hz - 16 kHz.
levelTrail The last 128 frames of level, newest first.
hits A counter that increases on every onset. Never resets mid-show.
onBeat 1 on the frame a beat lands, decaying towards 0 before the next.
beatPhase Ramps 0 → 1 between beats. 0 when there is no tempo.
bpm 0 when unknown.
bpmConfidence 0-1. 0 when unknown.
silent True when no signal has been present for one second.

Growing with the contract

The contract is versioned; additions are non-breaking minor versions. Published surface: the contract page. Two since contract 1.0, both in Operatour 1.0:

  • percussive and harmonic (contract 1.1): drums against notes, right now. A share, not a loudness: multiply by level for how hard is the kick.
  • stems and stemCount (contract 1.2): real per-stem input, up to eight, each with level, bass, mid and high. From a DAW through Sialk: Connect or a multichannel device. Zeros where no stem input is set up: true, not an error.

Two things to know

A band is energy, not an average: the energy in that part of the spectrum. Right for driving a visual from a kick drum.

bpm and bpmConfidence travel together. 128 at confidence 0.2 is a guess. Switching a whole scene on the beat: read the confidence too. beatPhase is 0 with no tempo, a cue to fall back to level.

Designing for a real room

A mic in a loud room is not a loopback device; the difference is mostly headroom. A visual that saturates at 0.9 looks identical at 0.9 and 1.0: loud and very loud rooms look the same, and the peak of the night has nowhere to go.

Leave the top third of the range unused. That is what makes the peak mean something.

silent is the other half. A show that goes black between tracks reads as broken. Use silent to hold a resting state, not to stop.