Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ continuity in the system to make the columns match — **the asymmetry *is* the
![Performance mode — the chrome falls away, the phrase goes large](docs/screenshots/performance-mode.png)

Press <kbd>P</kbd> and the instrument becomes a stage: the chrome falls away, the phrase the
body is answering goes large, playback slows to half speed to be followed by a body — but
body is answering goes large, the speed is yours to set so a body can follow it — but
the **poem keeps growing**, and you can still write and generate live, in front of the room.

The audience does not just watch generated movement — they watch the **evolution of
Expand Down
14 changes: 11 additions & 3 deletions docs/lecture-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ software does is in service of making those two moments possible.
![Performance mode — the instrument chrome falls away, the phrase goes large](screenshots/performance-mode.png)

Hit **Perform** (or press <kbd>P</kbd>) for the projectable stage: the instrument chrome
falls away, the phrase goes large, playback slows to half speed to be followed by a body —
falls away, the phrase goes large, the speed is yours to set so a body can follow it —
but the **poem keeps growing** and you can still write and generate live, in front of the
room.

- The background drops to near-black, chosen for a projector in a dark room.
- Playback re-seats to **0.5× tempo**, because a body has to be able to follow it.
- Playback opens at **real time**, and every speed down to 0.1× is a keypress away
(<kbd>T</kbd>, or <kbd>[</kbd> <kbd>]</kbd>). A body has to be able to follow and re-embody
what it sees — but how slow that needs to be is the performer's judgement, not a default.
- **The camera follows the body**, easing after the pelvis so a line that travels several
metres stays on screen and inside the spotlight. It moves the viewpoint, never the motion —
the travel is still there, still on the floor and still in the floor-path register.
- The phrase the body is answering right now is set large and centred; the lines still
waiting stay in the poem on the left.
- <http://localhost:5173/?perform=1> boots straight into it, for plugging into a projector.
Expand All @@ -53,7 +58,10 @@ room.
|---|---|
| <kbd>P</kbd> | enter / leave performance mode |
| <kbd>space</kbd> | play / pause |
| <kbd>T</kbd> | cycle tempo (0.5× → 0.25× → 1×) |
| <kbd>T</kbd> | cycle the speed, wrapping round every value |
| <kbd>[</kbd> <kbd>]</kbd> | step the speed slower / faster |
| <kbd>F</kbd> | camera follow on / off |
| <kbd>O</kbd> | the phrase shown / hidden |
| <kbd>R</kbd> | read the four notation registers |
| <kbd>C</kbd> | compare models (the triptych) |
| <kbd>N</kbd> | one line / the whole poem |
Expand Down
30 changes: 22 additions & 8 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,28 @@ quietly half-built.
the body: the spotlight is a radial gradient pinned to the centre of the viewport, so a body
at 3.9 m stands outside its own light.

A camera that followed the pelvis would fix that **without touching the data**, which is a
different thing from pelvis-aligning the motion and does not reopen the decision above. But
with the ghost-cloud on it cannot be done innocently: following the selected line's body
drifts the far siblings out of frame, and the far siblings are where that ~75% lives.
Following the centroid centres nobody. So **what a follow camera should follow is a research
decision rather than a UI default**, and it waits on seeing the extended floor from the back
of a room — the judgement Track 3 of [`v4-proposal.md`](v4-proposal.md) says should not be
made at a desk.
**The camera now follows the body in performance mode, and only there.** It eases after the
pelvis in x and z, panning the camera and its orbit target together so the viewer's angle and
distance survive, and it moves **the viewpoint and never the motion** — a different thing
from pelvis-aligning, which does not reopen the decision above. Measured on a body covering
SnapMoGen's 3.89 m: on screen for 55% of the phrase before, 100% after, trailing the pelvis
by at most 0.27 m. The bench keeps a fixed world frame, because travel is easier to judge
against ground that holds still, and the triptych never gets it at all — equalising travel
across the panels would hide the difference between a model that covers 3.89 m and one that
covers 0.09 m, which is the comparison those panels exist to make.

**Two things it does not settle.**

*What to follow when the ghost-cloud is on.* It follows the selected body; the siblings stay
where the model put them, so the far ones leave the frame — and the far ones are where that
~75% lives. Following the centroid centres nobody. This stays a research decision rather
than a UI default, to be made from the back of a room and not at a desk, which is what
Track 3 of [`v4-proposal.md`](v4-proposal.md) asks for.

