four commits, and failure
I did not intend to do all of this in one sitting. and yet.
player batching + buffer pool
the player was creating a new AudioBuffer for every single chunk. for a 100-note score that’s 200 buffer allocations (stereo) plus 200 BufferSourceNodes. the garbage collector was not happy.
rewrote the scheduling layer. chunks now accumulate into batches (~0.5s each) and get merged into a single AudioBuffer per channel before scheduling. acquireBuffer() checks a pool of previously used buffers by sampleRate and length before allocating new ones. onended releases them back to the pool. pre-buffer threshold bumped to 1.0s for more runway.
the result: way fewer Web Audio nodes, way less GC pressure, smoother playback on longer scores.
japanese UTAU compatibility
imported UST files from real UTAU projects were breaking because Japanese has a bunch of special lyric conventions I didn’t handle:
-
っ (sokuon): geminate consonant marker. maps to a new
sil(silence) phoneme. -
※ (pronunciation alias): text after ※ is the actual pronunciation.
あ※kauses “ka” not “あ”. -
dot-prefixed lyrics (
.sil,.S): UTAU rest/silence commands. treated as empty. - @ and %: stripped. @ also acts as a note-join marker in the renderer: if present, the initial consonant gets suppressed so the vowel carries through from the previous note.
also removed the cascade.reset() between phonemes. filter state now carries through for smoother formant transitions instead of clicking at every phoneme boundary.
settings panel
new SettingsPanel.svelte. modal overlay, dark theme, closes on Escape or click-outside. currently has one setting: auto-scroll toggle (for a future scroll-to-playhead feature). settings gear icon in the header bar.
undo/redo
integrated undora for undo/redo history. 50-state capacity. snapshots are saved on mouse-up in the piano roll, delete key, pitch point changes, and lyric/note-number edits (on blur, not on every keystroke).
Ctrl/Cmd+Z to undo. Ctrl/Cmd+Shift+Z or Ctrl/Cmd+Y to redo. Undo2 and Redo2 icons in the header bar, disabled when there’s nothing to undo/redo. history clears on language switch and file import.
the formatting commit
ran prettier again. removed a dead MIN_POOL_SIZE constant and an unused import. cleaned up a few TODO items. the usual.
scrollToNotes also got a fix: it was centering on the midpoint of all notes which looked weird when the first note started late. now it clamps to the start of the earliest note so you always see the beginning.
also I tried to fix the hissing and static and clicking but to no avail. i tried fixing a LOT of stuff. but. sadly ir only made things worse, so I had to retry. and retry. and retry. and retry. with no luck
I’m not sure what the problem is tbh. Let me use Satori to debug some stuff ig
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.