Tempo
Tempo(n: int, beat: Duration, clock_time: ClockDuration = ONE_MINUTE)A TemporalRatio of n beats per clock_time (default: one minute).
Examples
>>> from openmusickit.systems.wsmn.temporal.symbols import quarter, dotted_quarter
>>> Tempo(120, quarter).multiplier # microseconds per whole note
Fraction(2000000, 1)
>>> ClockDuration.from_duration(quarter, Tempo(120, quarter)).seconds
Fraction(1, 2)
>>> ClockDuration.from_duration(dotted_quarter, Tempo(60, dotted_quarter)).seconds
Fraction(1, 1)Attributes
| Name | Description |
|---|---|
| nominal | |
| contextual | |
| multiplier | The multiplier that converts a nominal length into a contextual length: |
Methods
| Name | Description |
|---|---|
__eq__ |
|
__hash__ |
|
__init__ |
|
__repr__ |
The constructor’s arguments; the clock time only when it is not the default minute. |
__eq__
__eq__(other)__hash__
__hash__()__init__
__init__(n: int, beat: Duration, clock_time: ClockDuration = ONE_MINUTE)__repr__
__repr__()The constructor’s arguments; the clock time only when it is not the default minute.
>>> from openmusickit.systems.wsmn.temporal.symbols import quarter
>>> Tempo(120, quarter)
Tempo(120, MetricalDuration(1, 4))
>>> Tempo(2, quarter, ClockDuration.from_seconds(1))
Tempo(2, MetricalDuration(1, 4), ClockDuration(microseconds=1000000))