Attach string numbers to chord noteheads

2 views
Skip to first unread message

Davi Raubach

unread,
Jan 19, 2023, 2:11:47 PM1/19/23
to abjad...@googlegroups.com

Hello,

Is it possible to attach different string number for different chord noteheads?

I can attach string number to the chord but it does not appear in the lilypond code.

>>> chord = abjad.Chord("<c' e'>4")
str_nums = abjad.StringNumber((1, 2)) abjad.attach(str_nums, chord) print(abjad.lilypond(chord))
<c' e'>4

I tried (using finger numbers too):

>>> container = abjad.Container(r"<c'\2-1 e'\3-4>4")
print(abjad.lilypond(container))
{ <c' e'>4 }

Thank you,

Davi

Davi Raubach

unread,
Jan 20, 2023, 7:57:15 AM1/20/23
to abjad...@googlegroups.com

Sorry, I'm reposting the question again with some decent formatting.

Is it possible to attach different string number for different chord noteheads?

I can attach string number to the chord but it does not appear in the lilypond code.

chord = abjad.Chord("<c' e'>4")
str_nums = abjad.StringNumber((1, 2))
abjad.attach(str_nums, chord)
print(abjad.lilypond(chord))
<c' e'>4

I tried:

chord = abjad.Chord("<c' e'>4")
str_nums = abjad.StringNumber((1, 2))
abjad.attach(str_nums, chord.note_heads)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/abjad/bind.py", line 939, in attach
    assert isinstance(target, _score.Component), repr(target)
AssertionError: [NoteHead("c'"), NoteHead("e'")]

I tried directly (using finger numbers too):

container = abjad.Container(r"<c'\2-1 e'\3-4>4")
print(abjad.lilypond(container))
{
    <c' e'>4
}

Thank you,

Davi

Davi Raubach <rauba...@gmail.com> writes:

Hello,

Is it possible to attach different string number for different chord noteheads?

I can attach string number to the chord but it does not appear in the lilypond code.

chord = abjad.Chord("<c' e'>4")




strnums = abjad.StringNumber((1, 2)) abjad.attach(strnums, chord) print(abjad.lilypond(chord))

Reply all
Reply to author
Forward
0 new messages