Air Tap
No instrument needed. Your camera turns the space around you into an instrument. Touch, strum, or draw your own strings — then bring your ideas into the Studio. The longer the string, the higher its note. Once drawn, a string stays locked exactly where you put it.
Video stays on this device — hand tracking runs in your browser, nothing is uploaded. Works on iPhone Safari and on the Mac.
Air Tap
Your pocket studio — play in the air, sing, beatbox, chop samples and loop it all. No desk, no wires, just you and the music.
Play the air instrument above, sing into the mic, build drums and chop samples — everything loops together. Recordings stay in this tab until you export or save the project.
Tap-drag on the waveform to select a part. Then:
Phone, Headphone and Studio are EQ starting points, not microphone selectors. Your browser chooses the physical input. Pick a sound below. Each preset sets EQ + gentle compression + space for you — and draws it below so you can SEE what it did. They apply to the armed track's mic / vocal takes.
Autotune here is real web pitch-correction: it snaps recorded notes to the current scale by the strength you set. Browsers cannot run VST/AU studio plugins — no page can — so these are built-in web effects instead.
Use headphones: speaker sound can bleed into any microphone. App audio is not digitally mixed into this detector. Stop ends listening. This records notes, not lyrics or an audio vocal take. Hum and your pitch is written as notes on the armed track. Beatbox and hits land on the drum track — low thumps become kick, sharp snaps become snare, hiss becomes hat.
Use the audio on your selected track, or load a file in Sample lab. Results are added as new tracks.
Audio processing is not connected yet.
For a local service, use this computer. A phone needs a reachable HTTPS service.
Air Tap v9 — a camera-controlled musical playground. Create strings in the air, play them with your hands, and switch between harp, piano, guitar, flute, drums and synth. Hand tracking runs entirely on this device; no video is uploaded.
Instrument samples. The harp, piano, guitar and flute voices play samples from the FluidR3 General MIDI soundfont by Frank Wen and contributors, pre-rendered as MIDI.js soundfonts by Benjamin Gleitzman. Source: github.com/gleitz/midi-js-soundfonts. The samples are bundled with this page (five C notes per instrument, C2–C6) and pitch-shifted locally at playback — that pitch-shifting is the only adaptation. If the samples cannot play, a Karplus-Strong synthesized voice takes over so no instrument is ever silent.
Sample licence: Creative Commons Attribution 3.0 — creativecommons.org/licenses/by/3.0. These are SoundFont-rendered instrument samples, not newly recorded performances. The drums are synthesized in the browser by design — no drum recordings are used.
Hand tracking: MediaPipe Hand Landmarker (Google), Apache License 2.0, loaded from CDN at runtime. The offline single-file packaging of the tracker is a later step.
Honest limit: camera and audio could not be tested in the build sandbox — the live feel of the gestures is unverified until played on a real device.
AIR TAP — TRACKING UPDATE
Current implementation: GPU inference with CPU fallback; decoded-frame scheduling;
palm-relative pinch thresholds; shared overlay/hit positions; independent five-finger
sensitivity and steady-hand calibration; hysteresis on each finger/string hit.
Short strings: 18 CSS px minimum. Camera pinch-click erase: release within
450 ms and under 22 px travel, within a 14 px acquisition band. Endpoints stay fixed.
Model timing shown is inference time, NOT total camera-to-speaker latency.
Real camera accuracy and end-to-end latency still require device testing.
Historical design notes follow; the update above supersedes old thresholds.
AIR TAP — ORIGINAL BUILD SPEC
Version 9 · v8 spec plus the owner's live-test tuning (21 Nov 2026).
The change ledger takes precedence over every older spec.
============================================================
V9 TUNING — OWNER LIVE-TEST FIXES (21 Nov 2026)
============================================================
- STRUMS FIRE CLEAN: pluck speed threshold 900 -> 420 CSS px/s,
acquisition band 40 -> 56 CSS px, per-string cooldown 70 -> 35 ms,
velocity curve rescaled (full loudness by ~2200 px/s). A normal
flick strums every time — no more travelling far to trigger.
- FINGERS TRACK FAST AND STRONG: One Euro retuned — minCutoff
1.5 -> 3.0 Hz, beta 0.015 -> 0.05, derivativeCutoff 1 -> 2 Hz;
pinch debounce 100 -> 60 ms; a returning hand can pluck after
60 ms of stable tracking (was 120 ms).
- CREATE IS INSTANT: the two index tips only need to touch
(0.075 normalised) for 40 ms before the draw starts (was 0.06 for
120 ms). Spread to stretch, pinch either hand to lock the length.
- ERASE IS A PINCH-CLICK: ONE hand — index + thumb pinched right on
a string and released quickly (under 280 ms, under 20 px of
travel) — erases it instantly. Thumbs-together still works as a
secondary. Touch fallback unchanged (hold / two-finger).
- STRINGS ARE LOCKED: once created, a string's endpoints NEVER
move. The v8 slow-move carry is removed; every grab release rings
in place, and a hard pull flexes the rendered line by at most
14 px. Strumming touches can never drag a note.
- HAND OVERLAY IS 1:1: all 21 landmarks drawn as small joint dots
at their exact mapped points, thin bones, fingertip markers
2.8 px core / 5.5 px halo (was 4.6 / 10) — the drawn hand sits
exactly on the real hand, same size, no oversized skeleton.
============================================================
V8 CHANGE LEDGER — DO NOT RESURRECT OLD BEHAVIOUR
============================================================
- CREATE: touch the two index fingertips together for 40 ms (v9;
was 120 ms in v8), spread both hands freely to any length, then
PINCH either hand to finish. This replaces commit-on-stillness,
commit-on-separation, and the index-fold commit. Drafts under
26 CSS px are discarded. Max 24.
- ERASE (camera): ONE-hand pinch-click on a string erases it
instantly (v9; see section 9). The v8 thumbs-together erase is
kept as a secondary. Touch fallback keeps the 1-second
press-and-hold erase.
- PRESETS: 10 initial vertical strings (was 7); + / − steps 3 to 24.
- PITCH: longer string = HIGHER note (owner's rule, unchanged), now
computed per string from its own length: about two octaves, A2 to
A4, snapped to the selected scale (section 11).
- PLUCK: 56 CSS-px acquisition band plus a genuine swept fingertip
crossing, speed above 420 CSS px/s, 35 ms cooldown per string
(v9; v8 was 40 px / 900 px/s / 70 ms).
- PINCH: enter 0.044, release 0.062 (normalised thumb–index distance),
60 ms state debounce (v9; v8 was 100 ms).
- HAND IDENTITY: hands keyed by the MediaPipe Left/Right label, never
by horizontal position. A second hand cannot steal a held string.
- SOUNDS: CDN sample streaming is gone. Harp, piano, guitar and flute
play the embedded offline sample bank bundled with the page
(FluidR3, five C notes each, C2–C6, pitch-shifted at playback,
CC BY 3.0 — credit in the About panel). Karplus-Strong is the
fallback, never silence. Drums: three honest synthesized pads only —
Kick, Snare, Hi-hat. The v7 clap pad is removed.
- PIANO: 7–12 air keys; a note triggers when a fingertip crosses the
key's upper strike plane downward faster than about 150 CSS px/s;
re-arm only after rising above a release plane (vertical hysteresis).
- FLUTE: hand height = pitch, hold to sustain, sideways movement =
small vibrato (max about 20–35 cents), 30–60 ms glide between notes.
- SYNTH: two submodes — Pads (held zone chords) and Lead (one
continuous voice steered by hand height).
- SMOOTHING: One Euro filter, minCutoff 3.0 Hz, beta 0.05,
derivativeCutoff 2 Hz (v9 retune for fast, strong tracking; v8
shipped 1.5 / 0.015 / 1).
- TRACKING: MediaPipe tasks-vision 0.10.14 HandLandmarker from CDN,
CPU delegate, confidences 0.7 / 0.5 / 0.5. The 27 MB WASM + model
files are NOT embedded in this web build — offline single-file
packaging is a later step.
- KEPT FROM V7: six instruments with one-tap picker, touch fallbacks
mirroring every gesture, working Touch mode when the camera is
denied, chord toggle, scales (minor pentatonic default, major,
natural minor), fixed string endpoints with only small damped
vibration, Layout Lock option, last-note readout.
- HONEST LIMIT: camera and audio could not be tested in the build
sandbox — live feel is unverified until played on a real device.
============================================================
1. PRODUCT SHAPE
============================================================
- One self-contained page plus one bundled data file (the sample
bank). Camera view fills a stage; a canvas overlays it.
- Hand tracking: MediaPipe tasks-vision 0.10.14 HandLandmarker in the
browser (max 2 hands). Nothing is uploaded; processing is on-device.
- Two layouts for the string instruments (Harp, Guitar):
- HARP: a preset set of vertical strings (3 to 24, default 10),
evenly spaced. A convenience preset, not the core model.
- AIR: the stage starts empty. Every string on it was drawn by the
user and can sit anywhere, at any angle, at any length (minimum
about 26 CSS px). Preset and Air layouts are kept separately in
memory; switching does not destroy the other.
- A touch / mouse fallback mirrors every gesture (section 14), and
Touch mode works fully when the camera is denied.
============================================================
2. COORDINATE SYSTEM — THE NO-GLITCH CORE
============================================================
Rule zero: there is exactly ONE mapping from camera landmarks to
screen space, and BOTH the renderer and every hit-test use it.
- Landmarks arrive normalised to the camera image (x right, y down,
as the camera sees the scene — NOT mirrored).
- The front camera is displayed mirrored (CSS scaleX(-1)) so the user
sees a mirror image; the rear camera is not mirrored. Convert each
landmark ONCE, at ingest: nx = 1 - lm.x when mirrored, else lm.x.
- The video uses object-fit: cover, so apply the same cover-crop
maths or fingertips drift from their dots toward the edges:
s = max(stageW / videoW, stageH / videoH)
kx = (videoW * s) / stageW, ky = (videoH * s) / stageH
X = nx * kx - (kx - 1) / 2, Y = ny * ky - (ky - 1) / 2
- ALL geometry lives in stage-normalised coordinates; multiply by
stage W / H only when a CSS-pixel distance is needed. All
interaction thresholds are in CSS pixels — devicePixelRatio affects
only the canvas backing store, never thresholds or velocities.
- Pinch and join distances are measured in camera-normalised landmark
coordinates (raw landmarks), kept as a separate, named unit system.
- Strings are stored normalised, so a resize needs no string maths in
Air mode; pitches are recomputed from the new pixel lengths.
============================================================
3. HAND TRACKING SETUP (tasks-vision 0.10.14)
============================================================
- HandLandmarker.createFromOptions(wasmFileset, {
baseOptions: { modelAssetPath: official hand_landmarker.task,
delegate: "CPU" },
runningMode: "VIDEO", numHands: 2,
minHandDetectionConfidence: 0.7,
minHandPresenceConfidence: 0.5,
minTrackingConfidence: 0.5 })
- detectForVideo(video, monotonicTimestampMs) runs once per NEW video
frame (guarded by video.currentTime), never twice on the same frame.
- Camera: audio false, facingMode user, ideal 1280x720, frameRate
ideal 60 / max 60; on constraint failure retry with plain video.
Stop tracks before flipping; reset hand histories on flip.
- HAND IDENTITY: every per-hand state record is keyed by the
MediaPipe handedness label ("Left" / "Right"), never by array index
or horizontal position. If labels are missing, fall back to a
positional key; if two hands claim the same label, the duplicate is
drawn but cannot interact — a grab is never transferred.
- LOSS: a hand missing for 2 consecutive inference frames is
finalised WITHOUT a pluck, erase or release sound; an uncommitted
draft is cancelled, not committed. On reacquisition, crossing
history is reset and plucks stay blocked for about 60 ms of stable
tracking, so a returning hand cannot fire a phantom note.
============================================================
4. SMOOTHING — ONE EURO FILTER
============================================================
- Every landmark coordinate (x and y, per hand identity, per
landmark) runs through its own One Euro Filter (Casiez, Roussel,
Vogel 2012): cutoff = minCutoff + beta * |filtered speed|.
Shipped parameters (v9): minCutoff 3.0 Hz, beta 0.05 per CSS px/s
(applied per axis, so the px-based tuning holds in stage space),
derivativeCutoff 2 Hz. Resting hands sit dead still; fast strums
pass with almost no lag. A Smoothness slider in Controls retunes
minCutoff live.
- Velocity is measured from consecutive filtered fingertip positions
with their real timestamps — never a hard-coded 1/60 s.
- Pinch DETECTION uses the RAW landmark thumb–index distance with
hysteresis and debounce (section 6); geometry uses filtered points.
============================================================
5. STRING DATA MODEL
============================================================
A string is a free segment, never an x-position:
{ id, ax, ay, bx, by (stage-normalised endpoints), midi, name, freq,
glow, lastPluck, grabbedBy (hand key / "touch" / null), grabU,
grabX, grabY, grabStartX, grabStartY, grabT0, spring, spawnAt }
Maximum 24 strings. Minimum length about 26 CSS px. Resting
endpoints are immutable: a pluck can never alter them, and since
v9 NOTHING can — a created string is locked where it was drawn;
grabs only ring it in place, erase removes it whole.
============================================================
6. PINCH — THE SHARED PRIMITIVE
============================================================
- Raw normalised thumb-tip (4) to index-tip (8) distance, hysteresis:
pinch candidate starts under 0.044, ends over 0.062.
- 60 ms STATE DEBOUNCE (v9; v8 was 100 ms): the effective pinch state
flips only after the candidate state has held for 60 ms. Edges are
generated from the debounced state, so a trembling boundary fires
nothing twice.
- The pinch POINT used for geometry is the midpoint of the two
SMOOTHED tips, in stage space.
- A pinch that finishes a draft is consumed: it cannot also grab the
string it just created. Pinch release is required before the next
acquisition.
============================================================
7. GESTURE — CREATE A STRING (AIR MODE, OWNER-APPROVED)
============================================================
State machine, evaluated per inference frame (string instruments,
Air layout, Layout Lock off, both hands stable and free):
- JOIN: the two index tips (landmark 8 of each hand) come within
0.075 normalised distance and stay there for 40 ms (hysteresis: the
timer survives a drift out to 0.10, resets beyond it). One draft is
born; both hands enter the drawing state and own its endpoints.
Starting a draft silently cancels any grab either hand was holding.
- DRAW: the draft follows both smoothed index tips in any direction,
at any length. Separation alone NEVER commits — spreading wide is
the whole point of the gesture.
- FINISH: a debounced pinch on EITHER hand commits exactly those
endpoints. Under 26 CSS px the draft is discarded (a touch, not a
string). At 24 strings the draft is refused with clear feedback and
nothing is deleted. Lost tracking cancels the draft silently.
- No snapping, no minimum angle, no grid. Freedom is the spec.
============================================================
8. GESTURE — GRAB, PULL, RING (STRINGS ARE LOCKED, v9)
============================================================
- ACQUIRE: a debounced pinch start near an unlocked string (within
the 56 CSS-px band) captures its ID, original endpoints, pinch
point and start time. string.ownerHandId locks it; a second hand
cannot steal it.
- While held, the string BOWS slightly toward the pinch point —
the rendered flex is capped at 14 CSS px; the resting endpoints
stay exactly where the string was created.
- RELEASE always rings in place: gain follows the perpendicular
pull distance, and a short damped return animation plays through
the centre. There is NO move: the v8 slow-move carry (held
350 ms+, rigid translation) is removed — a created string is
fixed, and strumming or pulling can never drag it.
- A quick pinch-CLICK release (under 280 ms, under 20 px travel)
erases instead of ringing — see section 9.
- In HARP layout every release rings; preset strings never move.
============================================================
9. ERASE — PINCH-CLICK (CAMERA) / HOLD (TOUCH)
============================================================
- CAMERA (primary, v9): ONE hand — pinch index + thumb together
right ON a string and let go quickly (the whole click under
280 ms, the pinch point travelling under 20 CSS px). The string
is deleted the moment the pinch releases — one string, one small
puff, no dwell, no second hand needed. A pinch that pulls (over
20 px) rings instead of erasing; a pinch held still for 1 second
also erases (the kept secondary). Suppressed while drawing and
while Layout Lock is on.
- CAMERA (secondary, kept from v8): when both thumb tips (landmark
4 of each hand) enter a shared touch (0.055 normalised enter,
0.085 release), the nearest resting string within 70 CSS px of
their mapped midpoint is deleted IMMEDIATELY. Latched until the
thumbs separate, so holding the touch cannot cascade-delete.
Thumbs touching in empty space delete nothing. Edge-drag
deletion is banned: corners are homes, not bins.
- TOUCH fallback: press still on a string for 1 second to erase (a
ring fills so it can be cancelled by moving); two fingers pressed
together erase the nearest string the same way thumbs do.
- Clear wipes the active string layout only — a separate button.
============================================================
10. STRUM AND PLUCK DETECTION
============================================================
- Idle-hand fingertips 8, 12, 16, 20 (index to little). A pluck needs
a GENUINE SWEPT CROSSING: the fingertip's signed perpendicular
distance to the string changes sign between frames (a slide along
the string cannot fire), with the crossing point inside the segment
extended by the 56 CSS-px acquisition band at each end — a fast
sweep that finishes more than 56 px past the string still counts,
because the swept path, not the final point, is what is tested.
- Speed must exceed 420 CSS px/s (Pluck feel slider rescales this).
Velocity curve: v = clamp((speed - 420) / (2200 - 420), 0, 1);
gain = 0.2 + 0.7 * sqrt(v). 35 ms per-string cooldown.
- Blocking rules: a grabbing or drawing hand strums nothing; a
pinching hand's thumb and index do not strum; a grabbed string is
never strummed; Layout Lock never blocks playing.
============================================================
11. PITCH, SCALE AND CHORDS — LONGER IS HIGHER
============================================================
- Per-string pitch from its own length (free strings):
L = length in CSS px, D = stage diagonal
u = clamp((L - 26) / max(1, D - 26), 0, 1)
fRaw = 110 * 2^(2u) (A2 110 Hz to A4 440 Hz)
midi = nearest scale note to 69 + 12 * log2(fRaw / 440)
Preset (Harp layout) strings share one length, so they take scale
notes in ascending order instead. Pitch depends on length, never on
screen x or creation order. Retune on create, move, erase, scale
change and resize; the played note name is always shown.
- Scales — pitch classes above A:
Minor pentatonic (default) 0 3 5 7 10
Major 0 2 4 5 7 9 11
Natural minor 0 2 3 5 7 8 10
- CHORD toggle: a pluck also plays the root's third and fifth from
the underlying diatonic key (A natural minor harmony under
pentatonic roots), staggered about 45 ms, at 0.8 of the velocity.
- STRUM CHORD button rings scale degrees 1, 3, 5 in sequence.
============================================================
12. AUDIO ENGINE — EMBEDDED SAMPLES + KARPLUS-STRONG
============================================================
- The AudioContext is created / resumed inside the first user gesture
(Start, or any control tap). Voices route: instrument bus, master
gain (default 60 percent), dynamics compressor, destination. A
generated-impulse convolver adds adjustable reverb (default 15
percent wet). A real mute toggle (Sound) exists. Roughly 24
simultaneous voices max, chord voices included.
- SAMPLE BANK (bundled file, no network): harp, acoustic piano,
steel-string guitar and flute each carry C2, C3, C4, C5, C6 samples
(FluidR3 General MIDI, CC BY 3.0 — see About). Decoded lazily per
instrument, cached as AudioBuffers, transposed from the nearest
sample: playbackRate = 2^((targetMidi - sourceMidi) / 12).
- FALLBACK: if the bank is missing or a decode fails, Karplus-Strong
synthesis plays instead (noise burst into a feedback delay line at
sampleRate / freq, cached per pitch) and the status line says so
honestly. An instrument is never silent.
- DRUMS are synthesized by design (section 17): pitch-swept sine
kick, band-limited noise snare, high-passed noise hi-hat. No drum
samples, and no clap pad.
- Harp feel: soft attack, clear short decay. Guitar: stronger pick
transient, darker damping, slightly shorter tail.
============================================================
13. GEOMETRY AND STRING FEEL
============================================================
- The renderer never integrates gravity into endpoints. Vibration is
a temporary perpendicular offset of the sampled line, envelope
sin(pi * s) so the ends stay anchored: ordinary plucks displace
2–6 CSS px and decay exponentially over about 0.3–0.6 s; pull
releases get a larger, firmly damped return. The v5 rubber band is
banned: amplitude scale 0.45, exp(-6.2 t) * cos(26 t).
- Readable over a camera: bright core at least 3.4 CSS px wide over a
wide soft halo, idle alpha floor 0.78, note name at the midpoint.
New strings fade in; deleted strings leave a tiny fading ghost.
- Layout Lock permits playing while suppressing create / erase. Off
by default, so the taught gestures work immediately. (Since v9,
strings never move whether Lock is on or off.)
============================================================
14. TOUCH / MOUSE FALLBACK
============================================================
- One primary pointer. Press near a string (within 36 px) grabs it —
same pull and ring rules as the pinch; strings never move (v9);
hold still 1 s erases.
- Press on EMPTY space and drag draws a draft; release commits it at
26 px or longer. Exception: a fast flick (under 220 ms) that crossed
an existing string was a strum, not a drawing — discard it.
- Dragging across strings without grabbing strums them (same swept
crossing test). Double-tap creation is NOT used.
- Piano: tap keys (sliding glissandos). Drums: tap pads. Flute: press
and slide vertically. Synth: press-drag — zone sounds, x sweeps
the filter (Pads) or height steers the voice (Lead).
- Pointer Events with pointer capture semantics, touch-action none,
pointercancel cleanup. UI taps never fall through to the canvas.
============================================================
15. PIANO — AIR KEYS WITH STRIKE PLANES
============================================================
- 7–12 large keys in a lower play band (count follows stage width),
labelled with note names, tuned to the current scale from A3.
- Each key has an UPPER STRIKE PLANE (its top edge) and a RELEASE
PLANE above it. A note triggers when a fingertip crosses the strike
plane DOWNWARD faster than about 150 CSS px/s; attack strength
follows the downward speed. A resting fingertip never retriggers:
the finger must rise above the release plane to re-arm (vertical
hysteresis). Each finger keeps its own latch. Chord mode adds the
section 11 harmony. Touch taps play the same keys.
============================================================
16. FLUTE — HEIGHT, SUSTAIN, VIBRATO
============================================================
- One primary hand (stable identity — a second hand cannot steal the
note). Hand height in the playable band maps to pitch across two
octaves snapped to the scale: higher hand, higher note.
- Hold = sustain. Note changes GLIDE over 30–60 ms (playback-rate
ramp on the sample voice) instead of re-attacking. Because samples
are finite, a note held past the sample's length re-articulates
softly as a fresh phrase. Sideways movement drives a small vibrato,
max about 20–35 cents; no sideways movement, no vibrato.
- Folding the fingers, pinching, losing the hand, switching
instrument or muting releases the voice — no drone is left ringing.
- A pitch rail on the right edge shows the scale and the live note.
- Not a promise: a webcam detects no real breath. This is a
hand-controlled instrument mode, not breath sensing.
============================================================
17. DRUMS AND SYNTH — KEYS AND PADS
============================================================
- DRUMS: three clearly separated pads — KICK, SNARE, HI-HAT. A
fingertip entering a pad faster than about 300 CSS px/s strikes
it; the finger must exit before it can strike again; about 100 ms
per-pad cooldown; visible strike pulse. Synthesized sounds only:
kick = pitch-swept sine, snare = band-limited noise plus body,
hi-hat = high-passed noise burst. Scale and chord controls are
disabled for drums. Touch taps the pads.
- SYNTH submodes (toggle in the bar):
- PADS: four vertical zones, each holding a scale triad; any
fingertip inside a zone holds its chord with a slow pad envelope;
the average wrist x sweeps a lowpass filter, about 240 Hz at the
left edge to about 5.8 kHz at the right.
- LEAD: one continuous sawtooth voice steered by primary-hand
height (same height-to-scale mapping as the flute), 30–60 ms
glide, filter following the hand's x.
- Switching instruments releases every held voice, clears zone
latches and crossing histories; the first frame in a new instrument
can never count as a strike.
============================================================
18. GESTURE ARBITER — PRECEDENCE PER FRAME
============================================================
1. Missing identities and camera resets. 2. Continue or finish an
existing two-hand draw. 3. Continue owned grabs (a quick pinch-click
release erases its string instead of ringing it — section 9).
4. Thumb-erase edge (secondary), only if neither hand owns a draft
or grab. 5. Start an eligible index join. 6. Acquire new pinch
grabs. 7. The selected instrument's play logic for the remaining
idle hands. Commit, delete and note-on are edge-triggered: one
event, one effect. Changing instrument cancels incompatible states
safely.
============================================================
19. INTERFACE
============================================================
- Start card: three ideas — draw (index tips, spread, pinch), flick
to play, Edit strings to erase — plus Start camera / Play with touch.
- Control bar: instrument picker; Harp / Air layout switch (string
instruments); scale chips; Chord; Strum chord; Layout lock; synth
submode toggle; string count + / − or + String / Clear; Camera,
Flip, Sound, Controls, Build spec, About. Last-note readout always
visible. Buttons at least 44 CSS px, safe-area insets respected.
- Controls drawer: Smoothness, Pluck feel, Master volume, Reverb.
- Status line reports the sound bank honestly: embedded samples
ready, or Karplus-Strong fallback, per instrument. Tracking state
shows plainly ("2 hands", "Tracking lost") — no debug dashboard.
============================================================
20. PERFORMANCE, FAILURE, AND WHAT IS NOT CLAIMED
============================================================
- Render on requestAnimationFrame; inference once per fresh camera
frame; audio on its own sample clock. If frames slow down, reduce
glow and inference frequency before ever thinning strings or
reducing hit accuracy. Tracking loss is shown, never hidden behind
extrapolated hands that can still trigger notes.
- Camera denied, missing or busy: a readable explanation and a fully
working Touch mode. Every error leads to a recoverable UI, never an
empty canvas.
- NOT in this build: embedding the 27 MB tracker WASM + model for a
fully offline single file (later step); breath sensing; any claim
of tested latency. Camera and audio could not be tested in the
build sandbox — live feel is unverified until played on a real
device (Mac Chrome and iPhone Safari are the targets).
============================================================
21. ACCEPTANCE TESTS
============================================================
1. Join 39 ms then separate: no draft. At 40 ms stable join:
exactly one draft. Spread wide past 0.12 normalised: the draft is
still alive. Pinch either hand: it commits exactly once, and that
pinch does not grab the new string.
2. Draft under 26 px: discarded. At 24 strings: clear feedback,
layout unchanged.
3. Hover and slide along a string: silent. A normal swept crossing
over 420 CSS px/s: rings once. Same string cannot retrigger
inside 35 ms. A sweep ending far past the string still counts.
4. Pinch hysteresis: 0.044 enters after the 60 ms debounce; 0.050
stays pinched; over 0.062 releases after debounce.
5. Locked strings: quick pull (under 350 ms, over 45 px
perpendicular): original endpoints, ring, damped return. Slow
drag (350 ms+, any distance): endpoints STILL unchanged — the
string rings in place and never follows the hand.
6. Pinch-click erase: one hand pinches on a string and releases
inside 280 ms with under 20 px travel: the string is gone at
once. A pinch that pulls does NOT erase. Thumb erase: one
nearest string within 70 px removed instantly; holding the
touch deletes nothing more; thumbs in empty space delete
nothing; no erase mid-draw or mid-grab.
7. Hands cross: Left/Right ownership stable; no grab theft, no
teleport. Hand lost for two frames and returning: no sound, no
delete, velocity history reset, 60 ms before plucks resume.
8. Pitch: longer strings never sound lower than shorter ones in the
same layout; note names correct; chords sound intentional;
scale change retunes everything.
9. Instruments: harp and guitar strum on embedded samples; piano
strike planes with re-arm hysteresis; three drum pads; flute
height, glide and vibrato; synth pads and lead. Switching
mid-note leaves nothing hanging.
10. Touch: press-drag draws, tap plays, 1-second hold erases, UI
taps do not leak through; Touch mode fully works with the camera
denied.
END OF SPEC