Is there any equation of converting PCM to FM?

You can talk about almost anything that you want to on this board.

Moderator: Moderators

User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re:

Post by Bregalad »

ccovell wrote: Also, check out YouTube videos about combining harmonics from sine waves to make square waves (not needed on Genesis 'cause you have a PSG there too)
It's needed if you want to reach the lower notes and/or have more than 3 channels and/or have a non-50% square wave.
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Is there any equation of converting PCM to FM?

Post by TmEE »

There's no need to combine harmonics in brute force way, you only get 4 anyway then. One op modulating another with right freq ratios is able to give saw and square easily and can even simulate lowpass filters when modulation strength is adjusted, from sharp to dull to just a sine.

I have had lot of success by looking at spectrograms of sounds I want to create to see and then recreate the main harmonics via combining raw sines and modulation. Once tonality is correct you can add the dynamics via ADSR, and you can go step above by adjusting the parameters as time goes on rather than doing the regular static approach.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Is there any equation of converting PCM to FM?

Post by tepples »

My problem in TFM Music Maker, a tracker for OPN FM chips, is how to go from the spectrogram to the best algorithm and modulation settings. Is it something that just comes with practice, or is there something that new FM sound designers are expected to read in order to make key insights?
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Is there any equation of converting PCM to FM?

Post by lidnariq »

All I know is that the fourier transform of a "classic" (sinusoid carrier and modulator) FM synthesis sound is a Bessel function of the first kind. Using a non-sinusoid carrier changes this in a more complex way; using a non-sinusoid modulator is "just" a convolution of the result.)

Eventually after playing around with it enough I eventually got some intuition for how to get the sound I wanted, but I never found it easy. At some point I just started using pre-built patch sets (debian package "alsa-tools" ; /usr/share/sounds/opl3 ) and adjusting them.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Is there any equation of converting PCM to FM?

Post by rainwarrior »

tepples wrote:My problem in TFM Music Maker, a tracker for OPN FM chips, is how to go from the spectrogram to the best algorithm and modulation settings. Is it something that just comes with practice, or is there something that new FM sound designers are expected to read in order to make key insights?
I don't know of any textbook that teaches how to make good FM instrument patches. Finding a well balanced tone is usually very sensitive to small changes, a brief peak of serenity in a sea of BLAARRP. Hard to generalize.

Find patches that you think are good, and modify them. Turn off each operator in turn and see how it contributes. Turn the modulator strength up and down for each to see what they are doing.

In 2-op you are pretty limited, but in 4-op the extra operators tend to contribute a lot to the envelope/dynamic changes of tone, e.g. you can have an operator that's mainly for the attack, one for the main body of the tone, another for a slow change across the decay, etc. Beyond the first 2, more operators will usually be used in an approximately "additive" way even though it's technically more complicated than that.

As far as trying to synthesize the tones of other instruments, I don't think FM is well suited to this endeavour. I think FM can produce a good substitute for any given musical sound, but that's very different than a good imitation of that sound. Trying to imitate might give you some ideas to experiment with, and you could find some good sounds in the process of trying, but you'll almost never be able to duplicate anything closely with it.

If you can, use some tools to extract patches from FM music with good patches (e.g. anything by Ryu Umemoto) and take a good look at them!
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Is there any equation of converting PCM to FM?

Post by TmEE »

rainwarrior wrote:I don't know of any textbook that teaches how to make good FM instrument patches. Finding a well balanced tone is usually very sensitive to small changes, a brief peak of serenity in a sea of BLAARRP. Hard to generalize.
That's why you start making the right tone without dynamics, ADSR set to max attack and infinite sustain. Then dynamics part is out the equation and you can entirely focus on the serenity part or the BLAARRP and anything inbetween. If modulation grows too high you're gonna get those harsh sounds, so you scale back modulation factor accordingly so that such state isn't reached. TL parameter is the peak level the operator can reach.

If you see regularly placed harmonics then you use one op modulating the other to create them, if you see regularly placed harmonics in the sequence you add one more op to the mix for that, if things are offset and not following exact same sequence but are still in a sequence you need another frequency ratio for them. If there's some random non repeating harmonics you're very much forced to waste an operator on those, non modulated ops that is.
You'll want to make the computer record its output and see a spectrogram taken realtime how the modulation changes harmonic structure. The rules between TL, MUL and other parameters are very straightforward, you just got to ignore that dynamics exist first.

Once tonality is set you can then work on dynamics. Start with output ops, and then touch the modulators. Changing ADSR parameters of the modulators will affect tonal qualities, the lower the modulation factor gets (operator level) the more smoother (sine like) the sound gets, which mimics how the higher energy harmonics fade away first when a note is decaying. Parameters like Key Scale will speed up the envelope has notes go higher, something that real instruments experience also, high keys on piano will never have a long sustain no matter how hard you hit them. There's also an LFO and detune parameters which can be used to create beat frequencies or other things to make a sound more dynamic, unfortunately speed of LFO is global.
And you'll want to keep your eyes on a spectrogram.

I do think using FM to recreate classic instruments is wasting away the potential, you can do so much more, things that don't exist yet. Having said that, one 4op FM channel can do very much 1:1 or nearly that approximation of *a string* of any classic instrument, but you only have 6 or 8 channels on the popular chips so things like pianos are gonna be very ineffective because their characteristic sound comes from the fact that most notes have 2 or 3 strings used, and their tuning isn't exact, using half or 1/3rd of the chip for one note is not great for making a full composition however... You can do a very nice acoustic guitar though, but a lot of effort will have to go into adding the human playback imperfections such as finger sliding and fret noises.
Post Reply