Battuta Vibetuned
Install Battuta with WinGet
winget install --id=Vibetuned.Battuta -e A local-first MEI score editor that treats notation the way a text editor treats text
winget install --id=Vibetuned.Battuta -e A local-first MEI score editor that treats notation the way a text editor treats text
A local-first MEI score editor that treats notation the way a text editor treats text: the MEI document is the single source of truth, everything on screen is a projection of it, and every edit is a reversible command against it. Verovio does all notation rendering — battuta never draws notation.
npm run docs)1.2.0 released (2026-10-29): battuta on iPhone, iPad and Android. The
same shell builds for tablets and phones — files in battuta's own folder or
any folder picked, a share sheet, MIDI by USB and Bluetooth, an on-screen
keyboard made for touch, every notice in the about box — with the App Store
and Google Play listings ready (apps/editor/store/).
Since 1.0.0 too: the PDF reference (the start of the facsimile), the folder
view writing files, sounding accidentals written into the file
(@accid.ges), MIDI spelled by the key, ties between chords and tenuto.
@battuta/api 1.2.0 is the contract, and every package carries the one
number.
1.0.0 (2026-09-18) was the first stable version. The editor is a host: tiles, caret, selection, reversible commands with byte-identical undo, note entry, copy/paste with the duration validator, context editing, the keymap and the score on disk — and around it, nine plugins on declared extension points, loaded only when something they declared happens: the reflection cycle, the on-screen keyboard, the lyrics and harmony lanes, playback (a sampled piano or your MIDI devices, and the playback-MIDI export), the format converters (every format Verovio reads and writes), a folder view with live file watching (desktop), the pitch reference — a recording's pitch traced over the score, with a playhead that follows the caret and plays the take or the written notes — and, since 1.2.0, the PDF reference. Every plugin ships a README (how to use it) and a BUILDING (how it was built). Packaged for Linux (deb + AppImage, apt repository), macOS (signed and notarized universal dmg, Homebrew cask) and Windows (NSIS installer, winget).
Phases 0–10 are done — Phase 10's store uploads follow the 1.2.0 tag; the full record, phase by phase, lives in CHANGELOG.md. Next: the second overlay plugins — the piano-roll reference layer and OMR correction — planned against API surface only in PLANNING.md.
packages/core/ @battuta/core — document tree, context resolver, commands.
Pure logic; no DOM (enforced: tsconfig lib=[ES2022], types=[]).
apps/editor/ Vite + React shell. Verovio in a worker, tile flow layout,
id-based hit-testing. Runs in any browser; Tauri shell later.
spikes/ Phase 0 spikes + runner benchmarks. Throwaway by design.
fixtures/ The committed hand-made e2e fixture plus the MEI corpus
(music-encoding/sample-encodings), fetched on demand:
sh spikes/fetch-fixtures.sh — see fixtures/README.md.
docs/ Astro Starlight user guide. Standalone install; figures are
generated by Verovio, icons by cairo, keymap from keymap.ts.
npm install
npm run dev --workspace @battuta/editor # open the printed URL
The user guide has its own install (it is not a workspace):
cd docs && npm install && cd -
npm run docs # serve the guide
npm run docs:build # build it, then run the drift check
Spikes and benchmarks: see the reproduce block at the top of BENCHMARKS.md.
The Tauri shell lives in apps/editor/src-tauri (Tauri 2; needs
libwebkit2gtk-4.1-dev and Rust). Two modes — the binary prints which one
it is running at startup:
# Self-contained (embedded assets, no server — what users will run):
npm run build -w @battuta/editor
cd apps/editor/src-tauri && cargo app # alias: run --release --features custom-protocol
# Against the dev server (hot reload while hacking), from the repo root:
npm run tauri dev # starts Vite on :5173, builds the shell, opens it; Rust edits rebuild
# …or by hand, two terminals:
npm run dev -w @battuta/editor # serves on :5173
cd apps/editor/src-tauri && cargo run --release # loads localhost:5173 — BLANK without the dev server
npm run tauri is the Tauri CLI run in apps/editor — the
same as cd apps/editor && npx tauri , so npm run tauri build
packages exactly as below. tauri dev starts the dev server itself
(beforeDevCommand in tauri.conf.json) on a PINNED port: if 5173 is
taken it stops with an error instead of serving elsewhere while the shell
loads 5173.
The old WebKitGTK 2.52 blank-webview issue no longer reproduces;
sh spikes/verify-tauri.sh smoke-tests the self-contained build
(including launching with a .mei argument — the file-association path).
It runs the shell with BATTUTA_EPHEMERAL_STORAGE=1, an in-memory WebView
data store, so its test scores never reach your recovered session.
The same shell builds for iPhone, iPad and Android (com.vibetuned.battuta;
the generated projects live in src-tauri/gen/apple and gen/android):
npm run android -- build --debug --apk --target aarch64 # then: node spikes/verify-android.mjs
npm run ios -- build --debug --target aarch64 --export-method debugging
npm run ios -- build --debug --target aarch64-sim # the simulator (an iPhone)
scripts/mobile.sh finds Android's SDK and NDK where Android Studio puts
them and a JDK 21 (Android Studio's bundled Java 25 is too new for the
generated Gradle), for these commands only; Android Studio itself gets its
JDK 21 from gradle/gradle-daemon-jvm.properties, fetched by the foojay
resolver when the machine has none. iOS signs with the Vibetuned team; it
needs Xcode, CocoaPods, the Rust targets aarch64-apple-ios and
aarch64-apple-ios-sim (Android: aarch64-linux-android and the other
three), and rustup's llvm-tools (rustup component add llvm-tools):
Xcode 27 hides the native plugin's Swift entry points in release builds and
swift-rs makes them visible again with its llvm-objcopy — without it an
Archive fails on Undefined symbols: _init_plugin_battuta_mobile while
debug builds work (found in Vibetuned's midi-stroke). node spikes/verify-android.mjs drives the debug APK on a
connected tablet over the WebView's DevTools socket; on an iPad, debug
builds append the shell's probe lines to shell.log in the app's data
folder, which xcrun devicectl device copy from fetches. A simulator
build needs the simulator runtime of Xcode's own SDK
(xcodebuild -downloadPlatform iOS), and Tauri will not overwrite a
previous one: remove src-tauri/gen/apple/build/arm64-sim/battuta.app
first.
For the stores, published from Xcode and Android Studio, as
Vibetuned's midi-stroke is. npm run ios -- build --open (or android)
builds, opens the IDE on the generated project and keeps the Tauri CLI
running — leave that terminal open: the project's Rust step calls back into
it. In Xcode, Any iOS Device (arm64), Product → Archive, then the
Organizer's Distribute App → App Store Connect; in Android Studio,
Build → Generate Signed App Bundle or APK → Android App Bundle, the
upload key, the universalRelease variant. (A release build from the
command line signs with the upload key named in
src-tauri/gen/android/keystore.properties — keyAlias, password,
storeFile; kept out of git, unsigned without it.) What midi-stroke's
release taught, applied here (2026-10-22): the Xcode project's Build Rust
Code step puts Homebrew's /opt/homebrew/bin first on its PATH — Xcode
opened from the Dock or Finder has only macOS's default one ("npm: command
not found"); Externals/, where each build leaves the Rust library, is
linked and never copied into the app (buildPhase: none — Tauri's template
made it a resource whenever XcodeGen ran after a build); the archives are
named battuta in the Organizer while the scheme keeps the target's name,
which the Tauri CLI builds by; Android Studio opens on the universal
flavour (all four ABIs, as the CLI builds) instead of 32-bit arm; the
signed bundle Android Studio writes beside the module
(app/universal/release/) is ignored by git; and the 64-bit Android
libraries are linked for 16 KB pages, which Google Play requires of apps
targeting Android 15 and later (src-tauri/build.rs: NDK 27 links for 4 KB,
and the Tauri CLI's own RUSTFLAGS would override a .cargo/config.toml). The listings' texts
and every question the two stores ask, answered:
apps/editor/store/; their screenshots, feature
graphic and Play icon: npm run store:screenshots.
The app's notices (battuta menu → about battuta) are generated from what
the build bundles and the shell links: after a dependency changes, run
npm run licences -w @battuta/editor (a test fails until then).
The tablet icons come from the logo (docs/src/assets/logo.svg) through
src-tauri/icons/mobile/icons.json: iOS takes the logo as it is (black on
white — its icons cannot be transparent); Android's adaptive icon takes
android-foreground.svg, the glyph alone at half size, inside the safe
zone launchers never crop (the full logo filled the canvas and was cut to
the launcher's circle). To regenerate without touching the desktop's
icons, generate into a scratch folder and copy only the mobile sets:
cd apps/editor && npx tauri icon src-tauri/icons/mobile/icons.json -o /tmp/battuta-icons
cp /tmp/battuta-icons/ios/*.png src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/
# the App Store refuses an icon with an alpha channel, even an opaque one:
# flatten them onto the white background, RGB only (ImageMagick)
for f in src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/*.png; do magick "$f" -background "#ffffff" -alpha remove -alpha off "PNG24:$f"; done
# android/mipmap-*, mipmap-anydpi-v26 and values/ic_launcher_background.xml
# go to src-tauri/gen/android/app/src/main/res/ the same way
npm install # @tauri-apps/cli is a root devDependency
cd apps/editor && npx tauri build
Artifacts land in apps/editor/src-tauri/target/release/bundle/:
deb/battuta_0.0.1_amd64.deb and appimage/battuta_0.0.1_amd64.AppImage.
Bundling needs libasound2-dev (MIDI) and, for the AppImage,
librsvg2-dev; in sandboxes without FUSE set APPIMAGE_EXTRACT_AND_RUN=1.
The deb installs the app icon, a desktop entry with Exec=battuta-editor %F, and a shared-mime-info package mapping *.mei →
application/x-mei+xml — after sudo apt install ./battuta_0.0.1_amd64.deb,
double-clicking a .mei file opens it in battuta (the shell passes the
launch argument to the frontend via a pull-based initial_score command;
production builds no longer embed the fixtures corpus, ~13 MB lighter).
Tauri does not cross-compile — each OS builds its own bundle (the webview is the native one: WKWebView on macOS, WebView2 on Windows). Two options:
v* tag (or run the release workflow
manually) — .github/workflows/release.yml builds a universal macOS
.dmg, a Windows NSIS -setup.exe, and the Linux deb/AppImage, and
attaches all of them to a draft GitHub release.npm ci and cd apps/editor && npx tauri build (add
--target universal-apple-darwin after
rustup target add aarch64-apple-darwin x86_64-apple-darwin for one
binary covering both CPU families).npm ci,
cd apps/editor, npx tauri build (separate commands — && is not
valid in Windows PowerShell 5). Verified on Windows 11 with VS 2022
and the Windows 11 SDK.Platform notes: tauri.conf.json lists every platform's bundle targets
and Tauri silently drops the ones the host cannot build, so a plain
tauri build produces the right artifact everywhere; --bundles still
overrides it, which is what release.yml passes per matrix leg. MIDI
needs no extra work — midir uses CoreMIDI/WinMM natively (on macOS
the poll thread pumps a CFRunLoop: CoreMIDI only reports hot-plug
through it). The .mei association comes from fileAssociations
(Info.plist on macOS, installer registry on Windows); on macOS the
opened file arrives as an Opened run-loop event rather than argv,
which the shell also handles.
Unsigned builds trip Gatekeeper — the dmg shows a warning before the
drag-to-Applications window opens (right-click → Open the first time,
or pay for a Developer ID + notarization; tauri-action picks up the
APPLE_CERTIFICATE/APPLE_ID secrets when you add them) — and Windows
SmartScreen ("More info → Run anyway", or a code-signing certificate).
macOS icon: the artwork must be fully opaque edge-to-edge — macOS 26
(Tahoe) treats transparent corners as a legacy pre-shaped icon, discards
the background, and re-composites the glyph on a system tile that is
dark grey under the Dark icon style (the "grey dock icon" bug; the
diagnosis is in CHANGELOG.md under 0.0.1).
apps/editor/src-tauri/icons/icon.icns is built natively from the
full-bleed set:
iconutil -c icns icons/battuta-macos.iconset -o apps/editor/src-tauri/icons/icon.icns
When retesting an icon change, purge the icon caches first — they make every test lie, and resolution goes by bundle id, so delete stale copies of the app too:
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/com.apple.iconservices"*
sudo rm -rf /Library/Caches/com.apple.iconservices.store
killall iconservicesagent Dock Finder
Never regenerate it from icons/battuta.iconset/ (the transparent
original, kept for other platforms) — the grey tile comes straight
back. When retesting icons, purge the REAL cache first and delete any
stale app copies (iconservices also resolves by bundle id):
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/com.apple.iconservices"*
killall iconservicesagent Dock Finder
The native Verovio benchmark needs a
verovio checkout built with
cmake -B build -S cmake -DBUILD_AS_LIBRARY=ON -DCMAKE_BUILD_TYPE=Release.
v* tag runs
.github/workflows/release.yml, which
checks out that tag on GitHub-hosted runners and bundles every platform
there — the workflow, its runs and its logs are public, and nothing that
ships is built on a developer's machine.Write access, tag-push rights and signing approval all rest with the project maintainer. How to verify a signature on each platform is in the guide: Code signing policy.
Free code signing for battuta is provided by SignPath.io, with a certificate issued by the SignPath Foundation.
GNU Affero General Public License v3.0 (AGPL-3.0-only). Verovio, which does all notation rendering, is LGPL-3.0 — compatible with this licensing. battuta is made by Vibetuned, a nonprofit for music and arts education; contributions are accepted under its contributor licence agreement — see CONTRIBUTING.md.