More PCM and MOD stuff

Some of you already know, that David Michael of Magic Engine made a MOD player for the PCE. No intermediate step for converting the format or anything. You just include the MOD file inside HuC. The player converts the samples over in realtime, etc. Not optimal at all for PCE, for practical purposes. But I’m sure this would have lead to something more PCE friendly.

It was after experimenting and hearing many examples of MODs playing on this PCE player, that I decided I wasn’t going to do a MOD player. The sound was just too poor for most music examples. At first, I thought it was because the samples were only 5bit. So I hacked the engine to play on a 10bit DAC setup. I soft mixed the channels (4x8bit =10bit, so no clipping). Didn’t really hear any difference. Just really slight here and there. So I figured it must be the low frequency of the TIMER irq. That was probably over a year ago or more. Still, in the back of my mind. It nagged at me…

Fast forward to last spring. Digging through PCE sound engines. Looking them in depth, but also looking at how they do sample playback. Some do 4bit samples, most do 5bit. Some do funny stuff like pseudo frequency scaling like Batman (and more, looping certain parts of a waveform to shorten it. I.e. compress the repeating parts for final waveform shaping). One thing I noticed. Crappier samples tend to sound better when something else is playing at the same time. It helps hide the noise of the sample from the low bitrate and playback rate. But a few games were interesting. Some samples were really clear when played by themselves. Something I didn’t expect. Obviously these better than expect sounding samples must have been preprocessed to sound better for the output than others. I know there’s a few techniques for preprocessing and I’ll not get into that in this post, but that got me thinking (as of doing all this work lately).

So I fired up some of these old MOD pce roms that I had made from DM’s huc source yesterday. Testing them out in different emulators because of the problems I’ve been having with certain ones not outputting sound correctly – with stuff I’ve been doing lately. At last I came to YAME. I overclocked the CPU to 21mhz on a whim. Now, normally – this shouldn’t have any effect. Because all the timing is straight off the TIMER IRQ and when I was looking at the code original, it looked fine on the scaler side. That is to say, it didn’t appear to have any issues with “jitter”. Well, I was wrong. Playing those files in yame as that higher speed, removed all the jitter (or almost all of it). I was impressed by the sound. It fixed quite a few issues that these MODs were having. I also noticed something else. The MODs played slower than normal. I don’t think this had to do with the timer code, but more with DM trying to compensate that most MODs use a BPM of 125. That number is derived from PAL vblank of 50hz (50hz x 60 seconds = 3000 / 6ticks = 500 / 4 lines = 125 BPM). Later on they changed the spec so you could independently change the BPM, which made calculating the real BPM a pain in the ass (kind of useless even naming it “bpm”).

Anyway, his MOD player naturally should have been playing all these modes faster. Since PCE is 60hz vblank rate. 120% faster. But they aren’t. They play about the speed of 100BPM. Not even the correct speed, but slower. I haven’t yet re-looked at the code (and probably won’t), but this also might account for some sound issues. Either way, yame at 21mhz playing these MOD files… this was inspiring. No, it doesn’t rival the Amiga, but the sound is fairly decent/acceptable for what it is.

So with that, I’ve decided to modify my existing XM player (which just a MOD/XM FX/pattern compatible player) to do a 4 channel MOD/XM for long samples. Not something that I’d probably use for dev, but for demo purposes or novelty. Just for fun.

