TempoEvent

TempoEvent(
    duration: Duration | None = None,
    tempo: TemporalRatio | None = None,
    term: TempoTerm | None = None,
)

Sets the tempo for the material that follows: the rate at which its durations pass, as a TemporalRatio, the word for it, as a TempoTerm, or both.

The ratio’s nominal side is in the units of the line’s own system; its contextual side is what those units are measured against from here on. That is clock time for a metronome marking, which is a Tempo; the units of the material before for a metric modulation (or a proportion, in mensural notation), which says how the new note values relate to the old and nothing about clock time; or the units of another system, when one line is paced against another (one puntum of chant to one quarter note). None means undefined or undecided.

>>> from openmusickit.systems.wsmn.temporal.symbols import dotted_quarter, quarter
>>> from openmusickit.values.time.clock_time import Tempo
>>> TempoEvent(tempo=Tempo(120, quarter))
TempoEvent(tempo=Tempo(120, MetricalDuration(1, 4)), term=None)
>>> TempoEvent().tempo is None
True

A metric modulation written “quarter = dotted quarter” (the new dotted quarter lasts as long as the quarter before it) has the new value on the nominal side and the old on the contextual:

>>> modulation = TempoEvent(tempo=TemporalRatio(dotted_quarter, quarter))
>>> modulation
TempoEvent(tempo=TemporalRatio(MetricalDuration(1, 4, dots=1), MetricalDuration(1, 4)), term=None)
>>> modulation.tempo.multiplier
Fraction(2, 3)

The term is the word as printed (Allegro, Andante, a tempo): a TempoTerm from the system’s vocabulary, or one made for the score. It stands beside the ratio when the score gives both, and alone when the score gives no figure. A term says nothing about clock time by itself, so tempo stays None until something sets it.

>>> from openmusickit.systems.wsmn.scoring.symbols import a_tempo, allegro
>>> event = TempoEvent(tempo=Tempo(132, quarter), term=allegro)
>>> event.tempo, event.term.name
(Tempo(132, MetricalDuration(1, 4)), 'allegro')
>>> TempoEvent(term=a_tempo).tempo is None, TempoEvent().term is None
(True, True)
>>> TempoEvent(term=TempoTerm(name="tempo giusto"))
TempoEvent(tempo=None, term=TempoTerm(name='tempo giusto', description=None, aliases=()))

Attributes

Name Description
meta
id
duration
tempo
term

Methods

Name Description
__setattr__
alter_duration

__setattr__

__setattr__(name: str, value: Any)

alter_duration

alter_duration(operation: Callable[[Duration, Any], Duration], operand: Any)