[LAD] Quantise MIDI note/frequency to musical scale: algorithm?

Yuri yuri at rawbw.com
Thu Dec 30 23:49:45 CET 2021


On 12/30/21 14:38, Jeanette C. wrote:
>
> thanks for your quick reply. -- Yes, simple mapping of one MIDI note 
> to a frequency is easy, and the environment in which I work offers 
> built-in converters for that.
>
> But, how to best quantise chromatic notes to a given musical scale 
> like C minor or B Dorian? I would probably need some method to do it 
> for both MIDI notes and in frequencies. 


Chromatic representation has several harmonics. The lowest harmonic 
defines a basic note, higher harmonics (2X, 3X, etc) depend on what 
instrument is playing, and by themselves don't define notes.

Mapping is strictly logarithmical, i.e. log(F) would have notes equally 
distributed. One note and other note begins in the middle of such 
interval. The rest is simple math.


Yuri


More information about the Linux-audio-dev mailing list