MetricModulation

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.indicators" { graph [label="abjad.indicators"]; node [color=1]; "abjad.indicators.MetricModulation.MetricModulation" [URL="../api/abjad/indicators/MetricModulation.html#abjad.indicators.MetricModulation.MetricModulation", color=black, fontcolor=white, label="Metric\nModulation", target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/indicators/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjad/indicators/../system/AbjadValueObject.html#abjad.system.AbjadValueObject.AbjadValueObject", label="Abjad\nValue\nObject", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.AbjadValueObject.AbjadValueObject"; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.AbjadValueObject.AbjadValueObject" -> "abjad.indicators.MetricModulation.MetricModulation"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.indicators.MetricModulation.MetricModulation(left_rhythm=None, right_rhythm=None, *, hide=None, left_markup=None, right_markup=None)

Metric modulation.

With notes:

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=abjad.Note("c'4."),
...     )
>>> abjad.show(metric_modulation) 

With tuplets:

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Tuplet((4, 5), "c'4"),
...     right_rhythm=abjad.Note("c'4"),
...     )
>>> abjad.show(metric_modulation) 
>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=abjad.Tuplet((4, 5), "c'4"),
...     )
>>> abjad.show(metric_modulation) 

With tuplets again:

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c16."),
...     right_rhythm=abjad.Tuplet((2, 3), "c8"),
...     )
>>> abjad.show(metric_modulation) 

With ties:

>>> maker = abjad.NoteMaker()
>>> notes = maker([0], [(5, 16)])
>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=notes,
...     )
>>> abjad.show(metric_modulation) 

With ties and tuplets:

>>> maker = abjad.NoteMaker()
>>> notes = maker([0], [(5, 16)])
>>> tuplet = abjad.Tuplet((2, 3), notes)
>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=tuplet,
...     )
>>> abjad.show(metric_modulation) 

Attach metric modulations to generate score output:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4 e'4 d'4")
>>> abjad.attach(abjad.TimeSignature((3, 4)), staff[0])
>>> score = abjad.Score([staff])
>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c4"),
...     right_rhythm=abjad.Note("c8."),
...     )
>>> abjad.attach(metric_modulation, staff[3])
>>> abjad.override(staff).text_script.staff_padding = 2.5
>>> abjad.show(score) 

Attributes Summary

__eq__ Is true when argument is another metric modulation with the same ratio as this metric modulation.
__format__ Formats metric modulation.
__hash__ Hashes metric modulation.
__illustrate__ Illustrates metric modulation.
__str__ Gets string representation of metric modulation.
hide Is true when metric modulation generates no LilyPond output.
left_markup Gets left markup of metric modulation.
left_rhythm Gets left rhythm of metric modulation.
ratio Gets ratio of metric modulation.
right_markup Gets right markup of metric modulation.
right_rhythm Gets right tempo of metric modulation.
tweaks Are not implemented on metric modulation.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

__eq__(argument)

Is true when argument is another metric modulation with the same ratio as this metric modulation.

>>> metric_modulation_1 = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=abjad.Note("c'4."),
...     )
>>> metric_modulation_2 = abjad.MetricModulation(
...     left_rhythm=abjad.Tuplet((2, 3), [abjad.Note("c'4")]),
...     right_rhythm=abjad.Note("c'4"),
...     )
>>> maker = abjad.NoteMaker()
>>> notes = maker([0], [(5, 16)])
>>> metric_modulation_3 = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=notes,
...     )
>>> metric_modulation_1.ratio
Ratio((2, 3))
>>> metric_modulation_2.ratio
Ratio((2, 3))
>>> metric_modulation_3.ratio
Ratio((4, 5))
>>> metric_modulation_1 == metric_modulation_1
True
>>> metric_modulation_1 == metric_modulation_2
True
>>> metric_modulation_1 == metric_modulation_3
False
>>> metric_modulation_2 == metric_modulation_1
True
>>> metric_modulation_2 == metric_modulation_2
True
>>> metric_modulation_2 == metric_modulation_3
False
>>> metric_modulation_3 == metric_modulation_1
False
>>> metric_modulation_3 == metric_modulation_2
False
>>> metric_modulation_3 == metric_modulation_3
True
Return type:bool
__format__(format_specification='')

