Totally Awesome to the MAX!!

Ask anything your want about the 32X Mushroom programming.

Moderator: BigEvilCorporation

Chilly Willy
Very interested
Posts: 2525
Joined: Fri Aug 17, 2007 9:33 pm

Totally Awesome to the MAX!!

Post by Chilly Willy » Sat Feb 26, 2011 6:18 am

The greatest decade of all time gave us the greatest music format, developed on the greatest computer of ALL TIME. This totally rad machine was just too ahead of it's time, blowing minds across the world. I'm talking, of course, about the Amiga and the awesomeness that is the Module Format.
8) :twisted:

Now at last this awesomeness is in YOUR HANDS! Here is my first release of the module player for the 32X. The code runs entirely on the slave SH2, and uses DMA to pump 44kHz stereo awesomeness to your speakers.

The code is derived from Massimiliano Scarano's ProTracker code for the Amiga. Said code requires mentioning him as the original author... which I'm doing (and in the module.c file as well). :D

There are defines for enabling full pan support (not used by most mods, but you might use it for your own), as well as variable cross talk between channels. This player just uses plain stereo. I have a define to enable 6 or 8 channel mod support (not finished yet), but I've never seen a 6 channel mod, and only two 8 channel mods. :lol:

So you get a four channel stereo mod + four channels for sound effects. The sound effects can be panned, looped, and set as one-shot or persistent. Everything from the sample rate to the number of sample voices can be set with a simple define. The player uses 44,100 Hz 9-bit samples for HiFi quality audio far in advance of the crap you usually find in 32X games. All the mods are from the MOD Archive, and average over four minutes each for a solid hour of MOD awesomeness.

This player is so awesome, no emulator can handle it. So grab your NeoMyth/Everdrive-MD/MD-Pro/hand made cart stuffed with EPROMS and groove to the tunes, Baby! 8)

Controls:
START = pause/resume
UP = skip to previous mod
DOWN = skip to next mod
LEFT = lower volume
RIGHT = raise volume


ModTest32X-20110225.zip

EDIT: The next to last mod (small village) loops forever... when you get tired of listening to it, push DOWN to go to the last mod. :oops: :lol:

User avatar
TmEE co.(TM)
Very interested
Posts: 2287
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sat Feb 26, 2011 8:30 am

This needs more Mantronix and Tip :P

awesome none the less :D
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2525
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Feb 26, 2011 8:34 am

Feel free to either make your own bin with mods you like, or shoot a few over to me if you would rather I do it. I'll probably post another bin tomorrow with some game mods I like (Leander, SotB, etc).

Pascal
Very interested
Posts: 200
Joined: Wed Nov 29, 2006 11:29 am
Location: Belgium
Contact:

Post by Pascal » Sat Feb 26, 2011 11:27 am

Chilly Willy wrote:Feel free to either make your own bin with mods you like, or shoot a few over to me if you would rather I do it. I'll probably post another bin tomorrow with some game mods I like (Leander, SotB, etc).
AWESOME !! great work !! don't forget Condom corruption mod :)

Chilly Willy
Very interested
Posts: 2525
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Feb 26, 2011 7:50 pm

Pascal wrote:
Chilly Willy wrote:Feel free to either make your own bin with mods you like, or shoot a few over to me if you would rather I do it. I'll probably post another bin tomorrow with some game mods I like (Leander, SotB, etc).
AWESOME !! great work !! don't forget Condom corruption mod :)
Ugh - I HATE that mod!! :x :lol:

Everyone has their own taste in music, but I don't see how that one is so popular. :?

Chilly Willy
Very interested
Posts: 2525
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Feb 27, 2011 12:48 am

Okay, here's an update... 6 and 8 channel mods now play. The player shows the number of channels as well as the name. I also had the channels reversed - they play on the proper side now.

There is a source and a binary archive - included are my mods, some Psygnosis game mods (3MB for you MegaCart users!), and some of Tiido's faves (a bunch on those are also on my list, just not as high as the one's I put together).

Looped songs should now stop instead of playing forever, and Star Dust now plays at the proper rate (quirk in Star Dust, not the player).

There are two versions of Tiido's mods: one at 44kHz and the other at 22kHz. The 22kHz mods only use half the bandwidth, half the memory, and have 10 bit samples instead of 9 bits. But they are also half the sample rate. I suppose you can make your own mind up on which sounds better. The Psygnosis mods are at 22kHz as well.

ModTest32X-20110226.7z
ModTest32X-src-20110226.7z

User avatar
TmEE co.(TM)
Very interested
Posts: 2287
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Feb 27, 2011 8:43 am

The 22KHz version sounds most definitely better, less noise and for some reason its crisper too. I would say that there's no point going over 22KHz, especially since in non modified machines all the extra high freq content is brutally filtered out anyway :lol:

..and Vibrato is definitely too strong.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2525
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Feb 27, 2011 9:19 am

TmEE co.(TM) wrote:The 22KHz version sounds most definitely better, less noise and for some reason its crisper too. I would say that there's no point going over 22KHz, especially since in non modified machines all the extra high freq content is brutally filtered out anyway :lol:
Yeah, 22kHz is definitely good enough. Of course, if it suits the game better, you could always use 24kHz, or 16kHz, or whatever. Anything high enough to avoid the whine that the 32X PWM has at lower rates would probably do fine. 11kHz whines... 14kHz doesn't (Wolf32X uses 14kHz because it's twice the 7kHz rate of the digital audio samples in Wolf3D).

