systems.wsmn.temporal.symbols

symbols

Ready-to-go note durations, tuplet ratios, and time signatures.

from openmusickit.systems.wsmn.temporal.symbols import *

Examples

>>> quarter
MetricalDuration(1, 4)
>>> dotted_half
MetricalDuration(1, 2, dots=1)
>>> breve
MetricalDuration(2, 1)
>>> eighth_in_triplet.rational_length
Fraction(1, 12)
>>> six_eight.rational_length
Fraction(3, 4)
>>> six_eight == two_dotted_quarters
True
>>> quarter + eighth == dotted_quarter
True
>>> quarter + grace_eighth == quarter
True

Attributes

Name Description
maxima
longa
breve
whole
semibreve
half
minim
quarter
crotchet
eighth
quaver
sixteenth
semiquaver
thirtysecond
demisemiquaver
sixtyfourth
hemidemisemiquaver
onehundredtwentyeighth
semihemidemisemiquaver
dotted_maxima
dotted_longa
dotted_breve
dotted_whole
dotted_semibreve
dotted_half
dotted_minim
dotted_quarter
dotted_crotchet
dotted_eighth
dotted_quaver
dotted_sixteenth
dotted_semiquaver
dotted_thirtysecond
dotted_demisemiquaver
dotted_sixtyfourth
dotted_hemidemisemiquaver
double_dotted_maxima
double_dotted_longa
double_dotted_breve
double_dotted_whole
double_dotted_semibreve
double_dotted_half
double_dotted_minim
double_dotted_quarter
double_dotted_crotchet
double_dotted_eighth
double_dotted_quaver
double_dotted_sixteenth
double_dotted_semiquaver
double_dotted_thirtysecond
double_dotted_demisemiquaver
double_dotted_sixtyfourth
double_dotted_hemidemisemiquaver
breve_in_triplet
whole_in_triplet
semibreve_in_triplet
half_in_triplet
minim_in_triplet
quarter_in_triplet
crotchet_in_triplet
eighth_in_triplet
quaver_in_triplet
sixteenth_in_triplet
semiquaver_in_triplet
thirtysecond_in_triplet
demisemiquaver_in_triplet
sixtyfourth_in_triplet
hemidemisemiquaver_in_triplet
grace_eighth
acciaccatura_eighth
grace_sixteenth
acciaccatura_sixteenth
appoggiatura_quarter
appoggiatura_eighth
appoggiatura_sixteenth
one_one
two_one
three_one
one_two
two_two
cut_time
three_two
four_two
one_four
two_four
three_four
four_four
common_time
five_four
six_four
seven_four
three_eight
five_eight
six_eight
seven_eight
nine_eight
twelve_eight
one_dotted_quarter
one_dotted_crotchet
two_dotted_quarters
two_dotted_crotchets
three_dotted_quarters
three_dotted_crotchets
four_dotted_quarters
four_dotted_crotchets
five_eight_2_3
five_eight_3_2
seven_eight_2_2_3
seven_eight_3_2_2
seven_eight_2_3_2

Functions

Name Description
tuplet nominal_count notes of base in the time of contextual_count notes of base.
triplet 3 in the time of 2.
duplet 2 in the time of 3 (for compound meters).
quintuplet 5 in the time of 4.
sextuplet 6 in the time of 4 (the same ratio as a triplet).
septuplet 7 in the time of 4 (the common simple-meter septuplet; use tuplet(7, 6, …) for the other).
time_signature A simple time signature n/d, presented as written.
additive_time_signature An additive time signature such as 2+2+3/8.

tuplet

tuplet(nominal_count: int, contextual_count: int, base: MetricalDuration)

nominal_count notes of base in the time of contextual_count notes of base.

>>> tuplet(3, 2, quarter).multiplier
Fraction(2, 3)

triplet

triplet(base: MetricalDuration)

3 in the time of 2.

>>> triplet(quarter).multiplier
Fraction(2, 3)
>>> MetricalDuration(1, 8, ratio=triplet(eighth)).rational_length
Fraction(1, 12)

duplet

duplet(base: MetricalDuration)

2 in the time of 3 (for compound meters).

>>> duplet(eighth).multiplier
Fraction(3, 2)

quintuplet

quintuplet(base: MetricalDuration)

5 in the time of 4.

>>> quintuplet(sixteenth).multiplier
Fraction(4, 5)

sextuplet

sextuplet(base: MetricalDuration)

6 in the time of 4 (the same ratio as a triplet).

>>> sextuplet(sixteenth).multiplier
Fraction(2, 3)

septuplet

septuplet(base: MetricalDuration)

7 in the time of 4 (the common simple-meter septuplet; use tuplet(7, 6, …) for the other).

>>> septuplet(eighth).multiplier
Fraction(4, 7)

time_signature

time_signature(n: int, d: int)

A simple time signature n/d, presented as written.

>>> time_signature(3, 4)
TimeSignature([TemporalUnit(3, MetricalDuration(1, 4))], ('3', '4'))

additive_time_signature

additive_time_signature(groups: list[int], d: int)

An additive time signature such as 2+2+3/8.

>>> additive_time_signature([2, 2, 3], 8).presentation
('2+2+3', '8')