construct_notename
- pitchtools.construct_notename(octave, letter, alter, cents, freqdev=0, normalize=False)[source]
Utility function to construct a valid notename
- Parameters:
octave (int) – the octave of the notename (4 = central octave)
letter (str) – the pitch letter, one of “a”, “b”, “c”, … (case is not important)
alter (int | str) – 1 for sharp, -1 for flat, 0 for natural. An alteration as str is also possible. alter should not be microtonal, any microtonal deviation must be set via the cents param)
cents (int) – cents deviation from chromatic pitch
normalize – if True, normalize/check the resulting notename (see
normalize_notename()
)freqdev (int) – frequency deviation from the given pitch (in Hz)
- Return type:
str
- Returns:
the notename
octave
letter
alter
cents
notename
4
a
-1
-25
4Ab-25
6
d
#
+40
6D#+40
5
e
0
-50
5E-
See also