Figured Bass support

5 views
Skip to first unread message

David Stone

unread,
Sep 9, 2022, 8:28:08 PM9/9/22
to abjad-user
I'm scratching my head about how to implement figured bass in abjad. 

I've tried using abjad.attach of Lilypond literals with the proper "\figures { ... }" type strings, which creates figures that seem to "push" the existing voice out of the way. How do I get the figures to align with existing bass notes?


Martín Rincón Botero

unread,
Sep 10, 2022, 2:37:15 PM9/10/22
to abjad...@googlegroups.com

Hi David,

as far as I know figured bass is not yet implemented. You can fake it with LilyPondLiterals, but the corresponding context will remain empty, which means that you're not gonna be able to manipulate it (no appending, extending, etc.) and the resulting formatting of the lilypond file is not gonna be particularly pretty. This works for the simplest cases:

import abjad


def figured_bass(figures):
   context = abjad.Context(lilypond_type="FiguredBass")
   figures = abjad.LilyPondLiteral(r"\figuremode { " + figures + " }")
   abjad.attach(figures, context)
   return context
   

container = abjad.Container(simultaneous=True)
voice = abjad.Voice(r"\clef bass dis4 c d ais g fis", language="nederlands")
fig_bass = figured_bass(r"<6>4 <7\+>8 <6+ [_!]> <6>4 <6 5 [3+]> | <_>4 <6 5/>4")
container.extend([voice, fig_bass])
>>> print(abjad.lilypond(container))
<<
  \new Voice
  {
      \clef "bass"
      ds4
      c4
      d4
      as4
      g4
      fs4
  }
  \new FiguredBass
  {
      \figuremode { <6>4 <7\+>8 <6+ [_!]> <6>4 <6 5 [3+]> | <_>4 <6 5/>4 }
  }
>>
>>> abjad.show(container)

image.png

Cheers,

Martín.


Am Sa., 10. Sept. 2022 um 02:28 Uhr schrieb David Stone <da...@bergenstreetmusic.com>:
I'm scratching my head about how to implement figured bass in abjad. 

I've tried using abjad.attach of Lilypond literals with the proper "\figures { ... }" type strings, which creates figures that seem to "push" the existing voice out of the way. How do I get the figures to align with existing bass notes?


--
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 on the web visit https://groups.google.com/d/msgid/abjad-user/9fe46f09-f387-4f12-8bf7-7adf5dee2762n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages