
I love the piano. I have also always preferred to learn things on my own, at my own pace, rather than sit in front of a teacher. Those two facts do not mix well, because the first wall a self-taught pianist hits is reading notes. Before you can play anything you need to look at a dot on the staff and know, quickly and without counting lines, which key it means. Books can explain that. They cannot watch you get it wrong, notice which notes you keep confusing, and bring those notes back tomorrow.
So one evening in November I decided to write the teacher myself: an app that would teach me to read notes and get me playing. The first commit went in at 22:40 on 18 November 2026. The app was called Note-Yar for its first five days; on 23 November it became Melupia («ملوپیا»), and that is the name it carries in the stores today.
This series is about how it is built. It is a learning app, so the interesting parts are less about screens and more about decisions: which note to show next, how to tell a slip from a habit, how to draw music on a phone, how to listen to a real piano, and how to keep all of that fast. This first part describes what the app does, how the pieces fit, and what I would not yet claim about it.
What a practice session looks like
A note, a chord or a short passage appears on a staff. You answer on an on-screen keyboard that plays recorded Steinway samples, or on your own digital piano connected over USB or Bluetooth MIDI. The app grades the answer for correctness and for speed, and picks what to show next from what it has learned about you.
Around that loop sit the parts a teacher would normally provide:
- Smart practice chooses each next note from a model of what you know and what you keep confusing. Parts 2 and 3 cover it.
- A reading ladder of 20 stages runs from the first five notes of the treble clef to two measures on both staves, with drills in between. It offers the next stage and never moves you on by itself.
- A song path holds 176 public-domain and traditional pieces in 16 levels, Iranian folk tunes among them, grouped into chapters.
- Tempo practice plays a metronome and judges rhythm as well as pitch, after a short latency calibration so that a slow Bluetooth piano is not marked late.
- Classes let a piano teacher invite students with a code, set homework and see who has done it.
There is no microphone input. The app cannot hear an acoustic piano; it hears keys on the screen or MIDI messages from a digital instrument. That limit comes up again in part 5.
Two editions from one codebase
Melupia is Android only. Every build carries both languages, and the store decides which one opens first: the Persian edition is on Myket and Cafe Bazaar, and the English edition is on Google Play. A learner can switch language in the settings. The app's own sites are melupia.com in Persian and en.melupia.com in English.
Persian is the default and the first audience, which shaped more of the code than I expected: digits, calendars, the direction of every arrow, and even what to call the notes. Part 4 is about that.
How the pieces fit
The app is Flutter. Under the screens sits a domain layer in plain Dart that holds the music and the learning logic: pitch and staff positions, the memory model, the scheduler, tempo windows, MIDI parsing and the rules for subscriptions. It has 88 files and about 29,000 lines, and none of them imports Flutter. That boundary is the reason most of the interesting code can be tested without a device. It is not perfectly clean, though: some domain files import song-library code from the data folder, which itself uses only Dart, so the domain stays free of Flutter but the layering is looser than the folder names suggest.
| Layer | What it uses |
|---|---|
| Domain | Plain Dart: notes, staff geometry, memory model, scheduler, tempo, MIDI parser |
| State | No state-management package; ChangeNotifier, a few InheritedWidgets and stateful widgets |
| Storage | JSON in shared_preferences, with no database on the phone |
| Drawing | Custom painters for the staff and the keyboard, clefs from the Noto Music font |
| Sound | flutter_soloud with 30 recorded Steinway samples stored as FLAC |
| Real piano | My own Kotlin plugin for USB and Bluetooth MIDI |
| Server | Plain PHP 8 on MariaDB for accounts, sync, classes and the song catalogue, with a Laravel 12 admin panel |
Practice works offline. The songs, samples and fonts ship inside the app, and the server adds accounts, syncing between devices, classes and an updated song catalogue. When progress syncs, the phone sends absolute numbers per day and the server keeps the larger value for each field, so nothing on the phone is ever replaced by the server's answer.
Songs are plain text
Each piece starts as a small text file that a teacher can read and edit, and a build script turns all of them into one JSON file for the app. Here is the start of the first song, trimmed:
id: hot-cross-buns title: Hot Cross Buns level: 1 clef: treble key: C time: 4/4 tempo: 92 teachingEn: Only three notes: Mi (E4), Re (D4) and Do (C4). treble: E4q D4q C4h | E4q D4q C4h | C4e C4e C4e C4e D4e D4e D4e D4e | E4q D4q C4h |
A token such as E4q is a pitch and a duration: E in the fourth octave, a quarter note. The format also covers dots, triplets, chords, ties, octave lines, fingering and dynamics, and the build script refuses a piece that breaks its rules, for example a song longer than 250 events without sections. Keeping the music as text meant I could review it like code and fix a wrong note with a one-line change.
Thirteen days
The history is short and dense. There are 618 commits between 18 and 30 November, and 412 of them, about two thirds, landed on 20, 21 and 22 November. The first evening produced the Flutter skeleton, the pure-Dart domain with its tests, the staff and keyboard painters and a first curriculum of 50 songs. The second day brought recorded piano samples, the first store builds and the English edition. Day three was the real piano over MIDI and the learner model. Version 2.0, with accounts, classes, homework and leagues, arrived on day five, and the rename to Melupia came on day six.
That pace was possible because I built the app with AI coding agents. 586 of the 618 commits carry a co-author line from Claude, and the repository defines eight project agents with separate roles, from a Flutter engineer and a piano teacher to a UX reviewer. I set the direction, made the product decisions and reviewed the work. Part 7 tells that story in full, including what it cost.
What I would not claim yet
The test suite is large for an app of this age: about 2,000 test cases, including 25 golden images of rendered screens, and simulated learners that check the scheduler's behaviour. There is no continuous integration yet; the tests run on my machine. The performance numbers I report in part 6 come from an emulator, because no real phone was connected when I measured. The learning model's constants are starting values checked against simulated learners, with no data from real learners behind them yet. Each of these limits returns in the part where it matters.
The rest of the series
- Why I built my own piano teacher (this part).
- Choosing the next note: an FSRS-style memory model and Thompson sampling.
- Traps: modelling the mistakes that keep coming back.
- Drawing music in Flutter, in Persian and English.
- A real piano over MIDI: my own plugin, clocks and latency.
- Steinway samples, APK size and a measured performance pass.
- 618 commits in 13 days with AI agents.
- Shipping to three stores, a server and what remains open.
Part 2 starts where every practice session starts: with a decision about which note to show next, and the memory model behind it.
This note is also available in Persian: read the Persian version.
