Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle abjad.MetronomeMark.textual_indication literally #1498

Closed
trevorbaca opened this issue Nov 1, 2022 · 2 comments · Fixed by #1499
Closed

Handle abjad.MetronomeMark.textual_indication literally #1498

trevorbaca opened this issue Nov 1, 2022 · 2 comments · Fixed by #1499
Assignees
Labels
Milestone

Comments

@trevorbaca
Copy link
Member

Abjad 3.13 wraps abjad.MetronomeMark.textual_indication with an extra pair of double quotes when textual_indication contains whitespace:

>>> mark = abjad.MetronomeMark(textual_indication="Allegro")
>>> string = abjad.lilypond(mark)
>>> print(string)
\tempo Allegro

>>> mark = abjad.MetronomeMark(textual_indication="Allegro ma")
>>> string = abjad.lilypond(mark)
>>> print(string)
\tempo "Allegro ma"

The behavior was designed to be helpful (the second example above does make good LilyPond input), but is at odds with the literal (WYSIWYG) way of working with abjad.Markup, and almost all other objects in Abjad.

The right way to produce \tempo "Allegro ma" should be with text_indication='"Allegro ma"', but this results in a redundant pair of double quotes in Abjad 3.13:

>>> mark = abjad.MetronomeMark(textual_indication='"Allegro ma"')
>>> string = abjad.lilypond(mark)
>>> print(string)
\tempo ""Allegro ma""

Abjad 3.14 removes this behavior and outputs the contents of textual_indication exactly as entered by the user:

>>> mark = abjad.MetronomeMark(textual_indication="Allegro")                                  
>>> string = abjad.lilypond(mark)                                                             
>>> print(string)
\tempo Allegro
                                                                             
>>> mark = abjad.MetronomeMark(textual_indication="Allegro ma")                               
>>> string = abjad.lilypond(mark)                                                             
>>> print(string)
\tempo Allegro ma
                                                                             
>>> mark = abjad.MetronomeMark(textual_indication='"Allegro ma"')                             
>>> string = abjad.lilypond(mark)                                                             
>>> print(string)      
\tempo "Allegro ma"                  
@trevorbaca trevorbaca added the bug label Nov 1, 2022
@trevorbaca trevorbaca added this to the 3.14 milestone Nov 1, 2022
@trevorbaca trevorbaca self-assigned this Nov 1, 2022
@trevorbaca
Copy link
Member Author

@martin-ribot

@martin-ribot
Copy link

Great! Thank you. Sorry for not having opened the issue here as I said I would!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants