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

QuantizedPart,

Methods Summary

check()

Check that this part is valid

distributeByClef()

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

findOverlap()

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?

iterWithOffset()

Iterate over the notations in this part with their resolved offsets

meanPitch()

The mean pitch of this part, weighted by the duration of each pitch

needsMultipleClefs()

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]

dump()[source]

Dump this to stdout

Return type:

None

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 group

  • name – 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

hasGaps()[source]

Does this Part have gaps?

Return type:

bool

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

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

setGroup(groupid, name='', shortname='', showPartName=False)[source]
stack()[source]

Stack the notations of this part inplace.

Stacking means filling in any unresolved offset in this part. After this operation, all Notations in this UnquantizedPart have an explicit offset. :rtype: None