The default of “meter hierarchy” of abjad.Meter((4, 4))
looks like this:
>>> meter = abjad.Meter((4, 4))
>>> print(meter.pretty_rtm_format)
(4/4 (
1/4
1/4
1/4
1/4))
Rewriting c16 c8 c16 c2.
with default abjad.Meter((4, 4))
splits the offbeat eighth note into a pair of tied sixteenths (as shown in your example):
>>> container = abjad.Container("c16 c8 c16 c2.")
>>> abjad.Meter.rewrite_meter(container, meter)
>>> abjad.show(container)
The metric hierarchy of any meter can be customized.
Here’s an example that customizes the structure of the first beat in the measure (but produces the same results as before):
>>> meter = abjad.Meter("(4/4 ((1/4 (1/8 1/8)) 1/4 1/4 1/4))")
>>> print(meter.pretty_rtm_format)
(4/4 (
(1/4 (
1/8
1/8))
1/4
1/4
1/4))
>>> container = abjad.Container("c16 c8 c16 c2.")
>>> abjad.Meter.rewrite_meter(container, meter)
>>> abjad.show(container)
And here’s an example that customizes the structure of the first beat in a different way, and probably gets closer to what you’re looking for:
>>> meter = abjad.Meter("(4/4 ((1/4 (1/16 1/16 1/16 1/16)) 1/4 1/4 1/4))")
>>> print(meter.pretty_rtm_format)
(4/4 (
(1/4 (
1/16
1/16
1/16
1/16))
1/4
1/4
1/4))
>>> container = abjad.Container("c16 c8 c16 c2.")
>>> abjad.Meter.rewrite_meter(container, meter)
>>> abjad.show(container)
If that output looks right, you’ll probably want to structure each beat in the measure the same way. Using a multiline string is easiest:
meter = abjad.Meter(
r"""(4/4 (
(1/4 (
1/16
1/16
1/16
1/16))
(1/4 (
1/16
1/16
1/16
1/16))
(1/4 (
1/16
1/16
1/16
1/16))
(1/4 (
1/16
1/16
1/16
1/16))))"""
)
Though I sometimes find it tricky to understand what abjad.Meter
is doing, the default values usually give pretty good output. When you want to change things, try customizing the meter hierarchy, like the examples here. It might also work to play with the values of boundary_depth
, which I haven’t shown here.
A few more examples are available in the docs:
https://abjad.github.io/api/abjad/meter.html#abjad.meter.Meter.rewrite_meter
Trevor.
--
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/924e6a2e-360a-4dcb-bdc5-badf8a18a238n%40googlegroups.com.