Pitch manipulation.
Bases: ly.lex._token.Token
A Token that denotes a language name.
Bases: object
A pitch with note, alter and octave attributes.
Attributes may be manipulated directly.
Bases: object
Iterate over notes or pitches in a source.
Yields all tokens, but collects Note and Octave tokens.
When a Note is encountered, also reads octave and octave check and then a Pitch is yielded instead of the tokens.
Bases: exceptions.Exception
Exception raised when there is no name for a pitch.
Can occur when translating pitch names, if the target language e.g. does not have quarter-tone names.
Bases: object
Converts string octave to an integer:
“” -> 0 ; ”,” -> -1 ; “’‘’” -> 3 ; etc.
Convert absolute music to relative music.
Convert relative music to absolute music.
Translating the language of pitch names
Inserts a language command in the document.
The command is inserted at the top or just below the version line.
If the LilyPond version specified < (2, 13, 38), the include command is used, otherwise the newer language command.
Changes the language of the pitch names.
May raise ly.pitch.PitchNameNotAvailable if the current pitch language has no quarter tones.
Returns True if there also was a language or include language command that was changed. If not and the cursor specified only a part of the document, you could warn the user that a language or include command should be added to the document. Or you could call insert_language to add a language command to the top of the document.
Transposing music.
Bases: object
Transpose pitches by number of steps within a given scale.
Instantiate with the number of steps (+/-) in the scale to transpose by, and a mode index. The mode index is the index of the major scale in the circle of fifths (C Major = 0).
Bases: ly.pitch.transpose.Transposer
Shift pitches to optional mode/scale.
The scale should be formatted in analogy to the scale in the Transposer parent class.
The key should be an instance of ly.pitch.Pitch.
Bases: object
Transpose pitches.
Instantiate with a from- and to-Pitch, and optionally a scale. The scale 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.