neoscore.western.duration
- class neoscore.western.duration.Duration[source]
Bases:
objectA metered non-tuplet duration.
The duration fraction indicates duration as a fraction of a whole note. The actual written denomination of duration is deduced from the reduced fraction. For instance:
Duration(1, 4)indicates a quarter note valueDuration(1, 1)indicates a whole note valueDuration(3, 8)indicates a dotted quarter note value
- numerator: dataclasses.InitVar
- denominator: dataclasses.InitVar
- fraction: fractions.Fraction
The reduced fraction representation of the duration
- display: Optional[DurationDisplay]
The appearance spec of the duration when written in notes or rests.
This is
Noneif the duration cannot be represented without ties.
- classmethod from_def(duration_def: DurationDef) Duration[source]
- classmethod from_description(base_division: int, dots: int) Duration[source]
Create a
Durationfrom a base division and a number of dots.Durations created with this will always have a validDurationDisplay.- Parameters
base_division – Must be 0 (double whole note) or a power of 2
dots – Must be >= 0
- property requires_tie: bool
If this Duration requires a tie to be written.
- __init__(numerator: InitVar, denominator: InitVar) None