..and Vibrato is definitely too strong.
That and tremolo. This is just how ProTracker handles it, but maybe the filter on the Amiga sound dampened it a bit. I'll have to play with the levels on the two. It's definitely a bit strong for today's listeners. :lol:

All in all, I think I'm on to something here. Playing a mod like this is MUCH easier on the average homebrewer than trying to put together something for the FM/PSG.

While I mess with vibrato/tremolo, I'll start looking at XM... see how much work that would be to handle. I'm encouraged by how well mod went. 8)

User avatar
TmEE co.(TM)
Very interested
Posts: 2287
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Feb 27, 2011 9:37 am

Vibrato and Tremolo and freq slides all sound wrong compared to every other player I've played those MODs in, including Amiga itself (well, CD32). for example, with vibrato, the notes are substantially lower than they should and oscillate more stronger, and it causes things to sound rather dissonant in some cases, not so with other players.

and arpeggios are not so right too
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2525
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Feb 27, 2011 5:41 pm

TmEE co.(TM) wrote:Vibrato and Tremolo and freq slides all sound wrong compared to every other player I've played those MODs in, including Amiga itself (well, CD32). for example, with vibrato, the notes are substantially lower than they should and oscillate more stronger, and it causes things to sound rather dissonant in some cases, not so with other players.

and arpeggios are not so right too
Are you perhaps using an NTSC Amiga? MOD was designed to play on PAL Amigas, and when played on NTSC, they sound different. All PC mod players are designed to play at the PAL rates.

I've confirmed the actions of arpeggio, vibrato, and tremolo against libmikmod, and I have to say that what I hear on my PC with mikmod sounds a LOT like the 32X. The pitches and slides sound the same, and while the vibrato and tremolo sounds "strong" it does sound the same.

The only difference I've found is the random waveform for vibrato and tremolo, which I've now corrected on in module.c. The only other difference is mikmod filters the final audio, and then the player may do stereo "enhancement", both of which changes the sound of the music somewhat. What we have on the 32X mod player is raw sound that follows the mod specification EXACTLY (except for that discrepancy in the random waveform I mentioned).

Hmm - I'm looking at modplug, which is used by a lot of players. Here's a snippet of the vibrato from module.c in my code:

Code: Select all

  Delta *= Mod_p->Channels[ Channel ].VibratoDepth;
  Delta >>= 7;
  Delta <<= 2; /* we use 4*periods so make vibrato 4 times bigger */
Modplug does the shift by 7, but doesn't seem to do the shift by 2 back the other way. That makes the vibrato 1/4th as strong. Tremolo seems to be the same... module.c shifts the delta >> 6, while modplug shifts the volume << 6, so they're equivalent with modplug giving a more accurate value of the same depth. Arpeggio is the same with modplug... frequency slides look the same.

Chilly Willy
Very interested
Posts: 2525
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Feb 27, 2011 7:38 pm

Okay, here's the current binaries. I didn't make a source arc since the changes are so simple, I'll just put them here. This sounds so much like Audacious playing the mods via modplug, it's uncanny. Well, once you set modplug to use nearest resampling (which is what the SH2 mixer uses), use 22kHz sample rate, turn off the noise reduction, disable surround processing, and disable extra stereo enhancement, that is. THEN they sound exactly the same. :lol:

In module.c:
change line 1074 to

Code: Select all

      Delta = rand() & 255; /* random */
comment out line 1080

Code: Select all

  //Delta <<= 2; /* we use 4*periods so make vibrato 4 times bigger */
and change line 1130 to

Code: Select all

      Delta = rand() & 255; /* random */
ModTest32X-20110227.7z

User avatar
TmEE co.(TM)
Very interested
Posts: 2287
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Feb 27, 2011 7:39 pm

my CD32 is 100% PAL

I'll get some recordings in nearer future of some problematic parts...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2525
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Feb 27, 2011 8:01 pm

TmEE co.(TM) wrote:my CD32 is 100% PAL

I'll get some recordings in nearer future of some problematic parts...
That would be helpful. I'm comparing against Audacious/ModPlug for my testing.

EDIT: Just made a change that increases the sound quality quite a bit. Instead of leaving the samples as 8 bits, which are then scaled by the volume to 7 bits, then summed across the channels and scaled to a final 10-bit sample, I now scale the sample to 16 bits (one shift on the SH2), which is then scaled by the volume to 15 bits, which I then scale to 13 bits (so that eight sample voices won't overflow a word), then summed across the channels and scaled to a final 10-bit sample. So the volume effects used by the mod now have an extra 6 bits of precision (7 to 13 bits) that was just tossed out in the previous code. This will be in the next update.

EDIT: Testing shows the rand() used in the last fixed is TOO DAMN SLOW! I'll make my own random function...

EDIT: Damn! Not the random... something else is slowing this down on certain songs (namely Fountain of Sighs).

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Mon Feb 28, 2011 6:47 am

I'm comparing against Audacious/ModPlug for my testing.
Doesn't ModPlug have a bad reputation among Amigaphiles? I recall seeing lots of complaints about it. Maybe you could try XMPlay instead. Or something based of libfmod.

User avatar
TmEE co.(TM)
Very interested
Posts: 2287
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Mon Feb 28, 2011 7:30 am

yeap, XMplay is what I usually use for my music listening and it has really great module playback.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest