The transpose module¶
Transpose pitches.
-
class
AbstractTransposer[source]¶ Bases:
objectBase class for a Transposer.
-
octave= 0¶ a Transposer at least has an
octaveattribute, specifying how many octaves a pitch will be transposed.
-
-
class
Transposer(from_pitch, to_pitch, scale=None)[source]¶ Bases:
quickly.transpose.AbstractTransposerTranspose pitches.
Instantiate with a from- and to-Pitch. The
scaleattribute is a list with the pitch height of the unaltered step (0 .. 6). The default scale is the normal scale: C, D, E, F, G, A, B.Adding a Transposer to a Transposer creates a new Transposer, adding up both transpositions. Subtracting a Transposer from a Transposer creates a new one, reverting the last transposition.
-
class
Transpose(transposer, processor=None, relative_first_pitch_absolute=None)[source]¶ Bases:
quickly.dom.edit.EditTranspose pitches using the specified transposer. Arguments:
transposer: aTransposerinstance that does the actual work.processor: aPitchProcessor; a default one is used if none is specified.relative_first_pitch_absolute: if True, the first pitch in a\relativeexpression is considered to be absolute, when a startpitch is not given. This is LilyPond >= 2.18 behaviour. If False, the first pitch in a\relativeexpression is considered to be relative to c’, if no startpitch is given. This is LilyPond < 2.18 behaviour. If not specified, the function looks at the LilyPond version from the document. If the version can’t be determined, defaults to False, the old behaviour.You may change these attributes after instantiation.
-
transposer= None¶ The
Transposerthat can transpose pitches.
-
processor= None¶ The
PitchProcessor; a default one is used if None is specified.
-
relative_first_pitch_absolute= None¶ Whether to consider the first pitch in a
\relativeexpression absolute (by default dependent on LilyPond version)
-