how can i do music on megadrive?

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

Moderator: BigEvilCorporation

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

Post by Stef » Wed Feb 28, 2007 2:44 pm

TmEE co.(TM) wrote:
Stef wrote:I wrote a stereo sample player these 2 last days. It's worked perfectly with Kega but not with Gens :p
On real hardware, it was first just doing silent... After i figured some weird stuff about the YM2612 chip, i was able to get it up on real hardware, unfortunatly the used trick doesn't work because of the YM2612 hardware latency :-/
Too bad, having stereo sample on Genesis would have been a neat trick (as it doesn't support it natively)... anyway i've already some others ideas in head ^^
Hehe, I did such thing too !!! But it was in 68K code though. I played 16 samples from one channel and 16 from another. I didn't have my SRAM cart then so I don't know what it would do on real HW, and I probably can't check it, 'cos I think I fried it (was in bus conflict all night, RAMs were pretty hot).

I was doing 1 sample left, 1 sample right...
I've to test the YM2612's change output latency. Maybe we can find a viable solution.
16 samples left, 16 samples right didn't sounded a bit strange ? is the stereo effect acceptable ?
Last edited by Stef on Wed Feb 28, 2007 7:28 pm, edited 1 time in total.

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 Feb 28, 2007 4:10 pm

1 sample sounded awful, because if you change speaker, previous value will be outputted aswell, and stereo effect gets little too mono. I made a special audio converter for that. I need to find and refine the source. BTW my SRAM cart didn't fry and I tested my MSETEST on it and I can say, YM2612 like all other Yamaha stuff, handles torturing very well, and I could listen 70KHz about 15seconds to pretty few minutes when the chip started to output silence.
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 Feb 28, 2007 7:34 pm

TmEE co.(TM) wrote:1 sample sounded awful, because if you change speaker, previous value will be outputted aswell, and stereo effect gets little too mono. I made a special audio converter for that. I need to find and refine the source. BTW my SRAM cart didn't fry and I tested my MSETEST on it and I can say, YM2612 like all other Yamaha stuff, handles torturing very well, and I could listen 70KHz about 15seconds to pretty few minutes when the chip started to output silence.
It does work perfectly on Kega and not sounded awful on hardware, but not stereo too, almost mono in fact. I guess the pan setting has some latency. However to do 16 samples left then 16 samples right, you have to use your own stereo sample builder to get a correct stereo effect no ?

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 Mar 01, 2007 6:37 am

I uploaded my Stereo player. Mine only does "iiiiiiii" on the real thing, YM2612 really hates switching speakers, If I played 512 samples, I could hear some pretty shitty sound. 4 samples is the best, more is good too but not less than 4. I dropped my audio converter and did a little trick in software so there is no need for anything else than Sound Recorder.
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 Mar 01, 2007 8:17 am

TmEE co.(TM) wrote:I uploaded my Stereo player. Mine only does "iiiiiiii" on the real thing, YM2612 really hates switching speakers, If I played 512 samples, I could hear some pretty shitty sound. 4 samples is the best, more is good too but not less than 4. I dropped my audio converter and did a little trick in software so there is no need for anything else than Sound Recorder.
Strange about the "iiiii" stuff on real hardware. Anyway there is many holes on real hardware. I regulary need to fix some stuff in my mini devkit to get it working on real hardware (even if they perfectly work on emulator). But your stereo player doesn't really play stereo sample as converted stereo MP3 right ? mine can, at least on Kega :p I tried some stuff with YM2612 channel, but total level is db, and latency kills interests... i'm afraid we can't really do a nice stereo sample player on real hardware :-/

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 Mar 01, 2007 8:34 am

It sounds very good, the source sound was a MOD because these have 2ch left, 2ch right which makes stereo listening very good. I got pretty good stereo, but the 32KHz 8-bit stereo WAV sounds like 16KHz 4-bit file :(

Good stereo is impossible on real HW :cry: but using a few DACs in cartridge is another idea... or an addon, cartslot and extport both have audio lines...
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 » Fri Mar 02, 2007 11:32 am

Using extra hardware isn't interesting for me as except you, nobody will be able to use your software...
The fun is to push genesis hw to limit ;)

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 Mar 02, 2007 11:41 am

Extra HW is useful when you're going to make a commercial game... my current project may end up commercial but its very unlikely.

I was thinkng, that my FM code would use only few regs, so I only PUSH/POP required registers, and make the use of all the registers in my 2ch code, then I might be able to achieve reasonable sampling rate. BTW, MD plays 44KHz samples very well. In emulators, there is a "magical" point which beyond the sound quality stops increasing, least it doesn't happen on real HW
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 » Fri Mar 02, 2007 12:27 pm

TmEE co.(TM) wrote:Extra HW is useful when you're going to make a commercial game... my current project may end up commercial but its very unlikely.
If it's for commercial purpose ok ;)
I was thinkng, that my FM code would use only few regs, so I only PUSH/POP required registers, and make the use of all the registers in my 2ch code, then I might be able to achieve reasonable sampling rate. BTW, MD plays 44KHz samples very well. In emulators, there is a "magical" point which beyond the sound quality stops increasing, least it doesn't happen on real HW
PUSH/POP takes some precious cycles, look at my source, i'm using EXX to use the complete register set :)
Anyway using PUSH/POP will permit a more conventionnal code and maybe a futur 3 channels player :p
The DAC output (on headphone output) of my PAL genny 1 is very bad :-/ sample sound somewhat distorted on high frequency...
So 44 Khz is possible, i though it was limited to 36 Khz (from your own tests).

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) » Sat Mar 03, 2007 2:54 pm

Forget the headphone output, it is the worst place to get sound output !!! Best place to get decent sound is to get it from HP amps input pins. I got 44KHz without waiting before its ready to write, aparently YM2612 tolerates torturing very well, even 70KHz work !!!
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 » Sun Mar 04, 2007 11:30 am

TmEE co.(TM) wrote:Forget the headphone output, it is the worst place to get sound output !!! Best place to get decent sound is to get it from HP amps input pins. I got 44KHz without waiting before its ready to write, aparently YM2612 tolerates torturing very well, even 70KHz work !!!
Wow impressive, didn't know the YM2612 can handle 8 bits data at that rate ! I think i'll modify my sound output to improve it a bit, or at least use my sega CD output which is much better.

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) » Sun Mar 04, 2007 1:04 pm

I just finished tuning my MD2's sound output, I'm really satisfied with it :D . It sounds so great through my HiFi... I would like to compare my MD's sound output with unmodified MD's sound output.
I guess you should use the SCD sound output, less trouble :wink:
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

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) » Mon Mar 05, 2007 12:30 pm

I managed to improve my 1ch player again, now it goes @ 64KHz, fully featured 8)
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 » Mon Mar 05, 2007 2:50 pm

What does means "fully featured" ?
64 Khz is awesome, only 56 cycles by loop ;)
Last edited by Stef on Tue Mar 06, 2007 8:02 am, edited 1 time in total.

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) » Tue Mar 06, 2007 6:25 am

Fully featured means you can Stop/Pause, give commands - things like that.
It runs very fast but still, If I try to make 2ch player, I can't get over 10KHz !!! All the slowdowns lie in changing banks. I'll upload it tomorrow
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