Mercurial > hg > svcore
diff base/Pitch.cpp @ 274:e412f65884ee
* Fix piano keyboard in spectrum, add pitch labels to frequency displays in
measurement rect (clunkily done) and harmonic cursor in spectrum
author | Chris Cannam |
---|---|
date | Tue, 03 Jul 2007 18:47:39 +0000 |
parents | 4f26f623a8bc |
children | 0a44caddd9fe |
line wrap: on
line diff
--- a/base/Pitch.cpp Tue Jul 03 12:46:18 2007 +0000 +++ b/base/Pitch.cpp Tue Jul 03 18:47:39 2007 +0000 @@ -101,3 +101,12 @@ return getPitchLabel(midiPitch, centsOffset, useFlats); } +bool +Pitch::isFrequencyInMidiRange(float frequency, + float concertA) +{ + float centsOffset = 0.0; + int midiPitch = getPitchForFrequency(frequency, ¢sOffset, concertA); + return (midiPitch >= 0 && midiPitch < 128); +} +