YM2612 fully accurate VGM hardware player
Moderator: BigEvilCorporation
YM2612 fully accurate VGM hardware player
Hi guys,
I just finished a first version of my project. It uses a Teensy2.0++ board.
I wrote a custom VGM file streamer (PC side) which sends 64 bytes data packets to the Atmel µC over USB with the RAW HID protocol (no drivers to install) into a circular buffer.
The VGM file format is very well thought, at least for emulation, but not really for realtime, which led me into very interesting timing issues which now seem to be resolved. I was also able to add PCM support for the DAC.
Have a look : http://www.youtube.com/watch?v=cYtwoyx1ccI
It also seems to be very hard to find a 7.67 MHz oscillator or even a 53.7 MHz I could then clock divide so I find a nice solution : an adjustable clock generator I can fine tune very precisly (even in real time which is funny).
And also, I little experimentation : the YM2612 playing 8 bit PCM audio (with DAC mode from channel 6 only of course) at 44.1 kHz still with the RAW HID protocol. I had to adjust the clockrate to ~8.81 MHz.
Here it is : http://www.youtube.com/watch?v=fYWclV9H2eY
I just ordered some SN76489 chips and I'm waiting for those to arrive
Hope you'll enjoy !
Cheers,
sig
I just finished a first version of my project. It uses a Teensy2.0++ board.
I wrote a custom VGM file streamer (PC side) which sends 64 bytes data packets to the Atmel µC over USB with the RAW HID protocol (no drivers to install) into a circular buffer.
The VGM file format is very well thought, at least for emulation, but not really for realtime, which led me into very interesting timing issues which now seem to be resolved. I was also able to add PCM support for the DAC.
Have a look : http://www.youtube.com/watch?v=cYtwoyx1ccI
It also seems to be very hard to find a 7.67 MHz oscillator or even a 53.7 MHz I could then clock divide so I find a nice solution : an adjustable clock generator I can fine tune very precisly (even in real time which is funny).
And also, I little experimentation : the YM2612 playing 8 bit PCM audio (with DAC mode from channel 6 only of course) at 44.1 kHz still with the RAW HID protocol. I had to adjust the clockrate to ~8.81 MHz.
Here it is : http://www.youtube.com/watch?v=fYWclV9H2eY
I just ordered some SN76489 chips and I'm waiting for those to arrive
Hope you'll enjoy !
Cheers,
sig
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Only ~30000 writes end up in the output of the chip. Going past half of YM sample rate results in missed writes.
Regarding the PSG chips you'll be getting different noise pattern from them than the PSG inside MD and SMS VDP.
Still pretty nice ^^
Regarding the PSG chips you'll be getting different noise pattern from them than the PSG inside MD and SMS VDP.
Still pretty nice ^^
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Yeah, I think you're write about the YM sample rate because when I first tried the PCM audio experiment, the chip was running at ~7.67 (as usual) and I had cracks in the output, then I thought I was sending data too fast, but, after overclocking it a little, the cracks disappeared. It was easy to observe taht since I can adjust the clock source in real time. Unless you tell me that there should not be any link between the clockrate of the YM2612 and its working speed for some operations ?
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Everything is tied to the clock. YM sample rate is Clock/144, and maximum PCM rate is half that from my tests.
Take some metal song with lot of cymbals and boost the highs (12KHz+) and you can hear how crap the sound becomes. On lower freqs the missed writes don't cause much issues as the waveforms are quite "flat" but one missed sample in a very high freq results in that waveform getting obliterated.
Take some metal song with lot of cymbals and boost the highs (12KHz+) and you can hear how crap the sound becomes. On lower freqs the missed writes don't cause much issues as the waveforms are quite "flat" but one missed sample in a very high freq results in that waveform getting obliterated.
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
@TmEE co.: Thanks for the info. I forgot about the internal clock division /144 and the PCM maximum rate you found is very interesting.
@KanedaFr: I didn't use LUFA. The Atmel is programmed in plain C with avr-gcc. But LUFA seems to be very nice ! I should look at it ! Your idea is very nice, but, as a lot of emulations purists told me, I will never get the true sound of the Genesis because the SN76489 I'm gonna use won't have the same noise shift registrer and won't sound the same as the original MD/SMS VDP :-/
Cheers !
@KanedaFr: I didn't use LUFA. The Atmel is programmed in plain C with avr-gcc. But LUFA seems to be very nice ! I should look at it ! Your idea is very nice, but, as a lot of emulations purists told me, I will never get the true sound of the Genesis because the SN76489 I'm gonna use won't have the same noise shift registrer and won't sound the same as the original MD/SMS VDP :-/
Cheers !
-
- Interested
- Posts: 35
- Joined: Tue Sep 06, 2011 2:16 am
- Location: /dev/sa0
- Contact:
This is indeed an interesting project.
However, lik one other people said, you won't really get close to the MD's sound with the noise shift reg issue, although if you implement the PSG in an FPGA you could get around this issue.
Just a quick question - where did you buy your YM2612 and SN76489? I'm planning to make a 68k based MIDI thinger with those two chips.
However, lik one other people said, you won't really get close to the MD's sound with the noise shift reg issue, although if you implement the PSG in an FPGA you could get around this issue.
Just a quick question - where did you buy your YM2612 and SN76489? I'm planning to make a 68k based MIDI thinger with those two chips.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
utsource.net and alibaba.com are good places to start.
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen