Caution

You're reading an old version of this documentation. If you want up-to-date information, please have a look at 0.10.2.

librosa.fifths_to_note

librosa.fifths_to_note(*, unison, fifths, unicode=True)[source]

Calculate the note name for a given number of perfect fifths from a specified unison.

This function is primarily intended as a utility routine for Functional Just System (FJS) notation conversions.

This function does not assume the “circle of fifths” or equal temperament, so 12 fifths will not generally produce a note of the same pitch class due to the accumulation of accidentals.

Parameters:
unisonstr

The name of the starting (unison) note, e.g., ‘C’ or ‘Bb’. Unicode accidentals are supported.

fifthsinteger

The number of perfect fifths to deviate from unison.

unicodebool

If True (default), use Unicode symbols (♯𝄪♭𝄫)for accidentals.

If False, accidentals will be encoded as low-order ASCII representations:

♯ -> #, 𝄪 -> ##, ♭ -> b, 𝄫 -> bb
Returns:
notestr

The name of the requested note

Examples

>>> librosa.fifths_to_note(unison='C', fifths=6)
'F♯'
>>> librosa.fifths_to_note(unison='G', fifths=-3)
'B♭'
>>> librosa.fifths_to_note(unison='Eb', fifths=11, unicode=False)
'G#'