9 Responses to “More PCM and MOD stuff”

  1. isn’t part of the problem with standard MODs the fact that its 4 channels, that are basically hard panned left and right?

    The PSG is more powerful even without samples in that regard since you get 6 channels, and finer control over panning.

  2. Well, MOD in the general sense – yeah. XM is a direct extension of MOD. But he did a player MOD. And no stereo either. I think he was planning on doing range compression for the samples (to get greater than 5bit depth) at some point, as I was told.

    But yeah, MOD in the strictest since is limited. But there are tons of examples of it sounding awesome even with those limitations. And there’s XM, being an extension of MOD – is more flexible and is directly backwards compatible with MOD. XM supports fine pan (fine than PCE) per channel. Support 128 base instruments with each one having up to 16 sub instruments that are mappable to whatever range you want on the keyboard (nice for doing scaling timbre with octave scale or for setting up straight sample drumkits like you can on real keyboards). More FX, a real volume column. Real volume envelopes, etc.

    4 channels is limiting, but there’s nothing stopping someone from using the other 2 channels for the normal PCE sound modes. Hell, most PCE chip tunes pair channels for two leads or 2 for lead and 2 for rhythm anyway – basically giving you only 4 channels, to get more complex sounds out of it. Some PCE games even limit themselves to just 4 or 5 channels. And the ones that do 6 channels, almost always use one channel as a least important sound output – so FX can be played on it without any real noticeable interruption of music quality. So it’s barely a 6th channel. Unlike say, NES games. So it’s closer to 4 channels VS 5 channels in real world. Before MOD evolved into XM (or just been taking over on the PC side), 6 channel and 8 channel MOD formats still existed. And an FX function existed for fine pan on PC MOD players (for any channel). It was the Amiga hardware versions that were limited to hard panning.

    Anyway, even with the limitation of the original MOD spec (excluding XM, but even excluding PC MOD extended versions), there’s quite a bit that can be done with the original format IMO. For stuff that PCE normal sound generation just can’t compete with. And vice versa, of course.

  3. Eh, it’s david michel not michael, he will be happy to know that you assimilate his name with georges michael’s one, not for the playboy side 😛

  4. Is it Michel and not Michael? Oh well, no harm meant by it. Heh, I always get people miss pronouncing my last name as if it were French (when it’s clearly English). Last name mangling will seemingly never end (written or spoken), unfortunately 😛

  5. Lol, don’t wory tom …

    What’s your last name ??

  6. Leverton. But people here that don’t know me or the name, almost always pronounce it “Le Vert(on)” or “La Vert(on)”, as if it’s two different words. For some odd reason…

  7. Leverton !! this is a true english name, not french ..

  8. yeah, i prefer to treat the entire 6 channel chip as its own thang instead of trying to work MOD style stuff into it.

    MOD/XM stuff played on the PCE sounds like MOD/XM stuff….

    instead of PCE stuff,
    if that makes sense.

    I suppose some of it is just up to the composer though. But it seems like you can get the same sounds as a MOD/XM out of the chip through normal means if you want.

    • “MOD/XM stuff played on the PCE sounds like MOD/XM stuff….”

      Well, there’s only two PCE XM files that *I* know of. And if it sounds anything like the Satellite One port I did in XM for PCE, I’m very happy with that kind of sound. That port I did sounds awesome. And would sound even better with a real tracker for the PCE. Like how Famitracker is to the NES. Some awesome stuff has come out of Famitracker.

      “I suppose some of it is just up to the composer though. But it seems like you can get the same sounds as a MOD/XM out of the chip through normal means if you want.”6

      Normal means? You mean music scripting language? Sure, but some people prefer the tracker interface. I for one, prefer a tracker. Always have since BITD 1992. That’s not to say XM is perfect by any means. It wasn’t meant for PCE and has its short comings. A tracker made from scratch could easily address these though. An XM converter and player just addresses that need mean time, the here and now. And considering nothing has come before this as far as a tracker, XM or Milkytracker does a pretty damn good job. I mean, it was never meant for anything PCE related. It just happens to support PCE style waveforms, FX, exact same period system, etc.

      “yeah, i prefer to treat the entire 6 channel chip as its own thang instead of trying to work MOD style stuff into it. ”

      I don’t know what you mean. You mean any sort of frequency scaling of long samples? Really, that’s not limited to or specific to trackers. Or just long samples in general (static frequency or otherwise)? I dislike almost all noise generated drum stuff on the PCE. Bomberman and a handful of others do a decent job, but nothing beats a real sample kit. But, noise channel sound generation is light on CPU resource – so it has its valid points and strengths in certain circumstances/game designs.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: