This function transposes the pitch of notes in a valid character string. The string must be of the form passed to the info
argument to phrase
.
Transposing is not done on a phrase object. The notes in a phrase object have already been transformed to LilyPond syntax and mixed with other potentially complex and variable information.
Transposing is intended to be done on a string of notes prior to passing it to phrase
. It will work on strings that use either integer or tick mark octave numbering formats.
The transposed result will be a string with integer octave numbering.
If key
is provided, this helps ensure proper use of sharps vs. flats. Alternatively, you can simply provide key = "sharp"
or key = "flat"
. The exact key signature is not required, just more clear and informative for the user.
If not provided (key = NA
), transposition lacks full information and simply defaults to sharping any resulting accidentals for positive n
and flattening for negative n
.
n = 0
returns the input without any modification.
The only element other pitch that occurs in a valid notes string is a rest, "r"
or "s"
(silent rest). Rests are ignored by transpose.
The default style
is to use tick style if no integers occur in notes
. The "tick"
and "integer"
options force the respective styles. When integer style is returned, all 3
s are dropped since the third octave is the implicit center in LilyPond. style = "strip"
removes any explicit octave information.