In cima a Via dell'Antica Posta si arriva sotto la console dell'underground (il marciapiede di destra, fino in fondo); sotto una console le altre calano fino al loro filo, così lì si sente la sola musica di quella (Andrea)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiECd9RWGMKV7n3K1mdy8T
This commit is contained in:
2026-10-31 15:09:45 +01:00
co-authored by Claude Opus 5.5
parent 04f9a5cb12
commit 23aa9c4788
3 changed files with 27 additions and 7 deletions
+10 -5
View File
@@ -26,12 +26,17 @@ export function trackFor(story, { screen, scene, phase, closeup, at, ok = () =>
}
// Il volume di ogni console: pieno fino a `near` pixel, poi cala fino a `far` (non sotto un filo, `floor`: la festa
// si sente sempre). La più forte per prima.
// si sente sempre). Sotto una console (entro `near`, sfumando fino a una volta e mezzo) le altre calano fino al loro
// filo: lì si sente bene la sola musica di quella (Andrea, 31 ottobre, in cima a Via dell'Antica Posta). La più forte
// per prima.
export function mix(stages, [x, y]) {
return stages.map(st => {
const d = Math.hypot(x - st.at[0], (y - st.at[1]) * 1.5), near = st.near ?? 90, far = st.far ?? 520;
const k = Math.max(0, Math.min(1, (d - near) / (far - near)));
return { src: st.music, gain: Math.max(st.floor ?? 0.08, (1 - k) ** 1.6) };
const near = st => st.near ?? 90, floor = st => st.floor ?? 0.08;
const d = stages.map(st => Math.hypot(x - st.at[0], (y - st.at[1]) * 1.5));
const under = stages.map((st, i) => Math.max(0, Math.min(1, (near(st) * 1.5 - d[i]) / (near(st) * 0.5))));
return stages.map((st, i) => {
const far = st.far ?? 520, k = Math.max(0, Math.min(1, (d[i] - near(st)) / (far - near(st))));
const others = Math.max(0, ...under.filter((_, j) => j !== i));
return { src: st.music, gain: Math.max(floor(st), (1 - k) ** 1.6 * (1 - others)) };
}).sort((a, b) => b.gain - a.gain);
}
+4 -2
View File
@@ -1912,11 +1912,13 @@ export const story = {
{ type: 'pixelspots', phase: 'ingorgo', area: [130, 242, 490, 108], bpm: 122, count: 5, size: 20, colors: ['155,65,255', '65,110,255'] },
],
stages: [
{ when: 'ingorgo', music: 'assets/audio/ingorgo-underground.mp3', at: [565, 235] },
// Giù a destra, sul marciapiede sotto il giardinetto, si arriva sotto la console: lì solo l'underground.
{ when: 'ingorgo', music: 'assets/audio/ingorgo-underground.mp3', at: [565, 235], near: 190 },
{ when: 'ingorgo', music: 'assets/audio/ingorgo-techno.mp3', at: [270, 120], far: 600 },
{ when: 'ingorgo', music: 'assets/audio/ingorgo-house.mp3', at: [240, 640], far: 750 },
],
walk: [[0, 360], [0, 322], [190, 226], [283, 222], [470, 360]],
// Col marciapiede di destra, fra le catenelle e il giardinetto, fino in fondo (Andrea, 31 ottobre).
walk: [[0, 360], [0, 322], [190, 226], [283, 222], [350, 236], [452, 272], [640, 335], [640, 360]],
depth: [[222, 0.35], [360, 1.15]],
entry: [240, 350],
hotspots: [