Go to file
type-two e05a1d2946 [m9-C] beat detection + audio trim at mux
/beats?path= returns bpm, a phase-locked beat grid, downbeats (4/4) and an
honest confidence, using only stdlib + ffmpeg: decode to PCM, log-energy onset
flux, harmonic-enhanced autocorrelation with an octave check, comb phase
search, weighted LS grid refit. 4-min track analyses in ~0.5s, cached after.

Audio in/out now honoured at mux in both scene renders and film beds via one
resolve_audio() path. Found en route: on this ffmpeg build the obvious
atrim/asetpts + amix/apad chain yields an aac stream with ZERO samples, rc=0,
no warning - trim moved to the input side; and the test helper would have
passed on that empty stream, so it now refuses to answer on a window that
decodes nothing.

Tempo bias fixed after orchestrator ground-truth check: decoding at 22050
discarded the HF transient, and since the attack's HF share grew across a file
the surviving LF onset landed progressively later - a per-beat-varying
lateness that reads as tempo error. BEAT_SR now 44100/512 (same 86fps
envelope). Second bug found by sweeping: harmonics outside the lag table
counted as zero and the parabola was fitted on a slope, so 118 BPM read
114.79.

Verified vs independent ground truth: 120.030 vs 120.003 true, 128.020 vs
128.004; worst offset from the true grid 6.0/10.1ms over the whole file (was
45/52ms). Tests now assert whole-file DRIFT, not average BPM, incl. a 200s
track and hftick.wav (16kHz tick over a 60Hz body) which pins BEAT_SR.
18 groups green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 00:13:40 +10:00
.claude [sync1] wire TimelineUI to real Stage, null-mixer guard, M2 unlock + orchestrator updates 2026-07-18 18:36:16 +10:00
deploy [m8-C] multi-shot sequencing — a film is now a first-class object 2026-07-25 23:21:45 +10:00
lanes [m9-C] beat detection + audio trim at mux 2026-07-26 00:13:40 +10:00
logs [m9-C] beat detection + audio trim at mux 2026-07-26 00:13:40 +10:00
scenegod [m9-C] beat detection + audio trim at mux 2026-07-26 00:13:40 +10:00
scripts [m9-C] beat detection + audio trim at mux 2026-07-26 00:13:40 +10:00
sequences [m8-C] multi-shot sequencing — a film is now a first-class object 2026-07-25 23:21:45 +10:00
templates [m7-C] starter templates: read-only API + three working scenes 2026-07-25 22:34:53 +10:00
.gitignore [m8-C] multi-shot sequencing — a film is now a first-class object 2026-07-25 23:21:45 +10:00
CLAUDE.md docs: note that prod asset sync is separate from deploy.sh 2026-07-25 22:52:55 +10:00
PLAN.md plan: M7 (rig aliases, world backdrops, templates) + sequencing/beat-sync backlog 2026-07-25 21:42:50 +10:00
README.md [sync5] viseme matcher side-suffix fix, v1 complete: README, git-hygiene rule 2026-07-18 21:33:53 +10:00
requirements.txt [laneC] M1 server: statics, assets tree/file, scenes CRUD+validation, render stubs, tests 2026-07-18 17:53:52 +10:00
scenegod-8020.log [m9-C] beat detection + audio trim at mux 2026-07-26 00:13:40 +10:00

SCENEGOD — machinima director's sandbox

Drop characters, Mixamo clips, and photo backdrops onto a 3D stage; keyframe transforms, cameras (with cuts), and lights on a timeline; render an mp4 with muxed audio. The Movies / Source Filmmaker energy on the GODVERSE stack.

Run

.venv/bin/uvicorn scenegod.server:app --port 8020
# → http://127.0.0.1:8020

Assets live in assets/{characters,animations,props,backdrops,audio}/ (plain folders, scanned live — files sharing dir+stem are one entry; a same-stem image becomes the thumbnail). Scenes save to scenes/*.json, renders to renders/ (reaped after 48h).

What works (v1)

  • GLB/FBX/OBJ characters & props; spec-gloss (Character Creator) GLBs are converted on load. Image backdrops: flat plane, corner, or 360 dome.
  • Mixamo-style clip retarget onto any mixamorig-named skeleton, client-side (world-space rotation-delta bake, ported from MESHGOD rigroom).
  • Timeline: transform + param keyframes with easing, clip blocks with trim/loop/crossfade, multiple cameras + cut list, keyframable sun/ambient, audio tracks (Web Audio preview; server-side ffmpeg mux in the final mp4), viseme/morph track with Rhubarb JSON import (GET /rhubarb?path= if the rhubarb binary is installed).
  • Render: draft webm (MediaRecorder) or deterministic PNG-sequence → ffmpeg h264 (+aac) mp4 at any resolution.
  • scripts/graft_limb.py: headless-Blender armature graft (add a rigged hand/limb to a rigged body; refuses when the bones already exist).
  • scripts/test_server.py (9 groups) + node scenegod/web/timeline_test.mjs.

Repo docs

PLAN.md — architecture, scene-JSON schema, module contracts, milestones. CLAUDE.md — lane-agent protocol (3 parallel Opus lanes + orchestrator), stack rules, inherited gotchas. lanes/ + logs/ — per-lane instructions and session logs; the build history of this repo is readable there.