MidiMessage::getMidiNoteInHertz(): A != 440


MidiMessage::getMidiNoteInHertz() is implemented with a fixed A=440Hz. There are occasions when this is not desirable. For instance, all the orchestras I work with (in Scandinavia) use A=442Hz.

IMHO, it would be very helpful to be able to specify an arbitrary base frequency for A. I don’t know how you would like to implement it, maybe something like:

const double MidiMessage::getMidiNoteInHertz (int noteNumber, float AHz=440.0) throw() { noteNumber -= 12 * 6 + 9; // now 0 = 440 or AHz return AHz * pow (2.0, noteNumber / 12.0); }
More about Concert Pitch from http://en.wikipedia.org/wiki/Concert_pitch:

[quote]The A above middle C is often set at 440 Hz although other frequencies are also used, such as 442 Hz and 443 Hz

In the United States some orchestras use A = 440 Hz, while others, such as New York Philharmonic and the Boston Symphony Orchestra, use A = 442 Hz. Nearly all modern symphony orchestras in Germany and Austria and many in other countries in continental Europe (such as Russia, Sweden and Spain) play with tune to A = 443 Hz. A = 442 Hz is also often used as tuning frequency in Europe, especially in Denmark, France, Hungary, Italy, Norway and Switzerland.[/quote]
– Johan


Yes… I wonder why I never did that! Thanks, I’ll add that right away!


Gosh you’re fast :o

– Johan


Well with simple things like this it’s quicker just do it than to make a note somewhere and come back to it later!