exponential Fm

theophile gagnard's icon

Hello everyone,

I'm sure this is a very dumb question, but how is it possible to code an exponential FM patch on max MSP (or gen)

thank you in advance and have a nice day!

Dimitri Aatos's icon

The simplest way I can think of is to treat the signal of the modulator as MIDI pitch and convert it to Hz.

Graham Wakefield's icon

The "exponential" or "linear" feature of FM is just about how the input modulation wave is mapped to modulation frequency. Basically, there's some exponential operator between your modulator's output and your carrier's frequency input. [mtof] is an example of an exponential operator.

Exponential FM will map an input range to a pitch range, which is an exponential curve of frequency. For example, one unit of modulation could map to one octave of frequency offset (or in the case of mtof, every 12 units of modulation map to one octave). One outcome is that, no matter how low or even negative the input is, the output frequency will only get closer and closer to zero, and will never be negative. This inherent positive bias is why it seems to 'detune' the perceived output, especially as modulation depth increases.

Linear FM maps modulation to frequency, which means it can swing both positive and negative. When the carrier frequency is low enough, this means the effective output frequency can be negative too. This is "through-zero FM" or TZFM, which doesn't detune the result (so long as your waveforms are balanced at least).

Note that the same linear/exponential distinctions also apply to phase modulation (PM). FM and PM are very similiar. The difference is that in PM, modulations are added to the phase output of a phase accumulator before being fed to the sine shaper, whereas in FM, the modulations are added to the frequency updating the accumulator itself. With sine waves, FM and PM sound almost the same, but with different waveforms the difference can be more significant. In very wishy-washy terms, PM responds more to the differential or slope of the modulator, FM responds more to the integral of the modulator.

theophile gagnard's icon

Thank you very much Dimitri and Graham for your answer, I get it!
I wanted to make "through-zero" and phase distortion too and your explication is very welcome, thank you.