comparison 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
comparison
equal deleted inserted replaced
273:f1f47660483d 274:e412f65884ee
99 float centsOffset = 0.0; 99 float centsOffset = 0.0;
100 int midiPitch = getPitchForFrequency(frequency, &centsOffset, concertA); 100 int midiPitch = getPitchForFrequency(frequency, &centsOffset, concertA);
101 return getPitchLabel(midiPitch, centsOffset, useFlats); 101 return getPitchLabel(midiPitch, centsOffset, useFlats);
102 } 102 }
103 103
104 bool
105 Pitch::isFrequencyInMidiRange(float frequency,
106 float concertA)
107 {
108 float centsOffset = 0.0;
109 int midiPitch = getPitchForFrequency(frequency, &centsOffset, concertA);
110 return (midiPitch >= 0 && midiPitch < 128);
111 }
112