UnquantizedPart¶
- class maelzel.scoring.UnquantizedPart(notations, name='', shortname='', groupid='', groupname='', showName=True, quantProfile=None, resolve=True)[source]¶
Bases:
object
An UnquantizedPart is a list of unquantized non-simultaneous
Notation
See also
Methods Summary
check
()Check that this part is valid
Distribute the notations in this Part into multiple parts, based on pitch
dump
()Dump this to stdout
fillGaps
([mingap])Fill gaps between notations in this Part, inplace
Find the next overlap within the items of this part
groupParts
(parts[, name, shortname, ...])Mark the given parts as belonging to one group
hasGaps
()Does this Part have gaps?
Iterate over the notations in this part with their resolved offsets
The mean pitch of this part, weighted by the duration of each pitch
True if the notations in this Part extend over the range of one clef
setGroup
(groupid[, name, shortname, ...])stack
()Stack the notations of this part inplace.
Methods Documentation
- check()[source]¶
Check that this part is valid
Raises ValueError if an error is found
- Return type:
None
- distributeByClef()[source]¶
Distribute the notations in this Part into multiple parts, based on pitch
- Return type:
list
[UnquantizedPart
]
- fillGaps(mingap=Fraction(1, 64))[source]¶
Fill gaps between notations in this Part, inplace
- Return type:
None
- findOverlap()[source]¶
Find the next overlap within the items of this part
- Returns:
F, eventindex: int), or None if no overlap
- Return type:
a tuple (overlapamount
- static groupParts(parts, name='', shortname='', groupid='', showPartNames=False)[source]¶
Mark the given parts as belonging to one group
- Parameters:
parts (
list
[UnquantizedPart
]) – the parts to groupname – a name for the group
shortname – short name used for all systems after the first
groupid – an explicit group id to use. If not given, a group id is created
showPartNames – if True, the names for each part are shown (if present). Otherwise part names are hidden and only the group name is shown
- Return type:
str
- Returns:
the group id assigned to the parts
- iterWithOffset()[source]¶
Iterate over the notations in this part with their resolved offsets
The notations are not modified
- Returns:
Notation, offset: F)
- Return type:
an iterator of tuple(notation
See also
- meanPitch()[source]¶
The mean pitch of this part, weighted by the duration of each pitch
- Return type:
float
- Returns:
a float representing the mean pitch as midinote
- needsMultipleClefs()[source]¶
True if the notations in this Part extend over the range of one clef
- Return type:
bool