# HG changeset patch # User Paul Brossier # Date 1388467493 14400 # Node ID b835875739968beb870e7e09132aa361656a8a30 # Parent 9d15e92f2c18d2323364d7fc426887bf0a7bb4d9 plugins/Pitch.cpp: use aubio_miditofreq diff -r 9d15e92f2c18 -r b83587573996 plugins/Pitch.cpp --- a/plugins/Pitch.cpp Tue Dec 31 00:18:26 2013 -0400 +++ b/plugins/Pitch.cpp Tue Dec 31 01:24:53 2013 -0400 @@ -22,20 +22,14 @@ using std::cerr; using std::endl; -static float -getFrequencyForMIDIPitch(int midiPitch) -{ - return 440.f * powf(2.0, (float(midiPitch) - 69.0) / 12.0); -} - Pitch::Pitch(float inputSampleRate) : Plugin(inputSampleRate), m_ibuf(0), m_obuf(0), m_pitchdet(0), m_pitchtype(PitchYinFFT), - m_minfreq(getFrequencyForMIDIPitch(32)), - m_maxfreq(getFrequencyForMIDIPitch(95)), + m_minfreq(aubio_miditofreq(32)), + m_maxfreq(aubio_miditofreq(95)), m_silence(-90), m_wrapRange(false), m_stepSize(0), @@ -156,7 +150,7 @@ desc.name = "Minimum Fundamental Frequency"; desc.minValue = 1; desc.maxValue = m_inputSampleRate/2; - desc.defaultValue = getFrequencyForMIDIPitch(32); + desc.defaultValue = aubio_miditofreq(32); desc.unit = "Hz"; desc.isQuantized = false; list.push_back(desc); @@ -166,7 +160,7 @@ desc.name = "Maximum Fundamental Frequency"; desc.minValue = 1; desc.maxValue = m_inputSampleRate/2; - desc.defaultValue = getFrequencyForMIDIPitch(95); + desc.defaultValue = aubio_miditofreq(95); desc.unit = "Hz"; desc.isQuantized = false; list.push_back(desc);