Caution

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

librosa.tuning_to_A4

librosa.tuning_to_A4(tuning, bins_per_octave=12)[source]

Convert a tuning deviation (from 0) in fractions of a bin per octave (e.g., tuning=-0.1) to a reference pitch frequency relative to A440.

This is useful if you are working in a non-A440 tuning system to determine the reference pitch frequency given a tuning offset and assuming equal temperament. By default, 12 bins per octave are used.

This method is the inverse of A4_to_tuning.

Parameters:
tuningfloat or np.ndarray [shape=(n,), dtype=float]

Tuning deviation from A440 in fractional bins per octave.

bins_per_octaveint > 0

Number of bins per octave.

Returns:
A4float or np.ndarray [shape=(n,), dtype=float]

Reference frequency corresponding to A4.

See also

A4_to_tuning

Examples

The base case of this method in which a tuning deviation of 0 gets us to our A440 reference pitch.

>>> librosa.tuning_to_A4(0.0)
440.

Convert a nonzero tuning offset to its reference pitch frequency.

>>> librosa.tuning_to_A4(-0.318)
431.992

Convert 3 tuning deviations at once to respective reference pitch frequencies, using 36 bins per octave.

>>> librosa.tuning_to_A4([0.1, 0.2, -0.1], bins_per_octave=36)
array([   440.848,    441.698   439.154])