mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Changed the result of MidiMessage::getMidiNoteInHertz to correctly map midi 69 to 440Hz
This commit is contained in:
parent
896e55ae27
commit
70257e902f
4 changed files with 11 additions and 17 deletions
|
|
@ -951,8 +951,7 @@ String MidiMessage::getMidiNoteName (int note, bool useSharps, bool includeOctav
|
|||
|
||||
const double MidiMessage::getMidiNoteInHertz (int noteNumber, const double frequencyOfA) noexcept
|
||||
{
|
||||
noteNumber -= 12 * 6 + 9; // now 0 = A
|
||||
return frequencyOfA * pow (2.0, noteNumber / 12.0);
|
||||
return frequencyOfA * pow (2.0, (noteNumber - 69) / 12.0);
|
||||
}
|
||||
|
||||
String MidiMessage::getGMInstrumentName (const int n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue