PDA

View Full Version : 32X PWM sound



Joe Redifer
10-07-2007, 03:28 AM
Owners of the model 1 Genesis & Sega CD have always been able to simply lower the volume slider on the Genesis to isolate any sounds that the Sega CD is making. This is very entertaining for the curious, like me. But you can't do that with the 32X to see what sounds the extra hardware is providing to the extreme gaming experience that accompanies each and every 32X game. Well I've recorded a few examples for you using the space-age "MP3" format from the future. The Genesis audio has been stripped away, and only the 32X's PWM sound remains.

All audio recorded from real hardware:

After Burner (http://www.joeredifer.com/32X_PWM/afterburner.mp3) - 1.2MB
After Burner is perhaps the most impressive use of the 32X's sound capabilities EVAR! It makes nearly every sound heard except for some bass in the music and **maybe** some other backing instrument.

Space Harrier (http://www.joeredifer.com/32X_PWM/spaceharrier.mp3) - 463KB
The Genesis does most of the main melody in Space Harrier while the 32X does part of the music and nearly all of the sound effects. This is actually pretty impressive for the Genesis sound chip since the game sounds exactly like the arcade in every way. Hope you like drum 'n bass!

Virtua Fighter (http://www.joeredifer.com/32X_PWM/virtuafighter.mp3) - 816KB
The 32X does about what you'd expect it to do in this game, but for some reason the PWM chip buzzes a little (that's not my audio connection). Sometimes it turns the buzz off.

Knuckles' Chaotix (http://www.joeredifer.com/32X_PWM/chaotix.mp3) - 452KB
Yup, just the drums. The 32X also does just the sprites on the graphics side. The Genesis does far more with this game than the 32X does.

Blackthorne (http://www.joeredifer.com/32X_PWM/blackthorne.mp3) - 492 KB
The 32X seems to do almost every sound heard in this game.

Kolibri (http://www.joeredifer.com/32X_PWM/kolibri.mp3) - 332 KB
Part of the music and most of the sound effects are handled by the 32X.

Doom (http://www.joeredifer.com/32X_PWM/doom.mp3) - 152 KB
Yeah. Not much going on here.

It is interesting to note that the Genesis does all of the sounds (including the voices) in 36 Great Holes and Shadow Squadron. The 32X does only 1 sound in Virtua Racing, and that's during the Sega logo. All of the music and voices are 100% Genesis.

Iron Lizard
10-07-2007, 04:42 AM
Thanks Joe. I have always been curious about what the 32x could actually do.

evildragon
10-07-2007, 12:30 PM
Ahh, so you finally got B1 and B3? ;)

Zebbe
10-07-2007, 01:13 PM
Owners of the model 1 Genesis & Sega CD have always been able to simply lower the volume slider on the Genesis to isolate any sounds that the Sega CD is making.

Genesis you mean. Or maybe you don't?

It was very interesting to listen to this. I've always thought the Mega Drive to be good enough to handle the Space Harrier sound, it seems I was almost right. I don't think it does much of the Sarah theme from Virtua Fighter though. Could you check it out?

Joe Redifer
10-07-2007, 06:57 PM
Ahh, so you finally got B1 and B3? ;)
Yeah, I've been too lazy to take my Genesis apart and tape wires to the bottom until last night. I made my recording and now it's all been removed. By the way B1 is left and B3 is right.


I don't think it does much of the Sarah theme from Virtua Fighter though. Could you check it out?
Most of the other stages the 32X only does the drums, voices and sound effects. In her stage it is likely just the drums.

Aarzak
10-07-2007, 11:42 PM
Wow, thanks a lot Joe. I too agree that "After Burner" makes the aural use of the 32X hardware as I've mentioned before. The stereo music and sound just SCREAM through my headphones. I don't mind the slowdown present in it and "Space Harrier" either, though AF32X is the only game that my PC can't run at full-speed on Kega Fusion. That includes all other Genesis/32X/Sega CD games, so I wouldn't know how AF32X looks at full speed.

Perhaps the portions of Genesis music/sfx in 32X games were of higher quality than normal (they sounded like it to me) by uh, being slightly boosted or helped out by the 32X sound hardware? That's just my theory, in terms of sample rates to be specific.

Also, I'm impressed that the Genesis handled the brunt of the work for "Knuckles Chaotix", but that's a compliment for the Genesis, and a strike against the 32X. Makes me wonder if cart versions of "Knuckles Chaotix" and "Sonic CD" (minus FMV, CD music and other SCD-strong features) could've been pulled off relatively well on vanilla Genesis hardware.

Joe Redifer
10-07-2007, 11:54 PM
Sonic CD is technically the poorest performing Sonic game. It stutters a lot when scrolling and is full of weird quirks like that. I'm not sure why it's like that. Knuckles' Chaotix would have probably needed to sacrifice some BG colors to use for the sprites had it been a Genesis-only game. I'm fairly sure that the Genesis-generated graphics in that game use a combination of sprites + BGs to get the most colors possible. Turn off the 32X video and you'll see the Genesis is creating over 40 colors on the BGs, which is more color than the BGs are allowed to create.

Aarzak
10-08-2007, 12:03 AM
Don't forget the "tosh", uncooperative and amateur hacker-esque level design. And the old, dusty Sonic 1 sprite? What gives?

Tweaker
10-08-2007, 12:56 AM
The interesting thing about Knuckles Chaotix is that it uses the standard SMPS engine for its music, but literally just hacked to allow for PWM. By using the PWM for the drums, they were able to use all 6 FM channels on the YM2612, making the music a lot fuller. It probably also could have used sample hi-hats to free up the noise channel on the PSG (leaving the last tone available for use), but everyone has their limits, I guess. =P

Virtua Racing DX and Shadow Squadron also use the SMPS engine. This is probably why they use the DAC rather than the PWM for sampled aspects of the music.

Genesis Knight
10-08-2007, 01:26 PM
That's a pretty neat rundown. Good job, Joe.

megadriveworld
10-15-2007, 03:39 PM
Definitely interesting. Thanks.

Was always curious to see how they got the AfterBurner music to sound pretty much identical to the arcade.

lilmul123
02-16-2008, 01:37 AM
I sure wish these weren't deleted; I'm pretty interested in hearing them.

Dirt Ball Gamer
02-21-2008, 02:06 AM
Wow shadow squadron has nice music too, thats impressive its mostly genesis

Joe Redifer
02-21-2008, 02:39 AM
I reuploaded to a new server. Try downloading them again.

evildragon
02-21-2008, 12:12 PM
i know that buz joe.. 60hz hum, and it's in your doom sample too..

happens when the screen is whiter in some areas, your computer is merely picking it up from the VDP.

MN12BIRD
02-21-2008, 07:33 PM
I always thought the SFX in 32x DooM where good yet the music blows. Now its clear why!

evildragon
02-21-2008, 08:08 PM
The Genesis could have properly did the music, had they properly ported the music for the OPN2 (YM2612), and not the OPL2/OPL3...

lilmul123
02-21-2008, 11:41 PM
What makes the sound chip in the 32x different from that in the genesis?

evildragon
02-21-2008, 11:45 PM
What makes the sound chip in the 32x different from that in the genesis?
Uh, that's like asking why a CD is different than a DVD.

Genesis: PSG, FM, and DAC
32X: PWM
Sega CD: CDDA, PCM

lilmul123
02-21-2008, 11:54 PM
Okay, let me rephrase that. How does PWM work for sound? I've never heard anything like that before.

The sound it seems to create is higher quality than FM, but it sounds scratchy...as if it was pre-recorded and brought down to 11025 Hz.

evildragon
02-22-2008, 12:05 AM
Okay, let me rephrase that. How does PWM work for sound? I've never heard anything like that before.

The sound it seems to create is higher quality than FM, but it sounds scratchy...as if it was pre-recorded and brought down to 11025 Hz.
You should compare PWM to DAC, PCM.. FM is highly different..

PWM, just do a wikipedia search on it..

Joe Redifer
02-22-2008, 05:55 AM
Most of those examples I posted sure don't sound scratchy to me. Tempo does sound like ass for some odd, incomprehensible reason, though.

Jay See Double You
09-23-2012, 03:31 PM
I really would like to hear the pwm portions of the cosmic carnage soundtrack isolated, even though I'm pretty sure its just the drums.

Even with the drums factored out, Cosmic Carnage still sounds richer and fuller, and more complex then what one expects on the Genesis. It's tempting to assume that the 32X enhances the FM and/or PSG, and or adds an extra something besides the pwm drums.

However, it seems that the only thing that's happening is that the FM channels that are typically being tied up with drums, etc are now free to go into music, resulting in richer, more layered FM textures, and thus, the -illusion- of more advanced FM hardware, when in fact the FM /PSG hardware proper is not technically enhanced one iota.

Although, I suppose whether the FM is acually enhanced, or whether its simply unaltered hardware only more liberated, the results are the same: music that could not be -practically- achieved by the Genesis hardware by itself.

Adding the 32x to the Genesis is kind of like adding those extra sound chips to certain Konami and Sunsoft NES cartridges. Yes, it adds a few channels that make sounds the NES could not, but every bit as important to the enhanced sound is the existing hardware's ability to perform more freely with certain duties being handled by the additional hardware.

Do I have it right?

Jay See Double You
09-23-2012, 03:50 PM
Although it seems this "Cosmic Carnage" approach to enhancing the sound is only one of many ways to implement the 32x hardware, ranging from the pwm doing almost everything in the case of blackthorne and after burner, to essentially nothing as in shadow squadron and virtual racing.

Knucles Chaotix, and probably others use the Cosmic Carnage approach. Then there's the Mortal Kombat II approach where the music is entirely Genesis, and only the sound effects (well, most of them anyway) use pwm.

So the approach, and ensuing results are anything but homogeneous.

Tentatively, I think the chaotix/carnage approach is my favorite, as it essentially preserves the Genesis character, only enlivens it.

I think it'd be neat to create a list of the different approaches to pwm implementation, and then categorize the entire 32x catalog into that list, with expounding details for each. I would be curious to see which method was most employed. Probably the Mortal Kombat approach for multiplatforms, and the cosmic carnage approach for system exclusives I'd guess.

Does anybody know?

Joe Redifer
09-23-2012, 06:23 PM
I really would like to hear the pwm portions of the cosmic carnage soundtrack isolated, even though I'm pretty sure its just the drums.


There are no 32X parts in the music. I can run the full soundtrack intact on my Genesis without a 32X attached. Same goes for Shadow Squadron.

Raijin
09-24-2012, 12:34 AM
Yep, Joe's got it. Cosmic Carnage doesn't use PWM for the music, and I don't think the sound effects either.

Listen to Mighty Morphin' Power Rangers - The Movie for the Genesis. Same composer, same FM instruments, drum samples, sound effects, etc.

Jay See Double You
09-24-2012, 01:39 PM
Hmmm, yeah, i'll have to check that soundtrack out.

sheath
09-24-2012, 02:35 PM
Thunder Force 3 and 4 would have benefited from this as well. Both have most of the audio depth and some instruments dropping out when your ship is shooting, which should pretty much be all the time. The soundtracks are awesome, but not as much when they are playing without other effects.

Chilly Willy
09-24-2012, 11:22 PM
I suppose given the topic, I really should post this...

http://www.mediafire.com/?bgbql635ldiusux

Joe Redifer
09-25-2012, 02:18 AM
What is that? I downloaded it anyway and will run it later tonight on my Sega Genesis 32X multi entertainment system.

Flygon
09-25-2012, 05:07 AM
I suppose given the topic, I really should post this...

http://www.mediafire.com/?bgbql635ldiusux
Certainly makes XM2SMPS converters quite redundant. :D

Edit: Finally got it flashed. Hahahaha, that is bloody hilarious! Repped!

Chilly Willy
09-25-2012, 12:51 PM
What is that? I downloaded it anyway and will run it later tonight on my Sega Genesis 32X multi entertainment system.

My experiment with interrupt-driven DMA PWM audio on the 32X. Basically, I start off the sound by filling one buffer and then starting the DMA/filling the second buffer. The DMA transfer end interrupt then starts the next DMA and fills the next buffer from then on. By doing it in the interrupt, you can use the slave sh2 for other tasks that might take a long time. Whenever audio is needed, the interrupt breaks into whatever is being done.

Fusion 3.64 should handle playing it. If you use Gens/GS with my DMA PWM mods, you need to change one more line to make interrupt-driven DMA PWM work. Naturally, it works fine on real hardware (and sounds the best on real hardware), so folks with flash carts are in for a real treat. The subject matter of the test is one of my favorite sections of music - the Second Episode of Doom.

In addition to new PWM code, I'm testing my XM playing code. The music was MIDI files converted using MIDI2MOD with the Roland SC-20 instruments. Like many others, I find the Roland patch set to sound better in the Doom music. The Roland set also has the distinction of using the least space. There are one or two instruments in the Roland set I don't like as much as others, but overall it's my favorite. Another objection people might have is it has the most instruments with lower sample rates... GUS patch sets are not all one sample rate, but usually lots of different rates depending on the instrument. The Roland set tends to be lower than other sets, so you can hear a little aliasing on some instruments. I also used a feature on MIDI2MOD to limit the upper end of the sample rate to 24kHz to keep the size down.

Note - on the example binary linked above, up/down will make the player skip immediately to the previous/next song, left/right will lower/raise the volume (it starts at maximum), and start pauses/resumes the playback. You have to press left/right repeatedly - it only steps one volume step per press... you can't just hold down the button.

saturndual32
09-25-2012, 09:28 PM
I suppose given the topic, I really should post this...

http://www.mediafire.com/?bgbql635ldiusux


Just tried it on my console, AWESOMENESS!. Especially E2M1, i loved it, it really got me in the mood for some Doom action, but i aint gonna play any Doom until yours is out, doesnt matter how long it takes. Are the tracks from Episode 1 of Doom gonna be there too?, they are my favorites. So the game is gonna play 12 channel tracks, plus the sound effects?

Aarzak
09-25-2012, 09:38 PM
Yep, Joe's got it. Cosmic Carnage doesn't use PWM for the music, and I don't think the sound effects either.

Listen to Mighty Morphin' Power Rangers - The Movie for the Genesis. Same composer, same FM instruments, drum samples, sound effects, etc.

Hikoshi Hashimoto FTW. Guy had a really good handling of the Genesis sound suite.

Chilly Willy
09-25-2012, 10:05 PM
Just tried it on my console, AWESOMENESS!. Especially E2M1, i loved it, it really got me in the mood for some Doom action, but i aint gonna play any Doom until yours is out, doesnt matter how long it takes. Are the tracks from Episode 1 of Doom gonna be there too?, they are my favorites. So the game is gonna play 12 channel tracks, plus the sound effects?

Yeah, I've got all three episodes and the score from Wolf3D done. I'll post those later tonight.

Yes, I was thinking of 4 channels for the sound effects so that the max channels would be a nice manageable 16.

EDIT: Okay, it's later tonight. Here's all three episodes plus Wolf3D. :D

XMP-Doom-Wolf3D.zip (http://www.fileden.com/files/2009/2/3/2304902/XMP-Doom-Wolf3D.zip)

Raijin
09-26-2012, 01:17 AM
Sounds like you have a frequency limit. E3M3 sounds pretty bad toward the end of the loop because of that. It that something you're currently working out?

Chilly Willy
09-26-2012, 01:52 AM
Sounds like you have a frequency limit. E3M3 sounds pretty bad toward the end of the loop because of that. It that something you're currently working out?

Yeah, eventually. It'll be a while before I use the Doom music, so I'll have some time to make things even better.

Chilly Willy
09-26-2012, 12:27 PM
Sounds like you have a frequency limit. E3M3 sounds pretty bad toward the end of the loop because of that. It that something you're currently working out?

Okay, I figured out what that is... XM allows instruments to have more than one sample; the idea is that some instruments might have a different sample for different octaves to sound better. Looking at the song in question, the instrument is the overdriven guitar, which has six different samples. To keep things simple and to save space (especially the latter), the xm player tosses all the samples but the first when making the rom. The problem arose because the first sample for the overdriven guitar uses a relative note of 32 - in other words, it plays nearly three octaves higher than normal. That's not normally a problem, but if you play that particular instrument at ridiculously high octaves, it is playing almost three octaves beyond that.

I extended the period table almost three octaves and it clears up the problem, but I wonder if that's the best way to handle it. Perhaps instead of keeping the first sample, I should look through the samples and keep the one with the lowest relative note. Or maybe I should look for the one that is used the most for the song - the problem with this choice is it would almost certainly use more space. In the meantime, I'll leave the extended period table in place.

Chilly Willy
09-27-2012, 12:00 AM
Okay, here's three different binaries - they all use much higher quality instruments, but have different sounds and balances on the inter-instrument volumes. This should give you an idea of how different the same music can be given different soundfonts. The Ntonyx soundfont is particularly different as they seem to have replaced the overdriven guitar with some kind of quiet bell-type instrument. That really screws up certain songs. The RolandGS version uses a higher quality newer GM-GS soundfont compared to the old Roland SoundCanvas used in the previous binaries, but it's still clearly Roland, and sounds the best of these higher quality sets.

XMPlayer-Doom-E3-various.7z (http://www.fileden.com/files/2009/2/3/2304902/XMPlayer-Doom-E3-various.7z)

Raijin
09-27-2012, 12:33 AM
I think I understand what you mean, though I don't know much about the XM format.
I have to say this newer one doesn't sound as good, no offense. Personally I'd be curious as to what it would sound like with some sampled 4 OP FM, or mix some FM guitars and Bass with the original samples, though I'm not fully sure what you have planned.

TVC 15
09-27-2012, 04:19 AM
I demand an XG format version of this music!

That way I can use my Yamaha MU-50 attatched via the 32X's built-in Midi/Parrallel port! For the authentic PC experience!

Chilly Willy. Great Job.

TmEE
09-27-2012, 04:39 AM
Yamaha FTW
It would be interesting to attach a MIDI device to one SH2 serial ports. I don't know if you can get 4M / 128 baud rate, seeing the master clock not being a multiple

TVC 15
09-27-2012, 04:50 AM
Funnily enough...


http://www.youtube.com/watch?v=UODyfKhdyQg

Optomised for XG. Sounds awesome.

TmEE
09-27-2012, 05:03 AM
If it was optimised it would use the DSP distortion pedal feature for real awesome (the Sysex messages are documented somewhere). Better than Roland though :P

Chilly Willy
09-27-2012, 01:17 PM
Funny, I was listening to that XG version yesterday. I like the sound, and many people want a soundfont that gives that sound, but no one has yet to make one... apparently the way the XG creates sound makes making a soundfont almost impossible.

And Raijin, I agree with you - the instruments may be higher quality, but that doesn't mean it sounds "better". That was precisely why I posted those. A well-tuned set of instruments like those old Roland ones sound better than huge pricey sets any day. I don't understand why some folks don't understand this. Look at the Crisis soundfont - it's 1.8 GBytes, but doesn't sound any better than any of the ones I posted.

Which is why I'm always on the lookout for another soundfont - someday I'll find one tuned to sound just right on Doom. In the meantime, the old Roland set is pretty close.

Joe Redifer
09-27-2012, 05:06 PM
I find that Doom doesn't have very good music. Any version.

Chilly Willy
09-28-2012, 01:22 AM
Many people detest the Doom music, and many love it. Anywho, here's a bunch of binaries using different soundfonts:
XMPlayer-Doom-Wolf3D-RSO.7z (http://www.fileden.com/files/2009/2/3/2304902/XMPlayer-Doom-Wolf3D-RSO.7z)

superandroidtron
02-24-2013, 08:47 PM
The SoundBlaster version is pretty sweet! How much CPU time does the XM player use? Is there enough time left over to handle an actual game?

Chilly Willy
02-24-2013, 08:58 PM
The XM player uses a negligible amount of master sh2 time as it uses the slave to process the score and mix the instruments. Here's the latest version which also mixes sound effects with the music:

xmplayer-sfx.zip (http://www.fileden.com/files/2009/2/3/2304902/xmplayer-sfx.zip)

Press A to start a looped sound effects of rainfall, press C to stop the rain, and press B to start a one-shot sound effect of a hit, which when ends is followed by an "oof". As with the original player, left/right changes the volume, and up/down goes through the list of xm songs.

The only affect the music/sfx has on the master is it uses some bandwidth to fetch the instruments/sounds, and output the mixed result. You don't want to use XM music with like 32 channels as that would consume an excessive amount of bandwidth, slowing everything else down. 4 to 12 channels with 4 sfx channels shouldn't cause any noticeable slow down with a game unless it relies on an excessive amount of bandwidth. If you look at my yeti3d demos, you'll see that music and sounds don't make much a difference at all.

superandroidtron
02-25-2013, 05:41 PM
That's awesome. I look forward to seeing future games that use this sound engine.