Page 1 of 1
Module music in my programm.
Posted: Sat Mar 26, 2016 11:52 am
by alko
Whether there is a module player compatible with SGDK ?
For now I found only injectror, which allows to replace the standard music to custom.
http://oerg866.tototek.com/toy.html
Re: Module music in my programm.
Posted: Tue Aug 23, 2016 8:16 am
by Nainain
Re: Module music in my programm.
Posted: Tue Aug 23, 2016 11:33 am
by Stef
I think he's looking for a real MOD player for Megadrive. And except the one borrowed from ToyStory game i don't know any other.
Re: Module music in my programm.
Posted: Tue Aug 23, 2016 1:09 pm
by alko
Stef wrote:And except the one borrowed from ToyStory game i don't know any other.
And this ->
http://www.pouet.net/prod.php?which=64438
Re: Module music in my programm.
Posted: Tue Aug 23, 2016 5:56 pm
by Stef
As far I can tell this is just a simple music player for Megadrive with Megadrive designed musics, nothing common with MOD musics.
Re: Module music in my programm.
Posted: Wed Aug 24, 2016 6:42 pm
by Mask of Destiny
Stef wrote:As far I can tell this is just a simple music player for Megadrive with Megadrive designed musics, nothing common with MOD musics.
Stuck Somewhere in Time uses an actual MOD player, the caveat is that it runs almost entirely on the 68K (and chews up a fair bit of CPU time IIRC) with the Z80 only handling delivery of samples to the DAC from a buffer in its RAM.
EDIT: Here's the
Spritesmind thread about it.
Re: Module music in my programm.
Posted: Thu Aug 25, 2016 8:01 am
by Stef
Oh i completely forgot it was a MOD player :p 26 Khz playback, that is definitely interesting.
About having it running on the 68k, well i believe it would be hard to have it running on the Z80 only anyway, the best we can do is to share the work: maybe using 20% of 68k time to pre compute some parts then send final mixing operations to Z80.
Re: Module music in my programm.
Posted: Thu Aug 25, 2016 8:28 pm
by Mask of Destiny
Stef wrote:About having it running on the 68k, well i believe it would be hard to have it running on the Z80 only anyway,
Yeah, it's really hard to resample and mix more than 2 channels simultaneously on just the Z80 at any reasonable sample rate.
Stef wrote:the best we can do is to share the work: maybe using 20% of 68k time to pre compute some parts then send final mixing operations to Z80.
Yeah, mixing 4 channels is obviously possible since you've done it. I imagine volume should be possible to do on the Z80 side as well. I do wonder if you can reasonably keep the 68K time down to 20% though. Hard to push samples through efficiently when you can only pause the Z80 for a relatively short period at a time without overly interfering with playback.
Re: Module music in my programm.
Posted: Fri Aug 26, 2016 7:17 am
by Stef
In fact I have a driver doing 4pcm mixing + volume/envelop (16 levels) but it supports envelop change once per frame and I'm not sure that enough to produce acceptable ADSR env reproduction.
About 68k <---> Z80 communication, you always have the SRAM possibility. To be honest I never tried it but I see no reason why it wouldn't work

Re: Module music in my programm.
Posted: Mon Aug 29, 2016 6:26 am
by alko
Z80 qualitatively mixes samples
ZX-spectrum 48k (3 channel's 4 bit's):
https://youtu.be/3MNHP-hBMLI?t=46
Re: Module music in my programm.
Posted: Mon Aug 29, 2016 8:18 am
by Stef
Does it really mix samples ? 3x4 bit channel sounds like it's using the AY channels (which make sense of course). We could also do that on MD (use the PSG) to lower Z80 CPU usage.
Re: Module music in my programm.
Posted: Tue Aug 30, 2016 12:08 am
by Mask of Destiny
It does seem likely that it's using the AY hardware to handle the mixing. That said, mixing isn't all that expensive compared to the other stuff you need to do. The problem we have on the Gen/MD is that it's rather expensive to switch banks and you have to avoid doing any access to the 68K's bus while DMA is running. If you don't mind to limiting yourself to what will fit in the meager RAM of the Z80, then I suspect you could resample and mix 3 channels without too much trouble.