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.interval_frequencies
- librosa.interval_frequencies(n_bins, *, fmin, intervals, bins_per_octave=12, tuning=0.0, sort=True)[source]
Construct a set of frequencies from an interval set
- Parameters:
- n_binsint
The number of frequencies to generate
- fminfloat > 0
The minimum frequency
- intervalsstr or array of floats in [1, 2)
If str, must be one of the following: - ‘equal’ - equal temperament - ‘pythagorean’ - Pythagorean intervals - ‘ji3’ - 3-limit just intonation - ‘ji5’ - 5-limit just intonation - ‘ji7’ - 7-limit just intonation
Otherwise, an array of intervals in the range [1, 2) can be provided.
- bins_per_octaveint > 0
If intervals is a string specification, how many bins to generate per octave. If intervals is an array, then this parameter is ignored.
- tuningfloat
Deviation from A440 tuning in fractional bins. This is only used when intervals == ‘equal’
- sortbool
Sort the intervals in ascending order.
- Returns:
- frequenciesarray of float
The frequencies
Examples
Generate two octaves of Pythagorean intervals starting at 55Hz
>>> librosa.interval_frequencies(24, fmin=55, intervals="pythagorean", bins_per_octave=12) array([ 55. , 58.733, 61.875, 66.075, 69.609, 74.334, 78.311, 82.5 , 88.099, 92.812, 99.112, 104.414, 110. , 117.466, 123.75 , 132.149, 139.219, 148.668, 156.621, 165. , 176.199, 185.625, 198.224, 208.828])
Generate two octaves of 5-limit intervals starting at 55Hz
>>> librosa.interval_frequencies(24, fmin=55, intervals="ji5", bins_per_octave=12) array([ 55. , 58.667, 61.875, 66. , 68.75 , 73.333, 77.344, 82.5 , 88. , 91.667, 99. , 103.125, 110. , 117.333, 123.75 , 132. , 137.5 , 146.667, 154.687, 165. , 176. , 183.333, 198. , 206.25 ])
Generate three octaves using only three intervals
>>> intervals = [1, 4/3, 3/2] >>> librosa.interval_frequencies(9, fmin=55, intervals=intervals) array([ 55. , 73.333, 82.5 , 110. , 146.667, 165. , 220. , 293.333, 330. ])