Page 1 of 1
PCM -> FM worth trying?
Posted: Tue Apr 27, 2010 4:06 pm
by koilazka
Hi again :/
I havnt tryed any sound programming yet on the mega drive, mabey someone knows if this is worth trying.
This all depends on how fast an FM channel can switch frequency (with a game runing).
And the ammount of data and sound quality for if its worth trying or not.
A 4Hz switch rate would sound like neo on the matrix after taking that pill (i think).
Would be usefull to know how much data one FM switch would take up in memory.
A convertor program would be easy enough to write PCM.wav -> MDFM, but is it worth trying?
Posted: Tue Apr 27, 2010 4:28 pm
by Shiru
I can't get what you trying to achieve by changing FM channel frequency. If you meant volume instead of frequency, then it was discussed here already, and probably it would be worse than using DAC mode (which is there for a reason, isn't?).
Posted: Wed Apr 28, 2010 7:59 am
by koilazka
Me elaborate, correct me if im wrong.
The megadrive has two different ways to generate sound.
One is the FM tone generators. The other is PCM.
To generate tone with PCM, you draw a waveform with points, max usually 48Khz (48,000 points per second)
With the FM tone generators, you select frequency + waveform (with the operators), and it generates the tone.
PCM -> FM convertor would translate segments of a wav file, into a string frequency numbers.
Posted: Wed Apr 28, 2010 8:11 am
by TmEE co.(TM)
this would not work out since you can play only one freq on each channel, giving you 6 different freqs possible, though you have lot of possible waveforms but it will still not be viable. One coulsd use a special mode on Channel3 but 9 different freqs won't be enough.
Posted: Wed Apr 28, 2010 8:14 am
by Shiru
In real audio, there is no one certain frequency at one point, there is a large number of frequencies with different amplitudes. So with your method you can't get real audio, just some weird sound effect.
Posted: Wed Apr 28, 2010 10:59 am
by koilazka
Me try again :/
So say this is a PCM.wav file, the pixels represent each pulse.
Say you make the convertor program split the PCM.wav into 50 frequencies per second.
So, every 20 miliseconds on the mega drive, one FM channel would change its frequency.
sound start: 640Hz
200ms later: 500Hz
400ms later: 320Hz
600ms later: 300Hz
800ms later: 300Hz
If you split the PCM into 5 frequencies per second, it would sound very jumpy, only changing the frequency of one FM channel 5 times a second.
Posted: Wed Apr 28, 2010 11:09 am
by Shiru
This will not work. In 20ms there is no just one dominant frequency in actual audio recording, it is
very complex waveform. If something so simple could worked, you'd see it everythere. Unfortunately, you could only get weird sounding effects this way, nothing resembling the original audio.
This is how 20ms of the actual audio looks like:

Posted: Wed Apr 28, 2010 11:41 am
by koilazka
The convertor would convert the PCM.wav into one dominant frequency.
You would write a frequency decoder in the convertor, it would use the peeks of the waveform to determine the frequency.
14 Hz reads in 20 ms, divide the reads by 20 = the average frequency.
On the mega drive it would convert the waveform into one frequency number.
Every 20 miliseconds, the frequency would change.
This is why im asking, how fast can you change the frequency of one FM channel.
If you change the frequency every 5 miliseonds or quicker if possible, speech may not sound like a dying robot.
Posted: Wed Apr 28, 2010 11:48 am
by Shiru
In emulator you can change the frequency at any rate. So do the test and see the result by yourself, if you don't want to hear that others say.
Regarding voice, you should read about
vocoders and
LPC.
Posted: Wed Apr 28, 2010 12:25 pm
by koilazka
I was just trying to explain what i was blabbering about, if we can change frequency at any rate thats awesome, dying robots ftw :(
ill read the wiki topics.