open-audiovisual
Search GitHub

Documentation

Signals reference#

Chapter 19 of 24Source: docs/signals.md

Signals are the single currency of the input layer: named, normalized, source-blind. This page lists every signal published by the built-in input packages.

Conventions:

  • ranges are 0..1 unless noted
  • pulse signals fire events; their value is the event payload
  • y axes are flipped where it makes performance sense (1 = raised), never raw pixels
  • <n> is a number, <ch> a MIDI channel 1..16, <id> a device id, <slug> a device name made URL-safe

@openav/midi#

Every hardware message publishes the legacy names and the per-channel names.

signalkindrangemeaning
midi/note/onpulse{note, vel, velocity, ch, device}key down: vel 0..1, velocity 1..127, ch 1..16, device = port slug
midi/note/offpulse{note, ch, device}key up
midi/cc/<n>continuous0..1controller n (any channel)
midi/bendcontinuous-1..1pitch bend (any channel)
midi/ch/<ch>/cc/<n>continuous0..1controller n on one channel
midi/ch/<ch>/note/<n>continuous0..1velocity while note n is held, 0 on release
midi/ch/<ch>/bendcontinuous-1..1pitch bend on one channel
midi/ch/<ch>/pressurecontinuous0..1channel aftertouch
midi/ch/<ch>/poly/<n>continuous0..1polyphonic aftertouch on note n

With two or more MIDI inputs connected, each device also publishes under its slug (from the port name: Arturia MiniLab 3 → arturia-minilab-3, duplicates get -2, -3):

signalkindrangemeaning
midi/<slug>/note/onpulse{note, vel, ch}key down on that device
midi/<slug>/note/offpulse{note, ch}key up on that device
midi/<slug>/cc/<n>continuous0..1controller n on that device
midi/<slug>/bendcontinuous-1..1pitch bend on that device

On-screen controllers (modules.midi.controllers) publish one name per control, midi/<device>/<control> (for example midi/minilab3/knob1), plus /hit pulses for pads and /raw values. They are listed in MIDI controllers & embedding.

@openav/keys#

The on-screen piano, QWERTY playing and the simulated performer publish the legacy note names with a smaller payload:

signalkindrangemeaning
midi/note/onpulse{note, vel, ch: 0}key down (vel 0..1)
midi/note/offpulse{note, ch: 0}key up

@openav/chord#

signalkindrangemeaning
chord/consonancecontinuous-1..1harmonic consonance of last gesture
chord/countcontinuous0..10notes in last gesture
chord/rootcontinuous0..127lowest MIDI note of last gesture
chord/eventpulsefull analysis{notes, count, root, vel, pcs, consonance, isConsonant, isDissonant, isTriad, thirdsFraction, dissonanceLevel, chordType}

chordType: single · major · minor · sus2 · sus4 · dim · aug · maj7 · min7 · dom7 · halfdim7 · maj9 · min9 · dom9 · six · min6 · cluster (very dissonant pile) · chord (anything else). Inversions resolve to their root-position name via pitch-class rotation.

dissonanceLevel: 0 none · 1 mild (storm warning — foreshadow) · 2 severe (true cluster — commit to the decay language). Born from a real audience note at the IRCAM × C-LAB performance in Taipei: "dissonance detection wasn't strict enough."

@openav/audio#

signalkindrangemeaning
audio/rmscontinuous0..1loudness (smoothed)
audio/peakcontinuous0..1instantaneous peak
audio/band/lowcontinuous0..120–250 Hz energy
audio/band/midcontinuous0..1250 Hz–2 kHz energy
audio/band/highcontinuous0..12–8 kHz energy
audio/centroidcontinuous0..1spectral brightness
audio/onsetpulse{rms}transient over adaptive floor (100 ms refractory)
audio/kickpulse{level}20–120 Hz transient (90 ms refractory)
audio/snarepulse{level}150–800 Hz transient (90 ms refractory)
audio/hatpulse{level}6–14 kHz transient (60 ms refractory)
audio/kick/env /snare/env /hat/envcontinuous0..1decay envelope per drum (map straight onto params)

@openav/pose#

Mirrored by default (webcam-as-mirror). y flipped: 1 = raised.