Formats metric modulation.

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=abjad.Note("c'4."),
...     )
>>> abjad.f(metric_modulation)
abjad.MetricModulation(
    left_rhythm=abjad.Selection(
        [
            abjad.Note("c'4"),
            ]
        ),
    right_rhythm=abjad.Selection(
        [
            abjad.Note("c'4."),
            ]
        ),
    )
Return type:str
__hash__()

Hashes metric modulation.

Redefined in tandem with __eq__.

Return type:int
__illustrate__()

Illustrates metric modulation.

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Tuplet((2, 3), "c'4"),
...     right_rhythm=abjad.Note("c'4."),
...     )
>>> abjad.show(metric_modulation) 

Returns LilyPond file.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

__str__()

Gets string representation of metric modulation.

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Tuplet((2, 3), [abjad.Note("c'4")]),
...     right_rhythm=abjad.Note("c'4"),
...     )
>>> print(str(metric_modulation))
\markup {
    \score
        {
            \new Score
            \with
            {
                \override SpacingSpanner.spacing-increment = #0.5
                proportionalNotationDuration = ##f
            }
            <<
                \new RhythmicStaff
                \with
                {
                    \remove Time_signature_engraver
                    \remove Staff_symbol_engraver
                    \override Stem.direction = #up
                    \override Stem.length = #5
                    \override TupletBracket.bracket-visibility = ##t
                    \override TupletBracket.direction = #up
                    \override TupletBracket.minimum-length = #4
                    \override TupletBracket.padding = #1.25
                    \override TupletBracket.shorten-pair = #'(-1 . -1.5)
                    \override TupletBracket.springs-and-rods = #ly:spanner::set-spacing-rods
                    \override TupletNumber.font-size = #0
                    \override TupletNumber.text = #tuplet-number::calc-fraction-text
                    tupletFullLength = ##t
                }
                {
                    \tweak edge-height #'(0.7 . 0)
                    \times 2/3 {
                        c'4
                    }
                }
            >>
            \layout {
                indent = #0
                ragged-right = ##t
            }
        }
    =
    \hspace
        #-0.5
    \score
        {
            \new Score
            \with
            {
                \override SpacingSpanner.spacing-increment = #0.5
                proportionalNotationDuration = ##f
            }
            <<
                \new RhythmicStaff
                \with
                {
                    \remove Time_signature_engraver
                    \remove Staff_symbol_engraver
                    \override Stem.direction = #up
                    \override Stem.length = #5
                    \override TupletBracket.bracket-visibility = ##t
                    \override TupletBracket.direction = #up
                    \override TupletBracket.minimum-length = #4
                    \override TupletBracket.padding = #1.25
                    \override TupletBracket.shorten-pair = #'(-1 . -1.5)
                    \override TupletBracket.springs-and-rods = #ly:spanner::set-spacing-rods
                    \override TupletNumber.font-size = #0
                    \override TupletNumber.text = #tuplet-number::calc-fraction-text
                    tupletFullLength = ##t
                }
                {
                    c'4
                }
            >>
            \layout {
                indent = #0
                ragged-right = ##t
            }
        }
    }
Return type:str

Read-only properties

hide

Is true when metric modulation generates no LilyPond output.

Return type:Optional[bool]
left_markup

Gets left markup of metric modulation.

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=abjad.Note("c'4."),
...     )
>>> metric_modulation.left_markup
Return type:Optional[Markup]
left_rhythm

Gets left rhythm of metric modulation.

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=abjad.Note("c'4."),
...     )
>>> metric_modulation.left_rhythm
Selection([Note("c'4")])

Returns selection.

ratio

Gets ratio of metric modulation.

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Tuplet((2, 3), [abjad.Note("c'4")]),
...     right_rhythm=abjad.Note("c'4"),
...     )
>>> metric_modulation.ratio
Ratio((2, 3))
Return type:Ratio
right_markup

Gets right markup of metric modulation.

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=abjad.Note("c'4."),
...     )
>>> metric_modulation.right_markup
Return type:Optional[Markup]
right_rhythm

Gets right tempo of metric modulation.

>>> metric_modulation = abjad.MetricModulation(
...     left_rhythm=abjad.Note("c'4"),
...     right_rhythm=abjad.Note("c'4."),
...     )
>>> metric_modulation.right_rhythm
Selection([Note("c'4.")])
tweaks

Are not implemented on metric modulation.

Return type:None