def test_octs_to_hz(tuning, bins_per_octave): freq = np.asarray([55, 110, 220, 440]) * (2.0**(tuning / bins_per_octave)) freq_out = librosa.octs_to_hz([1, 2, 3, 4], tuning=tuning, bins_per_octave=bins_per_octave) assert np.allclose(freq, freq_out)
def test_octs_to_hz_dep(a440): with warnings.catch_warnings(record=True) as out: freq = np.asarray([55, 110, 220, 440]) * (float(a440) / 440.0) freq_out = librosa.octs_to_hz([1, 2, 3, 4], A440=a440) assert np.allclose(freq, freq_out) # And that it says the right thing (roughly) assert 'deprecated' in str(out[0].message).lower()
def __test(a440): freq = np.asarray([55, 110, 220, 440]) * (float(a440) / 440.0) freq_out = librosa.octs_to_hz([1, 2, 3, 4], A440=a440) assert np.allclose(freq, freq_out)