AI CHOREOGRAPHY / THE AI / LEVEL 4 OF 5
A duet with
your own body.
Point at the coach and hold the trigger: the coach copies you live, and every two beats the game keeps a snapshot of where your hands are. Release, and your phrase starts looping at once while the AI is asked for four moves that answer it. Then the coach dances your moves and the AI's reply in turn, the reply in purple. Here you drag the player's hands with the mouse.
You and the coach
drag your hands (the coloured dots on the left figure)The routine the coach is dancing
The trigger
free practicecoach.live: your pose in body numbers
What happened
This page has no AI. A stand-in writes the reply by mirroring and flipping your first pose; the real scene sends your poses to the AI with coachReplyPrompt (level 1). The reply still goes through the real validateCoachReply.
Recording on the beat
coach.jsEvery frame while recording: turn each hand into body numbers (relative to the head, divided by the player's size, the left hand's outward axis flipped), share them as coach.live so the coach copies you, and when the pose number changes keep a snapshot. Four snapshots finish the phrase.
Release: play now, ask the AI
coach.jsYour phrase becomes the routine immediately. The answer is checked, appended after your moves, and humanCount remembers where yours end, which is what turns the coach purple for the reply.
What you should be able to explain
- Body numbers. A hand is stored relative to your head and divided by your size, so a tall and a short player making the same move get the same numbers, the same as the built-in poses and the AI's poses.
- Snapshots on the beat. The game does not record a video of your motion. It keeps one pose each time the pose number
kchanges, every two beats, so your phrase already fits the music. - Live, then saved.
coach.liveis shared every frame so the partner sees the coach copy you; the snapshots become the phrase only on release. - No waiting. Your phrase starts looping at once. The AI's answer, when it comes, is appended; if it fails, your phrase simply keeps playing.
Exercises: ① Change your height and keep the hands where they are: why do the numbers change? ② Record only one pose and release: what happens, and which line decides it? ③ What would the AI see if poses were recorded every frame instead of every pose?