# `Mx.Page`
[🔗](https://github.com/mx-music/mx/blob/main/lib/mx/page.ex#L1)

Writes a song as one HTML page that plays it and shows each part's notes on a timeline, for `mix mx.page`.

The page holds the song's offline render, which ffmpeg encodes as MP3, so a browser plays what mx plays and works out no sound itself.
Each part's notes are the ones `Mx.Pass` works out, pass by pass, at the seconds `Mx.Tempo` gives their beats.
A note with no `sustain:` shows half a beat long, and a note a control step moves to another pitch shows as one mark for each pitch.
A sample shows as a hit, and so does a note of a sampled instrument, as its pass names the file it plays and not the key.
A hit lasts as long as its sample file plays at its rate, cut short by a sustain it is given, or as long as the attack, decay, sustain and release given to its synth; a synth hit given none of them lasts 0 seconds, as its synth alone knows how long it rings.
A part that waits for input is left out, as a render leaves it out.

# `data`

What the page shows of a loaded song that renders to `seconds` of sound: its sections, the seconds of each beat, and each part's notes and hits in seconds.

# `write`

Writes the song at `path` to the HTML file `out`, with `seconds:`, `force:` and `title:`, and returns `:ok` once written, or `{:error, message}`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
