PROJECT 03 / SOUND / TWO PLAYERS

Echo
Garden.

A shared instrument for two people in WebXR. Each player plants notes on a panel with a controller beam. A note's height sets its pitch and its depth sets its echo. Notes that come close are linked, and the links play as a melody, in space, around both players.

How the scene works

  1. The controller beam finds a spot on the panel or the nearest note. A click plants a note, holding moves one, and pushing the hand forward pulls it out of the panel.
  2. Every change is a message. Both headsets apply the same messages with the same rules, so they keep the same garden.
  3. Each headset computes the links and the beat from that garden and its clock, and plays every note through an HRTF panner at the note's position.

INTERACTIVE STUDY

Interactive study

01—07How the garden is built, in seven levels

A step-by-step course that runs the scene's own code in the browser: shared state and messages, pointing with a beam, grabbing, links, synthesized notes, spatial sound, and two players over a network.

01One garden, many messages↗

A small shared state, changed only by messages that every headset applies with the same rules.

02Pointing with a beam↗

Where a beam meets the panel, and which note it passes closest to: a ray, a plane and a dot product.

03Grab once, move every frame↗

From trigger state to press, drag, release, click and double press; deciding the note once and moving it in depth.

04Who sings with whom↗

Links between nearby notes, duets first, one partner each, computed the same way on every headset.

05A note from a position↗

Height becomes pitch, colour becomes timbre, depth becomes echo: oscillators, envelopes and a pentatonic scale.

06Sound in space↗

An HRTF panner for each note and a listener that follows your head. Bring headphones.

07Two players, one garden↗

server.send and server.sync, the batch that got lost, the fix in gardenNet.js, and a beat both headsets share.

The code on these pages is a snapshot of the scene, copied into /source/. Changes you make here stay on the page and never affect the scene.