how can i do music on megadrive?

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Post Reply
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Jan 31, 2007 1:56 pm

TmEE co.(TM) wrote:
Stef wrote:5 Khz is not something which can called "pretty good", but i've to admit that sound not that bad at least ;)
I don't know if you have tested Duke3D on the real thing, but I can say, that it looks and sounds awful on emulators, sound is bad especially on Gens, because its DAC is not very good. On the real thing, its a different story (mostly).
Never tried on the real thing, but tested on Kega.
I'll try it asap.

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

Post by TmEE co.(TM) » Wed Jan 31, 2007 1:59 pm

You'll be impressed how different it looks on emulator and TV. Kega has very good DAC... but it seems to play my WAVPLAYs little faster than on the real thing.
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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Jan 31, 2007 2:26 pm

I re-tried on Kega, it's true the sample of Duke Nuken sounds good. I'm really impressed for 5 Khz sample !

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

Post by TmEE co.(TM) » Thu Feb 01, 2007 6:25 am

See, real system always sounds better than emulation, no matter if you're using the best or worst of them.
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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 01, 2007 7:43 am

I have to disagree, the genesis DAC sounds a bit woofed. Yesterday i did some test of my Z80 wav player (16 Khz sample) and the sound of the genesis was not as good than on emulator imo. For good quality sample, the genesis generally sound not as good than emulator (PC sound card has better output) but for low sample rate the genesis imperfect DAC produce better result and hide efficiently the low rate used :)

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

Post by TmEE co.(TM) » Thu Feb 01, 2007 8:28 am

Not true for my system !!! I've modified the audio mixing part and now it has really great sound output, with almost 100% stereo separation. Original sound output system has poor stereo (50% separation) and a bit distorted (very very slightly).
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

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Feb 01, 2007 12:46 pm

ah ah ah!!
I tested without optimisation of my current code : it support 6KHz sample!!
far from the 16KHz possibility ;)
Ok, I'm playing FM at the same time...perhaps it's the problem...
What if I add PSG support now ?!!!

my my my...Z80 is even harder to optimize than 68k ;)

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 01, 2007 1:15 pm

Well, i just did my first Z80 asm programming these last days and i've to admit i don't like it much... Z80 instruction set isn't the best one :-/
no flag modification for 16 bits arithmetic, 8 bits arithmetic only on register A, no test or tst instruction...
My first program was a 4 bits PCM player on the PSG, but quality was so hurting that i decided to drop back on the DAC. Then my player was able to handle 16 Khz 8 bits sample with some free cpu cycles aside.
Yesterday i tried to play 2 samples at same time with software mixing @16 Khz but for now, my (awful) code can't maintain it and i've some minors bugs to fix. But i think with some optimisations it's something possible :)

16 Khz gives you 223 cycles for each DAC write :)
Last edited by Stef on Thu Feb 01, 2007 2:49 pm, edited 2 times in total.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 01, 2007 1:43 pm

TmEE co.(TM) wrote:Not true for my system !!! I've modified the audio mixing part and now it has really great sound output, with almost 100% stereo separation. Original sound output system has poor stereo (50% separation) and a bit distorted (very very slightly).
You modified the audio output :p
without modification, the sound output isn't that good ;)

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

Post by TmEE co.(TM) » Thu Feb 01, 2007 2:03 pm

Yes I did !!! That hassling with smd components and other tiny stuff was definately worth it. BUT I'm not very food on analog electronics so there are some things which I should redo (improve audio amplifications stuff).
Last days, I've messed with getting decent RGB out of the system, I'd tell more but that's off topic.
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

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Fri Feb 02, 2007 10:13 am

ok, i modded KMod
I was able to spy the DAC freq update....

so WAVPLAY is at 11737Hz not 12 ;)
and my test is at 6654Hz

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Feb 02, 2007 10:24 am

KanedaFr wrote:ok, i modded KMod
I was able to spy the DAC freq update....
hehe, neat feature ;)
Anyway playing something > 16 Khz is just a waste :p
I would love to have a z80 code capable of mixing 2 channel at 16 Khz. For now i've 2 channels at 10 Khz...

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Fri Feb 02, 2007 12:02 pm

hop, i won 400Hz...no 7Kz ;)

need to work on the FXaddr++

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Feb 02, 2007 12:26 pm

FXaddr++ ? are you coding the Z80 in C ? that explain some stuff :)
Maybe your Z80 C compiler isn't a good optimiser...

Just something about the YM2612 : have you to stop the Z80 to access it from the 68000 cpu ? from what i saw, we can access it from A04000 only so we need the Z80 bus... too bad :-/

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

Post by TmEE co.(TM) » Fri Feb 02, 2007 1:03 pm

Why do you need to access YM2612 with 68K and z80 at the same time ?
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