{
  "id": 1010978,
  "title": "I Built a Real-Time Collaborative Sheet Music Editor — Here's What MusicXML and CRDTs Taught Me",
  "url": "https://urgent.news/2026/08/15/i-built-a-real-time-collaborative-sheet-music-editor-heres-what",
  "topic": "culture",
  "section": "Culture",
  "published": "2026-08-15T10:14:05.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/tan-z-tan/i-built-a-real-time-collaborative-sheet-music-editor-heres-what-musicxml-and-crdts-taught-me-1dii"
  },
  "original_language": "en",
  "account": "I built a real-time collaborative sheet music editor called ScoreTail, aiming for a Google Docs-like experience for musicians. I aimed to leverage MuseScore, Finale, and Sibelius, but they require extensive knowledge of notation software. Thus, I developed ScoreTail mostly alone, aided by AI-assisted development.\n\nThis journey introduced me to MusicXML, a complex music notation format. It includes elements like pitch, duration, voices, staves, ties, slurs, ornaments, tuplets, lyrics, chord symbols, and dynamics. Implementing such a vast specification alone is a multi-year project. I used AI (Claude Code and Antigravity) to write most of the code, while I focused on defining what \"correct\" meant through a rigorous round-trip test suite. By importing, exporting, and re-importing around 250 real-world scores, I ensured structural integrity and caught any bugs before they surfaced.\n\nOne of the toughest aspects of MusicXML was its backup/forward mechanism. It's a flat, sequential XML structure with voice A's notes followed by a backup element to rewind the internal time cursor before writing voice B's notes. This forced developers to maintain their own notion of where they were on the timeline, regardless of document order, and ensure all edits left the score in a musically valid state. Every operation needed to be carefully evaluated to maintain musical validity, even when dealing with complex scenarios like overlapping notes, different note lengths, or changing time signatures or key signatures mid-edit.\n\nFor real-time collaboration, I used Yjs, a CRDT library, which enables automatic convergence of edits from multiple clients without a server-side conflict resolution mechanism. However, applying CRDTs to MusicXML presented challenges, as MusicXML's sequential structure differs from text-based CRDTs. To address this, I mapped the MusicXML tree onto Yjs's Y.Map and Y.Array types. While Yjs ensured structural convergence, musical validity remained a separate concern. To address this, I implemented an auto-undo feature that rolled back any operation leading to an invalid document.\n\nRender performance was another concern, especially for larger scores. I addressed this by moving rendering into a Web Worker and streaming it page-by-page, prioritizing the page the user is currently viewing. Additionally, Verovio, an open-source C++ engraving engine compiled to WebAssembly, was used for rendering. Rendering introduced ID-mapping issues between Yjs and Verovio's internal IDs. I created a fingerprint system for each note, incorporating part index, measure number, beat position, voice, and pitch. This mapping was rebuilt on each render pass, ensuring accurate link between visual notes and their corresponding data in Yjs.",
  "summary": "I wanted a \"Google Docs for sheet music\": open a browser tab, start writing notation, share a URL, and have someone else edit the same score with you in real time. Nothing like that existed. MuseScore, Finale, and Sibelius are all excellent, but they're desktop apps built for people who already know notation software inside out. So I built ScoreTail , a browser-based score editor, mostly alone,…",
  "key_points": [
    "Developed ScoreTail, real-time collaborative sheet music editor",
    "Leveraged MusicXML format with complex notation elements",
    "Implemented Yjs CRDT library for real-time collaboration"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}