Tutorial #3: FM synthesis


FM synthesis is something that seems to be quite confusing for a lot of users. In reality it is quite simple if you know what you are doing and what the synth is doing.

Note: You can find the above tune here.

Basics

In short: FM synthesis adds a vibrato to the sound you are playing - except that it's a very, very fast vibrato. So fast that the frequency the vibrato (this is the modulator) changes the played frequency (carrier) gets in the range your ears perceive as a tone. Note: at this point every tutorial ever written about FM points out that "frequency modulation" is actually often "phase modulation", as is the case also in klystrack. I leave that discussion for someone else.

In klystrack, the main idea is that the modulator and carrier frequencies play at a constant rate compared to each other. E.g. we could have a 2:1 rate, which means the modulator runs one octave higher than the carrier. This is a direct reference to the classic OPL FM synth chip series from Yamaha, used in a lot of arcade machines, the Megadrive, the Adlib sound cards etc.

The shape of the waveforms that the carrier and the modulator use is very important. The classic waveform is of course the sine wave, which creates the very familiar sound and also gives a very nice range of sounds depending on the modulation depth, from soft sine to very rough noise. klystrack has presets for the standard OPL waveforms in the waveform generator and I suggest you to at least start with those.

FM synthesis would sound very boring if it didn't change the modulation depth. In klystrack this is done with an ADSR envelope, and a master modulation depth parameter. This is also very similar to the OPL chips.

Your first FM sound

Let's start by generating the needed waveforms with the wavegen. We will need a sine wave and a half sine (OPL2 #0 and OPL2 #1).

Then we enable FM, disable unwanted flags and set the waveforms in the instrument editor. We will use the sine wave (wave number 00) for both carrier and modulator for this first example.

The next step is to actually make the FM modulator do it's thing - now you only get the pure carrier sine wave tone if you play any note. We will want to raise VOL (this is the modulation depth) and DEC (modulator ADSR decay time) so that we get a nice short time the modulation happens and decays smoothly.

This is your basic, cheesy FM bass instrument. Try playing a few notes and play with the VOL parameter to see how the modulation makes the sound change.

The next step is to experiment with the MUL parameters, this is the ratio of the carrier and the modulator frequencies. How it works is that the numbers are indexes to a table but if both numbers are the same then the ratio of course is 1:1 (this is just basic fraction math). If you raise the first number, the modulation will get relatively slower (because the carrier frequency is higher) and eventually will sound like vibrato if you raise the value enough (and keep the second value low - the ratio is normalized for your convenience). This sounds complex, it is not, but the key thing is to experiment. There are no correct answers.

Let's try making a string instrument. Copy the current instrument to a new instrument (use CTRL+C and CTRL+V).


The main difference will be the attack time. A bass (or drum etc.) instrument has a fast attack time because it is a hit. You should be familiar with this from the normal volume ADSR envelope. Let's raise the attack times longer and make the instrument sustain levels higher too, we want the instrument keep playing until the key is released.

Try playing with the instrument. The sound is not quite like a string should sound like. Try changing the waveform for carrier and modulator to the half sine we generated earlier. You could also play with the MUL parameters.

Add some vibrato and you have a quite nice, cheesy FM string!

What's next?

Experimenting is next. You could try the different waveforms, different combinations of the multipliers and generally just playing around with the numbers. You can always use the two basic instruments above for a start point. There are also a few parameters we didn't cover above.

The FEEDBACK parameter makes the signal feed back in the system, it is perhaps analogous to filter resonance. If large enough, you get noise which will still sound distinctive compared to pure white noise. The E.START parameter (envelope start) will make the envelope start from some other level than zero, making the attack time faster and sharper.

Oh, and you should also listen to some rad Adlib tunes to hear what is possible with relatively simple synthesis!

Files

TutorialFiles.zip 1 kB
30 days ago

Get klystrack

Leave a comment

Log in with your itch.io account to leave a comment.