Mx.Page (mx v0.1.0)

Copy Markdown View Source

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.

Summary

Functions

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.

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

Functions

data(song, path, seconds)

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(path, out, opts \\ [])

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