signalkindrangemeaning
pose/presentcontinuous0/1someone visible
pose/hand/left/x /ycontinuous0..1left wrist (viewer's left)
pose/hand/right/x /ycontinuous0..1right wrist
pose/hand/left/v right/vcontinuous0..1wrist speed
pose/hands/spreadcontinuous0..1wrist-to-wrist distance
pose/heightcontinuous0..1nose height (crouch ↔ stand)
pose/leancontinuous-1..1shoulder-line tilt

@openav/pose — HandTracker (21-landmark fine control)#

Two hands from the camera, each with a gesture, a pinch you can trigger, and measures you can play. Distances are divided by the size of the hand and taken with x × the frame's aspect ratio, so neither the distance to the camera nor turning the hand sideways changes them. <side> is left or right.

signalkindrangemeaning
hand/<side>/presentcontinuous0/1hand visible
hand/<side>/x /ycontinuous0..1palm position (y: 1 = raised)
hand/<side>/pinch/index /pinch/middlecontinuous0..1thumb-tip ↔ index or middle tip ÷ 2.2 hand sizes (0 = touching; an open hand reads about 0.5)
hand/<side>/spreadcontinuous0..1index-tip ↔ pinky-tip, same scale
hand/<side>/tip/x /ycontinuous0..1index fingertip (y: 1 = top)
hand/<side>/thumb/index /middle /ring /pinkycontinuous0..1thumb-tip ↔ each fingertip, calibrated: 0 = touching, 1 = wide open
hand/<side>/opennesscontinuous0..10 = fist, 1 = all fingers out
hand/<side>/anglecontinuous0..1wrist → base of the middle finger: 0.5 = fingers up, 0.75 = pointing right, 0.25 = left
hand/<side>/speedcontinuous0..1palm speed, 1 = 3 frame heights per second
hand/<side>/pinchedcontinuous0/1thumb on index with the other three fingers out
hand/<side>/pinch-start /pinch-endpulse{side, x, y, distance}thumb ↔ index below 0.35 hand sizes starts, above 0.56 ends
hand/<side>/gesturecontinuous0..7the gesture held: 0 none, 1 fist, 2 open, 3 point, 4 thumb-up, 5 thumb-down, 6 victory, 7 iloveyou
hand/<side>/gesture/<name>continuous0/1fist open point thumb-up thumb-down victory iloveyou: score above 0.5 starts, below 0.35 ends
hand/<side>/gesture/<name>-startpulse{side, x, y, gesture, score}that gesture begins
hand/both/presentcontinuous0/1both hands visible
hand/both/distancecontinuous0..1palm centre ↔ palm centre (0.2 frame heights = 0, 1.0 = 1)
hand/both/x /ycontinuous0..1midpoint between the palms
hand/both/anglecontinuous0..1the line from the left palm to the right: 0.5 = level, above 0.5 = right hand higher

A new state counts after it has lasted 80 ms, and a lost hand ends its pinch and gesture at once. The thresholds are HandTracker's thresholds option (in a show, modules: { hands: { thresholds } }). Both trackers expose skeleton(ctx, w, h); hands.overlay(ctx, w, h) also draws the pinch line, the angle, the gesture and the distance between the hands.

@openav/leap#

Leap Motion / Ultraleap through the machine's bridge. Positions are the palm or fingertip inside the interaction box, normalized and clamped (x right, y up, z toward the performer). <side> is left or right, <finger> one of thumb index middle ring pinky.

signalkindrangemeaning
leap/statuscontinuous0..30 no bridge · 1 bridge, no tracking service · 2 no device · 3 tracking
leap/handscontinuous0..2hands in view
leap/hand/<side>/presentcontinuous0/1hand in view
leap/hand/<side>/x /y /zcontinuous0..1palm position
leap/hand/<side>/pinch /grabcontinuous0..1pinch and fist strength (0 when the hand is lost)
leap/hand/<side>/roll /pitch /yawcontinuous-π..πhand rotation in radians
leap/hand/<side>/speedcontinuous0..1palm speed, 1 = 1 m/s
leap/hand/<side>/<finger>/x /y /zcontinuous0..1fingertip position
leap/both/distancecontinuous0..1palm to palm, 1 = 40 cm
leap/hand/<side>/pinch-start /pinch-endpulse{side, x, y, z, strength}pinch above 0.86 starts, below 0.5 ends
leap/hand/<side>/grab-start /grab-endpulse{side, x, y, z, strength}fist above 0.8 starts, below 0.5 ends
leap/both/pinch-start /pinch-endpulse{x, y, z, distance}both pinch above 0.8 enters, either below 0.5 exits

@openav/drums (simulator — analyzer-shaped)#

The drum machine publishes the SAME shapes the audio analyzer publishes, so a world mapped to a kick cannot tell mic from machine (that's what a simulator is for). Sequencer hits also travel as midi/note/on (ch 10, GM notes).

signalkindrangemeaning
drum/kick /snare /hat /clappulse{level}a sequencer hit
drum/kick/env …continuous0..1decay envelope per lane (map straight onto params)
midi/note/onpulse{note, vel, ch: 10}kick 36 · snare 38 · clap 39 · closed hat 42

@openav/sound (output events)#

The in-page instruments listen to midi/note/on|off and the sustain pedal midi/cc/64, and announce one event of their own.

signalkindrangemeaning
sound/instrumentpulse{id, name}the instrument changed (picker, code or a cue)

@openav/record (take playback)#

A TakePlayer publishes a recorded take's events under their original names (midi/note/on, midi/ch/<ch>/note/<n>, midi/cc/<n>…), exactly as the keyboard did, plus two signals of its own.

signalkindrangemeaning
take/playingcontinuous0 / 11 while a take plays; 0 when paused, stopped, or yielded to live playing
take/positioncontinuous0..1how far into the take

@openav/remote · @openav/surface#

Phone sensors (/packages/remote/ → 感測). <id> is the device id; phone/any/… carries the value from whichever phone sent it last, so a World's routes can be written before any phone exists.

signalkindrangemeaning
phone/<id>/tilt/x /ycontinuous-1..1±45° from the calibrated rest pose, in SCREEN axes (x right, y toward you)
phone/<id>/accel/x|y|zcontinuousm/s²including gravity
phone/<id>/rot/alpha|beta|gammacontinuousdeg/srotation rate
phone/<id>/orient/alpha|beta|gammacontinuousdegraw deviceorientation
phone/<id>/knockpulse{strength, delta, t}acceleration jolt over a threshold (130 ms cooldown)
phone/<id>/lightcontinuous0..1front-camera mean luma
phone/<id>/touch/x /y /downcontinuous0..1finger 0; touch/<n>/… for n ≥ 1, touch/count
phone/local/…——the same sensor names when the show page ITSELF runs on a phone (localSensors(signals), no relay; also mirrored to phone/any/…)

Surface widgets (normalized 0..1; …/raw carries the unscaled value when the range is not 0..1):

signalkindmeaning
surface/<page>/<id>continuousfader · knob · number · toggle · button (0/1) · radio (idx/(n-1)) · encoder phase
surface/<page>/<id>/x /y /downcontinuousxy pad
surface/<page>/<id>/<1..N>continuousbank channels
surface/<page>/<id>/hitpulse {pad,row,col,vel}pads; …/<n> (n from 0) holds the velocity while down
surface/<page>/<id>/deltacontinuousencoder step in turns
surface/<page>/<id> (text)pulsethe string typed into a text widget
midi/note/on /off, midi/cc/64pulse / continuousthe 琴鍵 page and the keyboard widget — same names and shape as @openav/midi: {note, vel, velocity, ch: 1, device: 'surface'}

Receiving end: every relay message is filed by fileSignal(signals, name, value, {pulse}) (@openav/relay; bindSignals uses it, so do hosts with their own socket such as the lab's lab.js). It declares the name on first sight (signalMeta), and fills in whichever velocity spelling a midi/…/note/on|off sender left out (vel 0..1 ⇄ velocity 1..127).

Naming your own#

Path-style, source-first: breath/pressure, phone/{id}/gyro/x, weather/wind. Declare ranges with signals.define(name, {min, max}) so meters and norm() work; then just signals.set(name, v). Anything that changes can perform.

↑ Back to top · All chapters