Skip to content

Annotation suite: web components, tick positions, bounded playback

Latest

Choose a tag to compare

@naomiaro naomiaro released this 12 Jul 07:29

Annotation suite for the dawcore web components — three PRs (#607, #610, #611) closing epic #455 and follow-ups #608/#609.

Annotation web components (#607, closes #455)

  • <daw-annotation-track>, <daw-annotation>, <daw-annotation-list> — single-source-of-truth dual-view model: the <daw-annotation> elements' attributes and text ARE the data; the editor's timeline lane and the list panel are two synchronized views over them.
  • Editable timeline lanes inside <daw-editor>: drag-to-resize boundaries with link-endpoints cascading and collision push (boundary math shared with the React useAnnotationControls hook via @waveform-playlist/core), click-to-seek, pointercancel-safe.
  • Keyboard controls (keyboard-controls): arrow navigation with wrapping, Home/End, Enter plays the selection and stops at its end, [ ] { } boundary nudges, Escape two-press (deselect, then stop), full remapping via annotationShortcuts, capture-phase priority over <daw-keyboard-shortcuts>.
  • editor.play(startTime?, endTime?) for bounded playback; indefinite-playback lifts the annotation end-clamp and the timeline extends to cover annotations past the audio.

Musical (tick/PPQN) positions + display modes (#610)

  • start-tick / end-tick on <daw-annotation> — authoritative when both set (the clip startTick pattern); the editor derives and maintains the seconds cache, re-deriving on BPM changes so annotations stay on their bars.
  • Tick-native boundary editing through the same shared core math (integer ticks, 128th-note minimum duration), editor.snapTo-aware drags via snapTickToGrid, mixed tick/seconds tracks supported.
  • Beats-mode lanes render with clip-identical tick math — grid-exact alignment.
  • box-label on <daw-annotation-track>: text (default) / id (classic aeneas-style ids in the bars, full text in the list) / none (bare region bars); name renders a lane label in the controls sidebar.
  • time-display="bars" on <daw-annotation-list> — bar.beat ranges (multi-meter aware via the new ticksToBarBeat core helper).
  • Playback-following playing highlight in both views (boundary-crossing updates only; selection state untouched).
  • Label-less annotations and list-less tracks are contractual (data-only region marking).

Bounded-playback completion + write-back correctness (#611, closes #608 & #609)

  • New optional PlayoutAdapter.onPlaybackEnded(callback | null) hook: the Tone adapter reports duration-limited play(start, end) completion, and the engine stops itself (microtask-deferred out of Tone's tick chain; dispose-race guarded). The React provider and <daw-editor> both mirror engine-initiated stops (exactly one stop event; provider/editor stop-then-play transitions suppressed).
  • Annotation boundary write-back diffs against live element values by id — closes the one-frame skipped-write window under reordered drags.
  • Incidental fix: seeking during bounded playback no longer leaves a stale end-time watermark.

Demos

examples/dawcore-native/: annotations.html, sonnet.html (Sonnet 1 parity with the classic React example), tick regions + bars-view list on beats-grid.html. examples/dawcore-tone/annotations.html: the Tone-adapter annotations demo, used to verify the bounded-stop chain live against a real Tone Transport.

Published packages

annotations 12.0.6 · browser 15.3.4 · core 12.6.1 · @dawcore/components 0.0.35 · @dawcore/midi 0.0.4 · @dawcore/spectrogram 0.0.7 · engine 13.5.1 · media-element-playout 12.3.2 · midi 13.0.3 · playout 12.5.4 · recording 13.0.3 · spectrogram 13.0.7 · ui-components 13.1.5 · webaudio-peaks 12.0.2