# pitch

## Converting MIDI pitch to frequency

This patch shows three different ways to convert MIDI pitch value to frequency.

## Linear frequency vs. linear pitch

As expressed in Fechner's law, our subjective sensation of a phenomenon is often proportional to the logarithm of the empirical measurements of the intensity of the physical event that evokes that sensation. One example of that in musical contexts is that our sensation of changes in musical pitch are proportional to the logarithm of the change in the measured fundamental frequency of a tone.

## Linear and exponential

This patch demonstrates the sound of linear and exponential changes in pitch and amplitude.

## Pitch and loudness formulae

This patch doesn't do anything musical, but it shows the math formulae that underlie the mtofftomatodb, and dbtoa objects.

## Conversion between pitch and frequency

The objects mtof and ftom provide easy conversion between MIDI pitch numbers and their equivalent equal-tempered frequency values.

## Try the invertpitch abstraction

This is an example patch you can use to try out the invertpitch patch shown in "Invert the pitches of MIDI notes". Of course, you will first have to download the patch from that example and save it with the name "invertpitch.maxpat".

## Random pitch variation of an oscillator

If you want to make an oscillator with unstable pitch, you can modulate the pitch of the oscillator using a noise signal as an exponent with a base of 2, and applying that as a multiplier to vary the fundamental frequency. In that way, when the noise ranges from -1 to +1, it will cause a pitch variation of ±1 octave, whatever the fundamental frequency of the oscillator. Divide the amplitude of the noise by 1200 if you want to be able to represent pitch variation in cents.