Skip to content

Commit eb3a4b7

Browse files
RuitingMaclaude
andcommitted
Add <Score>: embedded Verovio notation with synced playback
Drops MEI-authored music into essays via <Score slug="..." />: - MEI is rendered by Verovio (WASM, lazy-loaded on first score in view). Layer stack: dedicated staff-lines at stage-level (single source, no double-stroke), scrolling pan with music, frozen clef/keysig/meter overlay pinned to the left, playhead, hint. - Fixed playhead; pan translates. Notes/chord-symbols/functional labels glow via a feathered drop-shadow while sounding (render loop diffs `is-active` sets per frame, gated on playing to keep scrub cheap). - Pre-roll: static rest frame already shows the pre-play pose so the first note starts right of the playhead and scrolls in with no jump when audio begins. - Loop mode: 3 SVG copies tile via negative margin-left; translate-wrap is invisible; gated against firing during pre-roll. - Non-loop tail: silent post-audio scroll so the last note walks off before reaching the end state. - Drag to seek (pointer capture + threshold), click to toggle, click at end → fade-to-start via opacity transition. backdrop-filter suspended while dragging to avoid stutter from per-frame backdrop re-sampling. - Right-edge entrance: stage mask fades staff lines in first, a wider pan-mask fades the notes in later, and a backdrop-filter blur overlay sharpens them as they scroll inward. Deps: @astrojs/mdx (so essays that embed a <Score> can live as .mdx), verovio (WASM toolkit, ~1.5MB gzipped, on-demand). Test content: public/scores/twinkle (no-loop, 8 bars with jazz chord symbols + functional analysis) and public/scores/ii-V-I (looping 2-bar cadence). Demo essay: score-test.mdx. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ef38f27 commit eb3a4b7

8 files changed

Lines changed: 2509 additions & 19 deletions

File tree

astro.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
3+
import mdx from '@astrojs/mdx';
34
import fontSubset from './integrations/font-subset.mjs';
45

56
// https://astro.build/config
67
export default defineConfig({
78
site: 'https://sunkenkeep.space',
8-
integrations: [fontSubset()],
9+
// Order: mdx first so .mdx essays can import components; font-subset runs
10+
// at astro:build:done, after everything else has emitted HTML.
11+
integrations: [mdx(), fontSubset()],
912
});

0 commit comments

Comments
 (0)