*The spotlight still does not travel.* It is a radial gradient pinned to the centre of the
viewport, so following the body happens to fix the symptom — the body is centred again, and
therefore lit — without fixing the cause. A body deliberately left off-centre, or a second
figure, would still be outside the light.

**From v2 — the poem's unfinished edges:**

Expand Down
47 changes: 42 additions & 5 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ hunting for a mouse in front of an audience.
| <kbd>C</kbd> | **Compare** — open / close the multi-model triptych |
| <kbd>P</kbd> | **Perform** — enter / leave performance mode |
| <kbd>space</kbd> | play / pause |
| <kbd>T</kbd> | cycle tempo: 0.5× → 0.25× → 1× |
| <kbd>T</kbd> | cycle the speed, wrapping round: 0.1 · 0.25 · 0.5 · 0.75 · 1 · 1.5 · 2 |
| <kbd>[</kbd> <kbd>]</kbd> | step the speed slower / faster through every value the control offers |
| <kbd>G</kbd> | ghost-cloud on / off |
| <kbd>F</kbd> | **follow** — the camera tracks the body, or stops |
| <kbd>O</kbd> | the phrase under the body, shown or hidden |
| <kbd>esc</kbd> | leave the current mode; from a line, unfocus it |

**In the poem:** <kbd>enter</kbd> starts a new line, <kbd>backspace</kbd> at the start of a
Expand Down Expand Up @@ -85,6 +88,13 @@ clicking through chrome in front of a room.
| `localhost:5173/?registers=1` | straight into the four notation registers |
| `localhost:5173/?compare=1` | straight into the triptych |
| `localhost:5173/?perform=1` | straight into the projectable performance stage |
| `…/?follow=1` · `?follow=0` | camera follow on or off, whatever the mode would have chosen |
| `…/?phrase=0` | boot with the phrase hidden — the body alone on the stage |
| `…/?speed=0.25` | any speed the control offers: 0.1, 0.25, 0.5, 0.75, 1, 1.5, 2 |

The three above are read **after** the mode flags, so an explicit choice beats the mode's
default — `?perform=1&follow=0` opens the stage with a still camera. A `?speed=` that is not
one of the offered values is ignored rather than guessed at.

---

Expand All @@ -105,8 +115,11 @@ Around the stage:
- **Poem rail** (left) — the score you are writing. See below.
- **Notation rail** (right) — two of the four registers, small: the notation strip and the
floor path. <kbd>R</kbd> opens all four, large.
- **Transport** (bottom) — play/pause, a scrub bar, the ghost-cloud toggle, and a frame
counter. Scrubbing moves the figure, the ghosts, and every open register together.
- **Transport** (bottom) — play/pause, a scrub bar, a **speed** control, the ghost-cloud
toggle, a **follow** toggle, a **phrase** toggle, and a frame counter. Scrubbing moves the
figure, the ghosts, and every open register together. The controls themselves are stripped
in performance mode, where the keys do the same jobs — you do not want to be hunting for a
mouse in front of a room.

### The poem — the core contribution

Expand Down Expand Up @@ -408,11 +421,35 @@ the same poem.** The performer keeps working — writing, drafting, baking — w
room sees only the body, the phrase and the score.

What changes: the instrument chrome falls away, the background darkens, a spotlight gathers the
eye onto the body, the phrase goes large beneath it, and **playback drops to half speed** —
because a human has to be able to *follow and re-embody it*. The score gets thicker strokes and
eye onto the body, and the phrase goes large beneath it — capped at a third of the window, so
a long line cannot cover the body it describes. The score gets thicker strokes and
bigger labels: it has to be readable by a body, from across a room. The poem keeps growing in
the corner — research log as set.

**And the camera follows the body.** A line can travel several metres — 3.89 m on SnapMoGen —
and the stage was framed on a body at the origin, so a travelling body used to leave the shot
for nearly half the phrase and walk out of its own spotlight. The camera now eases after the
pelvis, trailing it by about a quarter of a metre so it reads as an operator following a dancer
rather than the body being pinned to the glass.

**It moves the viewpoint and not the motion.** How far a body goes is part of how the model read
the prompt, so nothing is subtracted: the floor still streams past underneath, and the floor-path
register still shows the whole trace. Dragging to orbit works exactly as before — the camera and
its target move together, so your angle and distance are kept — but **right-drag panning is
overridden while performing**, because the camera is busy keeping the body on screen. Leaving
performance mode puts the camera back on the origin.

