Is there any equation of converting PCM to FM?

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

Moderator: Moderators

psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Is there any equation of converting PCM to FM?

Post by psycopathicteen »

Such as an equation that can take a PCE-style PCM samples to Genesis-like FM?
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

I believe there's a way to convert pulse waves to FM instead, but PCM?. No, I have no clue how. :(
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

PCM can have an arbitrary waveform. FM is only capable to make rather simple waveforms (comparable to arbitrary), in case with Genesis all made from sine waves. So no, you can't convert arbitrary sound to FM.
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Post by ccovell »

If you can make sawtooth waves in FM, you're already halfway there. Most PCE sample sets are somewhat limited. Check out the PCE demo "Ultimate HuC Sample Player" to get a graphical view of some of the most common sample definitions used in PCE games.

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), sawtooth waves, and others.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

See the previous FM vs. PCM topic. In this post, TmEE claimed to be able to create an FM patch that has "1:1 waveforms to my bass guitar".
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

The YM2612 allows for CH 6 to be used as an 8-bit DAC (but the YM2612's timer foolishly can't be used on the Genesis so it'll require timed code).
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Post by TmEE »

tepples wrote:See the previous FM vs. PCM topic. In this post, TmEE claimed to be able to create an FM patch that has "1:1 waveforms to my bass guitar".
Bass guitar has a quite simple waveform so its not so difficult to recreate it. Many natural instruments can be very accurately recreated. I would say one FM channel can recreate one string of some musical instrument. Since you only got like 6 or 8 channels (some chips got more) you cannot do very convincing sounds of instruments usually played in groups like orchestras. Good percussion is not so easy to make aswell, there's lot of sounds you can make but even more you cannot...

Sawtooth is very easy to make in FM, and you only need 2 operators to do it leaving 2 free for other sound such as square waves or beefing up the sawtooth to get fatter sound.

FM is excellent for bass, pads and brass and certain types of string instruments like acoustic guitars.
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

Wait, so I'm changing the question a bit. Is there a function to generate FM samples from square waves?
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Post by TmEE »

there are no FM "samples"
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

TmEE wrote:there are no FM "samples"
So there's no sound "sample rate".
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Post by lidnariq »

All the FM synthesizers made by Yamaha have a sample rate, because they are digital devices. (In the PC, the adlib soundcard produced sound at 49kHz). You could even argue there are two samples in every OPLx card: a logsin table and an exponent table. (see also this decap project). But the ways in which the device can use those two samples are very proscribed and should be thought of in the analog domain anyway.

PCM sound can be hacked out on an FM synth, and I remember Inertia Player for DOS supported it. But sound quality was awful, only better than Inertia's "use the PC speaker for sound" mode.
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

Pardon me, but I didn't get. Isn't the waveform (file) composed by samples, 4 bytes for 16-bit stereo output? I didn't get that "there are no FM samples", unless he misunderstood me. I'm not saying about "sound samples" used by an ad-lib board, for example, like guitar, sax or any other.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

A sound sample is something that is sampled, recorded from an audio source. FM does not have samples, because it is not a recording, it is a set of parameters. So it is called an instrument, or a patch.

Playing PCM through an FM synth is nothing special, and it does not involve converting samples into FM parameters. It just abuses the synth's DAC one way or another.
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 568
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Post by Jarhmander »

Maybe it is worth considering re-reading your original question:
Zepper wrote:Wait, so I'm changing the question a bit. Is there a function to generate FM samples from square waves?
One way I can reinterpret it is : "Is there a way to use square waves as operators (either carrier or modulator) ?"
Yes, the OPL3 can use square waves as operators.

Here I assume that Zeeper understand the inner working of FM-based sound, that is, sound is produced via phase modulation synthesis (while modulating the phase affect frequency and hence, it's also frequency modultion, the way these chips produce sound is trully by phase modulation).

If we didn't help with these answers, Zeeper, could you clarify your question?
ap9
Posts: 43
Joined: Sat Jun 01, 2013 11:55 am
Location: Maine, U.S.A.
Contact:

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

Post by ap9 »

It is possible to develop a program to produce an FM patch from a short PCM sequence. The result would be an approximation — a simpler waveform from a sound.

Any further detail would require, in theory, wave sampling — a driver (using the CPU) to render a sequence of FM waves to come closer to the original sound. But because you don't get a lot of precision for the parameters — particularly modulation and amplitude, it would probably require more than one mixed channel and the results would still be rough and vary.
Post Reply