# notename-sheets

Converts two-staff piano sheet music into **note-name notation**: every notehead is
replaced by a small box containing the letter name *and an explicit accidental*
(`E♭`, `F♯`, `B`), so you never have to apply the key signature in your head.

- filled black box, white text = quarter note or shorter (would be a filled head)
- hollow box, black text = half note or longer (would be an open head)
- stems, beams, flags, rests, dots, ties, ledger lines, clefs, key/time signatures stay as normal
- printed accidentals are removed from the staff (they're now inside the heads)

## Pipeline

```
image / PDF  --(oemer OMR)-->  MusicXML  --(musicxml2ly)-->  .ly  --(lilypond)-->  PDF + PNG
```

## Setup (already done on this Mac)

- `brew install lilypond` (also provides `musicxml2ly`)
- `python3.11 -m venv .venv && .venv/bin/pip install oemer music21 pillow pymupdf`

## Use

```bash
./.venv/bin/python notenames.py path/to/score.png
./.venv/bin/python notenames.py path/to/score.pdf          # all pages
./.venv/bin/python notenames.py path/to/score.musicxml     # skip OMR
./.venv/bin/python notenames.py out/score/score_p1.ly      # re-render after hand edits
```

Outputs land in `out/<name>/`: `*_names.pdf` and `*_names.png`, plus the intermediate
`.musicxml` and `.ly` so recognition mistakes can be fixed by hand and re-rendered.

## Tuning

Everything about the look lives in `notename-heads.ily`:
`NoteHead.font-size` (text size), `h` (box height), `nn-acc-string` (which accidental
glyphs to print), and whether to `\omit Accidental` / `\omit KeySignature`.
