I would like to find a way to map frequencies into midi notes. I don’t know the best method to do this, since the frequency domain is continuous and the midi notes domain are discrete (note 1, note 2, note 3, etc…).
So I have the following problems:
How can I get the closest midi note relative to the given frequency.
The second problem is to play that midi note a little shifted from its assigned frequency. Thus I would get the exact pitch which the input frequency is.
In respect to the problem (1), does anyone have a C++ array which I can map frequencies do midi notes? And about (2), Is there a way to send a “noteOn” midi message that we can send a shift-note information together?