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

Clean up `abjad.illustrators.components()` #1543

Closed trevorbaca closed 1 year ago

trevorbaca commented 1 year ago

Add an explicit abjad.Voice context to the output created by abjad.illustrators.components().

EXAMPLE:

def main():
    components = [abjad.Note("c'4")]
    lilypond_file = abjad.illustrators.components(components)
    string = abjad.lilypond(lilypond_file["Score"])
    print(string)

OLD:

\context Score = "Score"
<<
    \context Staff = "Staff"
    {
        \time 1/4
        c'4
    }
>>

NEW:

\context Score = "Score"
<<
    \context Staff = "Staff"
    {
        \context Voice = "Voice"
        {
            \time 1/4
            c'4
        }
    }
>>