Re: [abjad-user] Re: Tuplets not showing fraction or bracket

6 views
Skip to first unread message

Martín Rincón Botero

unread,
Dec 29, 2022, 4:48:41 AM12/29/22
to abjad-user
Hi Paul,

the extend method appends each of the elements of an object/list containing multiple elements, whereas the append method appends the object/list as one thing. For tuplets you should always use append, so that you can make sure that the whole object (including the tuplet ratio and braces {}) and not only the elements contained —the leaves— is added to the score.

Regards,
Martín.



On Dec 29, 2022 at 6:49 AM, <Paul Marquardt> wrote:

Strange-- this shows the fraction and bracket as desired:
score = abjad.Score(name="Score 1")
staff1 = abjad.Staff(name="Line 1")
tup_string = r"\times 2/3 { r8 c''4}"
staff1.extend(tup_string)
staff1.extend("r4 r4 r4")
staff1.extend("r4 r4 r8 ds'8 r4")
score.append( staff1 )
staff2 = abjad.Staff(name="Line 2")
staff2.extend("r4 r4 r4")
tup2 = abjad.Tuplet((5, 4), "r8. as''8")
staff2.extend(tup2)
score.append(staff2)
abjad.show(score)

Possibly problem solved... I'll try to run with this solution.

abjad_example_02.png
Thanks for taking a look



On Wednesday, December 28, 2022 at 10:34:27 PM UTC-7 Paul Marquardt wrote:
Hi!
   I'm trying to understand the Tuplet a little better. I'm using Staff.extend() to add events to a Staff. Here's a very simple example:
score = abjad.Score(name="Score 1")
staff1 = abjad.Staff(name="Line 1")
tup = abjad.Tuplet((2, 3), "r8 c''4")
staff1.extend(tup)
staff1.extend("r4 r4 r4")
staff1.extend("r4 r4 r8 ds'8 r4")
score.append( staff1 )
staff2 = abjad.Staff(name="Line 2")
staff2.extend("r4 r4 r4")
tup2 = abjad.Tuplet((5, 4), "r8. as''8")
staff2.extend(tup2)
score.append(staff2)
abjad.show(score)

The placement of tuplets in the Staff works out, but I can't seem to get it to show the brackets with "3:2" or "5:4". It's not a show-stopper for me, as the output is mostly  an intermediate step in the final score, but it would help a lot to have them displayed. Is there any documentation link I can read?

Platform: Ubuntu 22.04
Python: Python 3.10.6
Abjad: 3.14
Lilypond: GNU LilyPond 2.22.1

Attaching an image of what I get...
abjad_example_01.png

Thanks!
Paul Marquardt

--
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/aee5e609-d486-48ed-9443-11f67cbc605fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages