TemporalRatio

TemporalRatio(nominal: Measurable, contextual: Measurable)

The ratio of two Measurables (usually TemporalUnits).

Used for the following:

  • In WSMN, tuplets are a ratio of n number of nominal units which take place during d number of contextual (or actual units).
  • In WSMN, a metronome marking or tempo is ratio of n number of MetricalDurations during d number of ClockTime seconds.
  • In mixed-system contexts, a ratio of n TemporalUnits in one system to d TemporalUnits of another system can be used for syncing. (For example, one puntum in Gregorian chant may equal one quarter note in WSMN)

Other temporal systems may find other uses (for example, defining duration ratios within a gong cycle).

nominal: the number and type of notes notated and played contextual: (sometimes called “actual”) the length of time (expressed as a multiple of Durations) as measured in the surrounding context.

So, for example, a standard quarter note triplet (3 quarters in the time/space of 2 quarters) would be:

>>> from openmusickit.systems.wsmn.temporal.metrical_duration import MetricalDuration
>>> quarter = MetricalDuration(1, 4)
>>> triplet = TemporalRatio(nominal=TemporalUnit(3, quarter), contextual=TemporalUnit(2, quarter))
>>> triplet.multiplier
Fraction(2, 3)

Note that this only defines the relationship, and is not the tuplet itself. The ratio is then used in the definition of a Duration instance. (To calculate the RationalLength of the actual note, as opposed to its notated value.)

(It is also used in the definition of a Tuplet node, which groups the constituent Notes.)

Attributes

Name Description
nominal
contextual
multiplier The multiplier that converts a nominal length into a contextual length:

Methods

Name Description
__eq__
__hash__
__repr__

__eq__

__eq__(other)

__hash__

__hash__()

__repr__

__repr__()