ai-setup 3 min read

RollTab: On-Device Piano Autocomplete for iPhone

A 125M-parameter transformer runs locally on iPhone 15 and autocompletes piano performances in real time at 108 notes/sec — no cloud required. GitHub Copilot logic, but for MIDI.

By
Share: X in
RollTab piano autocomplete on iPhone

TL;DR: RollTab is a free iOS app that runs a 125M-parameter transformer on iPhone 15 to autocomplete piano performances in real time — no cloud, no latency, privacy-preserving.

The idea behind it

RollTab applies the GitHub Copilot or Tabnine model — next-token prediction from a prefix — to MIDI piano performances. Instead of prompting a language model with code, you play a few notes and the model continues the musical phrase in real time. The entire inference stack runs on the device: a 125M-parameter transformer in Core ML, outputting at roughly 108 notes per second, with zero cloud dependency. Audio never leaves the phone.

The HN launch post (589 points) drew strong technical discussion about the training approach.

How the MIDI tokenizer works

MIDI files encode music as a sequence of timed events — note on, note off, velocity changes, tempo shifts. RollTab’s preprocessing converts these events into a token sequence the transformer can reason over. Each MIDI event becomes a discrete token, time deltas between events are discretized into fixed bins, and the model learns to predict not just which note comes next but when it comes. The vocabulary is built from common musical patterns in the training data, similar to how byte-pair encoding handles text.

This is the part that makes 108 notes/sec on a phone possible. The tokenization step is where most of the engineering difficulty lives — text tokenizers benefit from years of research and tooling, MIDI event tokenizers are much more bespoke.

Why on-device matters

Three reasons this is worth paying attention to beyond the technical demo:

  1. Latency — there’s no round-trip to a server, so the autocomplete feels responsive even on the variable cellular conditions you’d actually use a phone piano app in
  2. Privacy — your playing never leaves the device, which matters for people recording unreleased material or working through compositional ideas they don’t want on someone else’s server
  3. Cost — no per-inference API bill, which makes the “free” tier actually free to operate

The trade-off is that the model is bounded by what fits in Core ML on a phone — 125M parameters is small compared to a server-side music model, but it’s enough for phrase-level autocomplete, not full song generation.

Where to get it

RollTab is on the App Store (free) and the developer (simedw on GitHub) published the technical writeup covering the tokenization and training approach in detail. There’s no license file in the repo, but the developer confirmed open-source intent on the HN thread.

Source and Accuracy Notes