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

Runs Audiveris, the optical music recognition program, on page images, and gathers the MusicXML it writes for each page into one score.

mx runs Audiveris as a separate program and ships none of its code.
It is looked for at the `:audiveris` path in mx's config, which the `AUDIVERIS` environment variable sets, then as `audiveris` on the path, then where its macOS installer puts it.

# `find`

The path to the Audiveris program, or nil when it is not installed.

# `merge`

Joins the scores of several pages into one, appending each page's measures to the part at the same position on the first page.
A part a page lacks, or reads fewer bars of, gets empty measures there, so the parts stay in step.

Returns `{xml, bars, parts}`, with the number of bars and of parts read from each score.

# `recognize`

Recognizes each image, writing Audiveris's books and MusicXML into `dir`, and returns the MusicXML files written for each image in order, an empty list for an image with no music.

# `write_mxl`

Writes MusicXML text as a compressed .mxl file.

---

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