From a8210e40b801f5081b890ad96ffbe430ac7840a1 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 4 Jul 2024 17:00:41 -0400 Subject: [PATCH] cwMidi.h : Added midi_to_hz(). --- cwMidi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cwMidi.h b/cwMidi.h index 62f1f9c..73887c4 100644 --- a/cwMidi.h +++ b/cwMidi.h @@ -161,6 +161,10 @@ namespace cw // of this range will be returned as kInvalidMidiPitch. uint8_t sciPitchToMidi( const char* sciPitchStr ); + +#define midi_to_hz( midi_pitch ) (13.75 * std::pow(2,(-9.0/12.0))) * std::pow(2.0,(midi_pitch / 12.0)) + + } }