SMS Power! Logo Forums
Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Development - Music - Museum

 View topic - Rene's YM2612
Log in
Search
Memberlist
Membermap
Profile
FAQ
Register
 Log in to check your private messages
Post new topic   Reply to topic    Forum Index - Development
View previous topic - View next topic  
Author Message
Dave
Guest

Rene's YM2612
Post Posted:  Mon May 24, 2004 11:50 pm Reply with quote


Just been reading that you have a real YM2612 hooked up!!!

I'm working on a very prelim YM2612 emu, and it might be cool to get some WAV's of the real thing at some point (ideally in a few months when i've got my head round the easy stuff, but whenever!)

Maybe it could somehow be hooked up to the VGM/GYM winamp plugin? That way we could make some single channel GYMs, and get isolated samples of what they are meant to sound like, figure out LFO and feedback and stuff.

As I say, not there yet, only got it playing a beep in response to key on/key off (makes the MD sound like the SMS!) :)
Back to top

Rene Dare

Joined: 28 Mar 2002
Posts: 164
Location: Sao Paulo, Brazil
Re: Rene's YM2612
Post Posted:  Wed May 26, 2004 12:19 am Reply with quote

Very cool!

Let me know what do you need and i can run tests for you, also record WAV/MP3 files. O just need to find a 7.67MHz crystal to use, because the 7.37MHz that i'm currently using is not nice.

I modified Gens for that purpose, so i can also mask some channels if you want.
Back to top

View user's profile Send private message Visit poster's website
dave
Guest

Re: Rene's YM2612
Post Posted:  Wed May 26, 2004 10:35 pm Reply with quote

Quote:
> Very cool!

> Let me know what do you need and i can run tests for you, also record WAV/MP3 files. O just need to find a 7.67MHz crystal to use, because the 7.37MHz that i'm currently using is not nice.

> I modified Gens for that purpose, so i can also mask some channels if you want.

Since I've only started I have nothing specific at the moment, however one thing which is quite important in general is Thunderforce 4, Stage 8. (Sound test = ABC+Start) The reason why is I think that electric guitar sounds much better on the real thing, though Steve Snake's YM2612 on Hi-Quality sounds very very good.

If you could isolate one of the channel with the electric guitar and record it in Wav, that would be VERY useful.


And if you like, just a recording of a track from Sonic 1 (e.g. the title music), with an isolated version of one of the YM2612 channels (for say the main part of the tune).

All this would be useful for confirming general timing stuff and possibly getting some nice output filter ideas!

So does the 7.37mhz crystal means the pitch is lower than normal then? :)
Back to top

Maxim
Site Admin

Joined: 19 Oct 1999
Posts: 6438
Location: London, UK
Re: Rene's YM2612 (OT really)
Post Posted:  Thu May 27, 2004 12:32 pm Reply with quote

Quote:
> Since I've only started I have nothing specific at the moment, however one thing which is quite important in general is Thunderforce 4, Stage 8. (Sound test = ABC+Start) The reason why is I think that electric guitar sounds much better on the real thing, though Steve Snake's YM2612 on Hi-Quality sounds very very good.

> If you could isolate one of the channel with the electric guitar and record it in Wav, that would be VERY useful.

In my brief experience of working with the YM2612, I've come to the conclusion that the problems with sound in emulators are often due to extremely small timing inaccuracies with the writes to the chip. Since Gens queues YM2612 writes for each scanline and then writes them in a block at the end, it is messing with the timing quite a lot. Even rendering at 44100Hz is rendering one sample for every 174 or so clock cycles (I'm pretty sure it divides this internally anyway, but it's still not accurate). A modified build of Gens is still going to have timing errors, and I'd expect it to produce "bad" guitars as a result. A modified VGM plugin using a VGM logged from Kega might be closer, but only sample accurate.

I'm pretty sure Steve's Hi Quality involves sample-accurate writes, but ultimately you have to emulate the chip at its real running frequency (some integer fraction of 7.67MHz) and resample to the soundcard's output frequency, plus have a very timing-accurate CPU emulator, to solve all this.

Maxim
Back to top

View user's profile Send private message Visit poster's website
Dave
Guest

Re: Rene's YM2612 (OT really)
Post Posted:  Thu May 27, 2004 8:14 pm Reply with quote

Quote:
> > Since I've only started I have nothing specific at the moment, however one thing which is quite important in general is Thunderforce 4, Stage 8. (Sound test = ABC+Start) The reason why is I think that electric guitar sounds much better on the real thing, though Steve Snake's YM2612 on Hi-Quality sounds very very good.

> > If you could isolate one of the channel with the electric guitar and record it in Wav, that would be VERY useful.

> In my brief experience of working with the YM2612, I've come to the conclusion that the problems with sound in emulators are often due to extremely small timing inaccuracies with the writes to the chip. Since Gens queues YM2612 writes for each scanline and then writes them in a block at the end, it is messing with the timing quite a lot. Even rendering at 44100Hz is rendering one sample for every 174 or so clock cycles (I'm pretty sure it divides this internally anyway, but it's still not accurate). A modified build of Gens is still going to have timing errors, and I'd expect it to produce "bad" guitars as a result. A modified VGM plugin using a VGM logged from Kega might be closer, but only sample accurate.

> I'm pretty sure Steve's Hi Quality involves sample-accurate writes, but ultimately you have to emulate the chip at its real running frequency (some integer fraction of 7.67MHz) and resample to the soundcard's output frequency, plus have a very timing-accurate CPU emulator, to solve all this.



Maxim - I don't think it's that - I think it's down to the interaction between the four operators or the feedback being on a smaller scale than 44100hz.

Well, we disagree, but there's an easy way to check - try Gens+real YM2612 it and see if the TF4 Electric Guitars sound like a real Megadrive :)



Quote:
> Maxim
Back to top

Rene Dare

Joined: 28 Mar 2002
Posts: 164
Location: Sao Paulo, Brazil
Re: Rene's YM2612 (OT really)
Post Posted:  Fri May 28, 2004 2:05 am Reply with quote

I will do it and then we can compare the results.

I agree with Maxim when talking about DAC writes.
My modified version of Gens writes all data to the port when the emulator writes the "emulated" YM2612. I don't know if i'm mistaken, but, as far as i've seen it's code, it appears that both CPUs writes their data directly to the YM2612 registers.
Maybe the sound ouput of the emulated version is queued or timed in a different way, so we are getting these differencies.
Back to top

View user's profile Send private message Visit poster's website
Rene Dare

Joined: 28 Mar 2002
Posts: 164
Location: Sao Paulo, Brazil
Re: Rene's YM2612
Post Posted:  Fri May 28, 2004 2:08 am Reply with quote

Quote:
> And if you like, just a recording of a track from Sonic 1
> (e.g. the title music), with an isolated version of one of
> the YM2612 channels (for say the main part of the tune).

OK. I will record both songs.

Quote:
> All this would be useful for confirming general timing stuff
> and possibly getting some nice output filter ideas!

Yeah! I need to find one YM2413 unit to test it and see if the
EMU2413 is accurate. According to Maxim, it's not. :-)

Quote:
> So does the 7.37mhz crystal means the pitch is lower than
> normal then? :)

Yes. That's a problem. I will get one 7.67 crystal soon. :-)
Back to top

View user's profile Send private message Visit poster's website
Maxim
Site Admin

Joined: 19 Oct 1999
Posts: 6438
Location: London, UK
Re: Rene's YM2612 (OT really)
Post Posted:  Fri May 28, 2004 7:43 am Reply with quote

Quote:
> My modified version of Gens writes all data to the port when the emulator writes the "emulated" YM2612. I don't know if i'm mistaken, but, as far as i've seen it's code, it appears that both CPUs writes their data directly to the YM2612 registers.
> Maybe the sound ouput of the emulated version is queued or timed in a different way, so we are getting these differencies.

OK... Gens' YM2612 emulator, like most, has a function for writing to the emulated chip (YM2612_Write()) and a function for rendering audio (YM2612_Update()). The writes happen as and when they occur in the emulation, and then a scanline-length section of audio is rendered. Your chip writes are done when the emulated chip is written to, so they will have some temporal spacing.

However, you have to consider that it's highly unlikely that the CPU emulator is running at equal levels over the scanline length, it is far more likely that the CPU emulation runs for as long as it takes for one scanline, then the audio is generated and the video is also rendered. Once per frame the video is blitted to the screen buffer. Therefore you're still going to get the YM2612 writes bunched up at particular points in the scanline and frame time intervals.

Still, it's interesting to have a chip ready for debugging; just don't expect it to be able to reproduce highly timing-sensitive behaviour.

Maxim
Back to top

View user's profile Send private message Visit poster's website
Dave
Guest

I didn't mean DAC writes! :-)
Post Posted:  Fri May 28, 2004 8:42 am Reply with quote

Quote:
> I will do it and then we can compare the results.

> I agree with Maxim when talking about DAC writes.

Oh god no, I wasn't referring to DAC writes... obviously those will be broken :)

The reason why is that Gens, or any emulator (unless it was written in a very strange way!) wouldn't work with DAC hooked up to a real chip is you have to timeslice each frame. So out of your 16.6ms time to render a frame, say 8ms will be cpu emulation, 8ms will be blitting the graphics to the screen. So you'd get the DAC writes in little 8ms bursts. It would sound, well, strange!

DAC, I believe, is no mystery - I understand how that works. It's just, well, sample data.

It's the instruments themselves, like the guitar in TF4, which I'm interested in, I believe it is the minute interactions of the operators which changes the type of sound, and the exact time which they are programmed does not make a difference.


Quote:
> My modified version of Gens writes all data to the port when the emulator writes the "emulated" YM2612. I don't know if i'm mistaken, but, as far as i've seen it's code, it appears that both CPUs writes their data directly to the YM2612 registers.
> Maybe the sound ouput of the emulated version is queued or timed in a different way, so we are getting these differencies.
Back to top

Display posts from previous:    View previous topic - View next topic  
Post new topic   Reply to topic    Forum Index - Development All times are GMT
Page 1 of 1

 

Script phpBB © 2001, 2005 phpBB Group



Back to the top of this page
Back to SMS Power!