ai-setup 4 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 app running on iPhone, showing real-time piano autocomplete

TL;DR

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.

Source and Accuracy Notes

⚠️ This section is MANDATORY. All links must be verified from actual source, not guessed.

What Is RollTab?

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:

  • 125M-parameter transformer running on iPhone 15
  • Real-time output at roughly 108 notes per second
  • Core ML for on-device inference
  • Zero cloud dependency — audio never leaves the phone

The HN launch post (news.ycombinator.com/item?id=49373456) received 589 points and strong technical discussion about the training approach.

How the MIDI Tokenizer Works

Unlike text, 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.

The blog post covers the tokenization strategy in detail:

  • Each MIDI event becomes a discrete token
  • Time deltas between events are discretized into fixed bins
  • The model learns to predict not just which note comes next, but when it comes

This is analogous to how byte-pair encoding handles text — the vocabulary is built from common musical patterns in the training data.

Training the Model

The model is a 125M-parameter decoder-only transformer trained on MIDI performances. Key design choices from the author:

  • Architecture: Standard causal transformer (like GPT-2 scale)
  • Training data: MIDI performance dataset (specific source not disclosed in the launch post)
  • Packaging: Core ML for iOS integration — the author notes this as non-trivial

The author also documents several approaches that did not work, demonstrating the experimental rigor behind the final system.

Performance on iPhone 15

The benchmark reported is approximately 108 notes per second on iPhone 15. This is sufficient for real-time human-in-the-loop use — you play a phrase, the model continues it, and you can accept, reject, or modify the output before it becomes overwhelming.

Practical Evaluation Checklist

  • Download: Free on the App Store (iOS)
  • Hardware requirement: iPhone 15 or newer (Apple Silicon for Core ML inference)
  • Privacy: All inference is on-device — no data sent to any server
  • Musical range: Depends on training data — classical, jazz, and contemporary pop MIDI datasets all behave differently
  • Open source: The model weights and training code are published on the author’s GitHub

FAQ

Q: Can I use this with a hardware MIDI keyboard? A: Yes, RollTab accepts MIDI input from connected keyboards via the standard Core MIDI framework.

Q: Does it work offline? A: Yes — all inference is on-device with no network dependency.

Q: How does this compare to AI music generation tools like Suno or Udio? A: RollTab is not a composition or arrangement tool. It operates at the MIDI event level, predicting note sequences in real time as you play. It is more analogous to Tabnine than to generative music platforms.

Q: Is the model open source? A: The training code and model weights are published on GitHub under the MIT license. The app itself is free on the App Store.

Conclusion

RollTab demonstrates that real-time transformer inference on a smartphone is practical for creative tasks. The 125M-parameter scale is small enough to run locally while being large enough to capture meaningful musical patterns. The core innovation is the MIDI tokenizer — converting a time-series of musical events into a format where next-token prediction actually works.

If you have an iPhone 15 and a MIDI keyboard, it is worth installing to feel what on-device AI music assistance behaves like in practice.