Hi Andrew,
As you are probably aware, there are usually a few ways a particular notation can be achieved in Lilypond. This can be both a good thing (many short-term solutions are available) and a bad thing (sometimes the preferred method is difficult to discover). For your needs it is entirely possible that downward markups are the most efficient method for you to use. However, looking at the Lilypond documentation it appears that the preferred method is to use a FiguredBass
context (see: https://lilypond.org/doc/v2.23/Documentation/notation/figured-bass).
This context is not currently modeled in Abjad, nor is the Lyrics context. This is not because it is not possible or even undesirable to have these contexts available. More likely, it is just a byproduct of the fact that until now most Abjad contributors and/or users have not wanted them. I wrote a piece a few years back where I needed to model the Lyrics context so let me suggest something for FiguredBass based on that experience:
class FiguredBass(
abjad.Context
):
### CLASS VARIABLES ###
__documentation_section__ = "Contexts"
__slots__ = ()
_default_lilypond_type = "FiguredBass"
### INITIALIZER ###
def __init__(
self,
components=None,
lilypond_type: str = "FiguredBass",
figures: str = r"\figuremode",
simultaneous: bool = False,
name: str = None,
tag: abjad.Tag = None,
*,
language: str = "english",
) -> None:
abjad.Context.__init__(
self,
components=components,
language=language,
lilypond_type=lilypond_type,
simultaneous=simultaneous,
name=name,
tag=tag,
)
lyrics_literal = abjad.LilyPondLiteral(fr"\figuremode {{ {figures} }}")
abjad.attach(lyrics_literal, self)
### PUBLIC PROPERTIES ###
@property
def tag(self):
return super().tag
As seen above, this FiguredBass context inherits from Abjad’s native Context
object. This should allow it to be accepted when inserted into an abjad.Score
or another object like it. The use case would look something like this:
figure_context = FiguredBass(figures=r"<6>4 <7\+>8 <6+ [_!]> <6>4")
where the figure notation as seen in the Lilypond docs are written as a string. The figures can then be placed in a staff set to simultaneous
and the figures will be rendered below the staff.
score = abjad.Score([abjad.Staff([abjad.Voice("c'4 c'8 c'8 c'4"), figure_context], simultaneous=True)])
abjad.show(score)
see the attached image
hope this helps,
Gregory Evans
--
You received this message because you are subscribed to the Google Groups "abjad-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to abjad-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/abjad-user/1a45b52d-45fa-496e-a082-959e6b30bc34n%40googlegroups.com.