**All three are switchable from the stage**, because what a room needs is a judgement made in
the room: <kbd>F</kbd> stops the camera following, <kbd>O</kbd> takes the phrase away and leaves
the body alone, and <kbd>T</kbd> or <kbd>[</kbd> <kbd>]</kbd> change the speed. Performance
opens at **real time**, so the first thing the room sees is the motion as the model made it —
and every speed down to 0.1× is one keypress away when a body needs to follow it.

With the **ghost-cloud** on, the camera follows the selected body only. The siblings stay where
the model put them and the far ones can leave the frame — and most of the spread between
siblings *is* how far each one travelled. What a camera should do about that is an open
question, not a settled default; see [`roadmap.md`](roadmap.md).

<kbd>T</kbd> cycles the tempo, <kbd>space</kbd> plays and pauses, <kbd>esc</kbd> gets you out.
`?perform=1` boots straight into it, for plugging into a projector.

Expand Down
29 changes: 27 additions & 2 deletions frontend/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@
<div id="perf-phrase" class="perf-phrase"></div>
<div class="perf-meta">
<span>⟳ loop</span>
<span id="perf-tempo" class="on">0.5× tempo</span>
<span id="perf-tempo" class="on">1× tempo</span>
<span>re-embody</span>
<span class="perf-keys">space play · T tempo · esc exit</span>
<span class="perf-keys">space play · T / [ ] speed · F follow · O phrase · esc exit</span>
</div>
</div>

Expand Down Expand Up @@ -293,11 +293,36 @@ <h3>4 · Laban-inspired score</h3>
<div class="transport">
<button id="playpause">Play</button>
<input id="scrub" class="scrub" type="range" min="0" max="1000" value="0" />
<!-- Playback speed. A body has to be able to follow and re-embody what it sees,
and how slow that needs to be is a studio judgement, not a constant. -->
<label class="duration">
<span>speed</span>
<select id="tempo" class="model-select">
<option value="0.1">0.1×</option>
<option value="0.25">0.25×</option>
<option value="0.5">0.5×</option>
<option value="0.75">0.75×</option>
<option value="1" selected>1×</option>
<option value="1.5">1.5×</option>
<option value="2">2×</option>
</select>
</label>
<!-- the variance cloud: one prompt, many seeds -->
<label class="toggle">
<input id="ghosts" type="checkbox" checked />
<span>ghost-cloud</span>
</label>
<!-- The camera tracks the body, so a line that travels stays in the shot. Off here
by default: the bench is for inspection, where still ground reads better. -->
<label class="toggle">
<input id="follow" type="checkbox" />
<span>follow</span>
</label>
<!-- The phrase the room is reading, large beneath the body. -->
<label class="toggle">
<input id="overlay" type="checkbox" checked />
<span>phrase</span>
</label>
<span id="counter" class="counter">— / —</span>
</div>
</div>
Expand Down
71 changes: 71 additions & 0 deletions frontend/app/src/follow.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* What the follow camera is allowed to do.
*
* Two of these matter more than they look. A camera that overshoots oscillates around the
* body, and a camera whose easing depends on the frame rate feels like a different camera on
* a projector than on the laptop it was tuned on — and the projector is the one that counts.
*
* Run with `npm test` (Node runs TypeScript directly; no test runner is installed).
*/

import assert from "node:assert/strict";
import { test } from "node:test";

import { FOLLOW_RATE, followPan } from "./follow.ts";

const at = (x: number, z: number) => ({ x, z });

test("a body already centred does not move the camera", () => {
const pan = followPan(at(2, -1), at(2, -1), 1 / 60);
assert.equal(pan.dx, 0);
assert.equal(pan.dz, 0);
});

test("the camera moves toward the body, never past it", () => {
// One frame closes part of the gap. Overshooting would oscillate around the body.
const pan = followPan(at(0, 0), at(4, 0), 1 / 60);
assert.ok(pan.dx > 0, "moves toward the body");
assert.ok(pan.dx < 4, "does not arrive in one frame");
// Even an absurdly long frame cannot pass the body.
const huge = followPan(at(0, 0), at(4, 0), 10);
assert.ok(huge.dx < 4);
});

test("easing is frame-rate independent", () => {
// Two half-steps must land exactly where one whole step does, or the camera follows
// faster on a faster display and its feel becomes a property of the hardware.
const dt = 1 / 30;
const one = followPan(at(0, 0), at(6, 0), dt).dx;

let x = 0;
for (let i = 0; i < 2; i++) x += followPan(at(x, 0), at(6, 0), dt / 2).dx;

assert.ok(Math.abs(one - x) < 1e-12, `${one} vs ${x}`);
});

test("it follows x and z, and nothing else", () => {
const pan = followPan(at(0, 0), at(3, -5), 1 / 60);
assert.ok(pan.dx > 0);
assert.ok(pan.dz < 0);
// There is no third component to get wrong: following height would bob the camera in
// time with the walk cycle.
assert.deepEqual(Object.keys(pan).sort(), ["dx", "dz"]);
});

test("a stalled clock pans nothing", () => {
// The first frame after a tab regains focus can report dt 0, and a paused stage asks for
// this every frame forever.
for (const dt of [0, -1, Number.NaN]) {
const pan = followPan(at(0, 0), at(9, 9), dt);
assert.equal(pan.dx, 0, `dt ${dt}`);
assert.equal(pan.dz, 0, `dt ${dt}`);
}
});

test("the default rate closes most of the gap in about half a second", () => {
// Pins the feel, so changing FOLLOW_RATE is a deliberate act with a visible consequence
// rather than a number nudged until a test went green.
let x = 0;
for (let i = 0; i < 30; i++) x += followPan(at(x, 0), at(1, 0), 1 / 60, FOLLOW_RATE).dx;
assert.ok(x > 0.55 && x < 0.75, `covered ${x.toFixed(3)} of the gap in 0.5 s`);
});
65 changes: 65 additions & 0 deletions frontend/app/src/follow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* How the camera follows a travelling body.
*
* The stage camera was framed on a body at the origin, and real models do not stay there —
* one line covers 2.11 m on Kimodo and 3.89 m on SnapMoGen. A body that travels walks out of
* the frame, and out of the performance view's spotlight, which is a radial gradient fixed to
* the centre of the viewport.
*
* What this does NOT do is change the motion. Displacement is a finding in this project — how
* far a body goes is part of how the model read the prompt — so the data is untouched and the
* floor still streams past underneath. Only the viewpoint moves. That is a different thing
* from pelvis-aligning the motion, which stays parked as an option (see docs/roadmap.md).
*
* The arithmetic lives here rather than in the animation loop for the same reason
* `timeline.ts` and `register-view.ts` do: a camera that eases at the wrong rate, or that
* overshoots, or that drifts differently on a 60 Hz laptop and a 120 Hz projector, is wrong
* in a way that is hard to see and easy to argue about. Here it can be tested.
*/

/** Where the camera aims: the body's x/z, at the height the stage was framed for. */
export const FOLLOW_HEIGHT = 1.0;

/**
* How fast the camera closes the gap, as a rate per second.
*
* It is a time constant, not a per-frame fraction: at 1.8 the camera covers about 63% of the
* distance to the body in the first 0.55 s. The lag is the point — a camera that snapped to
* the pelvis would nail the body to the glass and read as the body standing still while the
* world slid past. This reads as an operator following a dancer, and it is the one number
* here most worth changing in a room.
*/
export const FOLLOW_RATE = 1.8;

export interface Pan {
dx: number;
dz: number;
}

/**
* How far to pan this frame, so the body eases toward the centre of the shot.
*
* Applied to the orbit target **and** the camera position, by the same amount — that is what
* keeps it a pan. Moving only the target would swing the camera round the body and throw away
* whatever angle and distance the viewer had chosen.
*
* Frame-rate independent by construction: `1 - exp(-rate * dt)` composes exactly, so two
* half-steps land in the same place as one whole step. A fixed per-frame fraction would
* follow faster on a faster display, which would make the camera's feel a property of the
* hardware rather than a decision.
*
* Never overshoots: the factor is in [0, 1) for any non-negative `dt`.
*
* Only x and z. Following the body's height as well would make the camera bob with the
* pelvis — a camera breathing in time with the walk cycle, which reads as the floor moving.
*/
export function followPan(
from: { x: number; z: number },
to: { x: number; z: number },
dt: number,
rate: number = FOLLOW_RATE,
): Pan {
if (!(dt > 0) || !(rate > 0)) return { dx: 0, dz: 0 };
const k = 1 - Math.exp(-rate * dt);
return { dx: (to.x - from.x) * k, dz: (to.z - from.z) * k };
}
Loading
Loading