Abjad / abjad

Abjad is a Python API for building LilyPond files. Use Abjad to make PDFs of music notation.
https://abjad.github.io
GNU General Public License v3.0
234 stars 41 forks source link

Add ``abjad.show(..., flags="")`` keyword #1575

Closed trevorbaca closed 6 months ago

trevorbaca commented 6 months ago

flags will be passed to the LilyPond commandline.

Use flags for LilyPond --include statements. This allows calls to abjad.show() to point LilyPond to scm/abjad.ily:

>>> flags = "--include=/Users/user/abjad/abjad/scm"
>>> abjad.show(score, flags=flags)

Recall that LilyPond --include statements do not specify included files; rather, LilyPond --include statements specify directories which LilyPond should search for included files, somewhat like the behavior of Python's PYTHONPATH environment variable. This means that this ...

lilypond --include=/Users/user/abjad/abjad/scm/abjad.ily

... will not work, but that this ...

lilypond --include=/Users/user/abjad/abjad/scm

... will work.

Add the same functionality to the following:

* abjad.persist.as_midi(..., flags="")
* abjad.persist.as_pdf(..., flags="")
* abjad.persist.as_png(..., flags="")