QuantizedScore¶
- class maelzel.scoring.quant.QuantizedScore(parts, title='', composer='')[source]¶
Bases:
object
A QuantizedScore represents a list of quantized parts
See
quantize()
for an example- Parameters:
parts (
list
[QuantizedPart
]) – the parts of this QuantizedScoretitle – an optional title for this score
composer – an optional composer for this score
- parts¶
the parts of this score
- title¶
an optional title
- composer¶
an optional composer
Attributes Summary
Composer of the score, used for rendering
A list of QuantizedParts
Returns the ScoreStruct of this score
Title of the score, used for rendering purposes
Methods Summary
check
()Check this QuantizedScore
dump
([tree, indent, stream, numindents])Dump this QuantizedScore to a given stream or to stdout
Group parts which have the same id
Returns the number of measures in this score
Adds empty measures at the end of each part so that all have the same length
Removes any unnecessary dynamics in this score
render
([options, backend])Render this quantized score
resolveChordEnharmonics
([enharmonicOptions])Finds the best enharmonic variant for each chord individually and pins it to it
resolveEnharmonics
(enharmonicOptions)Finds the best spelling for each part in this score, inplace
show
([backend, fmt, external])Convert this QuantizedScore to a
Score
write
(outfile[, options, backend])Export this score as pdf, png, lilypond, MIDI or musicxml
Attributes Documentation
-
composer:
str
¶ Composer of the score, used for rendering
-
parts:
list
[QuantizedPart
]¶ A list of QuantizedParts
- scorestruct¶
Returns the ScoreStruct of this score
-
title:
str
¶ Title of the score, used for rendering purposes
Methods Documentation
- dump(tree=True, indent=' ', stream=None, numindents=0)[source]¶
Dump this QuantizedScore to a given stream or to stdout
- Parameters:
tree – if True, use the tree representation for each measure
indent – the indentation to use
stream – the stream to write to
numindents (
int
) – the starting indentation
- Return type:
None
- groupParts()[source]¶
Group parts which have the same id
At the moment we do not support subgroups
- Return type:
list
[list
[QuantizedPart
]]- Returns:
A list of groups where a group is a list of parts with the same id
- padEmptyMeasures()[source]¶
Adds empty measures at the end of each part so that all have the same length
- Return type:
None
- removeUnnecessaryDynamics()[source]¶
Removes any unnecessary dynamics in this score
- Parameters:
tree – if True, apply the transformation to the tree representation
- render(options=None, backend='')[source]¶
Render this quantized score
- Parameters:
options (
Optional
[RenderOptions
]) – the RenderOptions to usebackend (
str
) – the backend to use. If not given the backend defined in the render options will be used instead
- Return type:
- Returns:
the Renderer
- resolveChordEnharmonics(enharmonicOptions=None)[source]¶
Finds the best enharmonic variant for each chord individually and pins it to it
As an alternative for finding the best global spelling it is possible to just fix each chord individually
- Return type:
None
- resolveEnharmonics(enharmonicOptions)[source]¶
Finds the best spelling for each part in this score, inplace
- Parameters:
enharmonicOptions (
EnharmonicOptions
) – the enharmonic options to use- Return type:
None
- toCoreScore()[source]¶
Convert this QuantizedScore to a
Score
- Return type:
- Returns:
the corresponding maelzel.core.Score
Example
>>> from maelzel.core import * >>> chain = Chain([...
- write(outfile, options=None, backend='')[source]¶
Export this score as pdf, png, lilypond, MIDI or musicxml
When rendering to pdf or png both the lilypond or the musicxml backend can be used.
- Parameters:
outfile (
str
) – the path of the written fileoptions (
Optional
[RenderOptions
]) – render options used to generate the outputbackend – backend used when writing to png / pdf (one of ‘lilypond’, ‘musicxml’)
- Return type:
- Returns:
the Renderer used