Page 1 of 2

Five extra PCM channels on the Genesis (YM2612)

Posted: Fri Nov 10, 2017 10:01 am
by za909
I've always wanted to know if it was possible to use the 5 FM-only channels of the YM2612 chip to output PCM. For most chips this works by setting the channel in question to the highest possible frequency, and then the attenuation/volume register can serve as the output for the data. I wonder if this is also possible in this case. Additionally, it might work by taking a completely different approach - retriggering the channel constantly (which resets the phase of the operators) and setting the amplitude you want by using the frequency of the channel to get the exact phase of the sine - then repeat. Also, if this is implemented in the chip with a digital phase counter, it should work perfectly, people have done the same with the SID chip before.

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Fri Nov 10, 2017 10:02 am
by tepples
With the time it takes to write to all six FM channels' registers, why can't you just sum six PCM channels on the Z80?

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Fri Nov 10, 2017 10:19 am
by TmEE
It is faster to software mix those 5 channels.

In addition, restarting a channel/operator will start the waveform at zero, it'll take a while to get the waveform to max point. You could stop phase generator though.

Other problem is that you can pretty much do only one write per chip sample, that's nowhere enough to do anything fancy on all 5/6 channels, unless really low sample rate is acceptable, but at that point just plain old software mixing will still be faster, and will sound better as 7bit log space isn't super great for playing samples, and you still won't get more than 9bit output on stock hardware. You can control the lowest bit of PCM channel wia test register and get all 9bits BTW.

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Fri Nov 10, 2017 12:28 pm
by tokumaru
tepples wrote:With the time it takes to write to all six FM channels' registers, why can't you just sum six PCM channels on the Z80?
https://youtu.be/x3m3JrVImmU

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sat Nov 11, 2017 12:15 pm
by psycopathicteen
Hmm, he does audio sampling the same way he does texture scaling.

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sat Nov 11, 2017 1:07 pm
by rainwarrior
They are similar interpolation problems.

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sat Nov 11, 2017 3:45 pm
by Drew Sebastino
To be honest, the results are kind of underwhelming considering the amount of work and likely processing time. :| (Although I think the bad instrument choice is half of the problem.) Is software mixing is the main bottleneck here?

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sat Nov 11, 2017 4:53 pm
by psycopathicteen
Is this only during cutscenes?

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sat Nov 11, 2017 7:29 pm
by Myask
tokumaru wrote:
tepples wrote:With the time it takes to write to all six FM channels' registers, why can't you just sum six PCM channels on the Z80?
https://youtu.be/x3m3JrVImmU
For those who don't want to watch:
use tables to decide what parts of sample waveforms to discard when pitch-shifting
use tables for volume-scaling
software-mix on 68000 your four channels to one with halve(bitshift)+add
use a scanline? interrupt at 1 khz(15-20/fr, 50FPS) and upload 10B per interrupt so as to have tiny losses where the Z80's not playing sound
double-buffer samples in Z80 RAM so you don't have to stop playback even that much

Did I miss anything?

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sat Nov 11, 2017 9:57 pm
by adam_smasher
Espozo wrote:To be honest, the results are kind of underwhelming considering the amount of work and likely processing time.
Ahh, Traveller's Tales games in a nutshell :P

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sun Nov 12, 2017 12:09 am
by Drew Sebastino
adam_smasher wrote:Ahh, Traveller's Tales games in a nutshell :P
The FMV intro to Sonic 3D Blast is probably the best part of the game, despite looking like shit. :lol: I've never played Mickey Mania or Pugsy, but judging from Sonic 3D Blast (bad) and Toy Story (decent, but not amazing) I think the people at Traveller's Tales were much better programmers than they were game designers; it's a bit of a shame that they didn't make PC games instead, where they'd be much less limited by space and processing power. I feel most European game developers from the early to mid nineties were the same way; the Japanese seemed to be better game designers, even if the games were less ambitious graphically and still ran worse. American developers (id and a few others nonwithstanding) were the worst in both regards. :lol:

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sun Nov 12, 2017 3:36 am
by psycopathicteen
It's a bit of a shame that they didn't make PC games instead, where they'd be much less limited by space and processing power.
The challenge.

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sun Nov 12, 2017 3:51 am
by Sumez
Yeah, this is a typical staple of European developers in the 90s (and late 80s), and Traveller's Tales is a great poster child for that. I used to think only Japanese games (at least in the platformer genre and such) were good, while Western games almost always had the same flaws (pretty graphics, but extremely uninteresting and repetitive level design), but looking back at it now, I think that especially describes European developers, maybe even British specifically - usually coming off the C64 and Amiga demo scenes, where making cool effecient coding algorithms and special visual effects was more important than fun gameplay.

I remember, back in the days, I'd always remember the Traveller's Tales logo due to how much their games managed to stand out after all, plus they had a thing for working with those licenses that would make kids buy their games no matter how good they were.
However, I would also quickly begin to notice that pretty much ALL the games with the TT logo were also pretty bad. Not terrible, but never good at all. I think Mickey Mania was the only decent game they managed to make (and then, only the Sega version), and looking at Jon Burton's YouTube videos today, that's kinda sad, because you can tell he's really passionate about their products... in his own way anyway. That video about how they bypassed Sega's QA process by disguising bugs in their games as "secret level selects" is pretty shady, but at least he's being honest about it. :)

He's also working on a director's cut version of Sonic 3D at the moment, hoping to fix everything that was wrong about that game. I'm not sure that game is fixable, but it's a game I've always wanted to like, so I'm curious about it.

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sun Nov 12, 2017 4:31 am
by psycopathicteen
Western games almost always had the same flaws (pretty graphics, but extremely uninteresting and repetitive level design).
When did western games ever have good graphics?

Re: Five extra PCM channels on the Genesis (YM2612)

Posted: Sun Nov 12, 2017 4:49 am
by Sumez
Image

Image

Image

Image

Image

Image