Page 5 of 58

Posted: Mon Jun 23, 2008 9:59 pm
by notaz
Tried to add handling for this into MAME core. It took a while to figure out that the behavior Nemesis described is not what actually causes the 'blip' sound, the blip comes from operator1, and the described operator2 behavior eliminates the 'blip' :)

For some reason I'm getting the best results when I use fnum=7ff and blk=5 settings as a maximum. I've checked as many games as I could:

Code: Select all

+- Ariel - The Little Mermaid (intro, 1st level)
+- Battletech (music 03, 07, 12)
+- Berenstain Bears', The - Camping Adventure (music 1, 4, ...)
+- Comix Zone (tracks 5, 10)
+- Flashback (bgm3)
+- Shaq Fu (most of the music)
+- Spider-Man - The Animated Series (intro music)
+- Vectorman 2 ("fall dig" track)
They sound fine, but they all seem to use the same settings (blk=4, mul=12, ...), probably because they all use GEMS.

Posted: Tue Jun 24, 2008 10:39 am
by Nemesis
I've confirmed the presence of the CSM mode in the YM2612, and whatsmore, Kega doesn't emulate it. Hooray, I've found something new! :lol:

I've still got more tests to run before I can post a full description of how the CSM mode works, and I'm not going to have time to complete them all tonight, but I'll post the details as soon as I've confirmed the behaviour.

Eke wrote:btw, is this a bug with ch3 only or did you reproduce it on other channels ?
I've now confirmed that the detune overflow bug occurs on all channels.

Posted: Tue Jun 24, 2008 12:45 pm
by Eke
cool, did you found any games using this ?

Btw, you already made a great discovery by explaining the Detune bug, I still can not understand how this could have remained like a dirty secret so long :roll:

sharing informations is the way to move on, especially when some people don't have a way or enough knowledge to make test on real hardware themselves... thanks a lot Nemesis

Posted: Tue Jun 24, 2008 1:14 pm
by Nemesis
I haven't looked for games that use this feature, I've just been experimenting with my own code. If anybody wants to hunt for games which might make use of it, CSM mode is active when the channel 3 mode bits are set to "10", or in other words, when register $27 is set to 10******. CSM mode is not active when the upper bits are set to 11.

Posted: Tue Jun 24, 2008 8:44 pm
by notaz
Looking forward to "Undocumented YM2612 features" doc :)

Posted: Thu Jun 26, 2008 1:30 pm
by Eke
Stef wrote:Yep, that should do it in theory.
As you said the YM2612 is probably using internally a non signed fixed size register and in some case it underflows. Your fix should emulate it correctly =)
well, it doesn't :(
I'm probably missing something with this phase increment stuff (this is definitely one of the thing I'm still not sure to understand in the emulator code)

notaz: what did you do exactly to fix the MAME core ?

Posted: Thu Jun 26, 2008 2:03 pm
by TmEE co.(TM)
What is this CSM mode ?

Posted: Thu Jun 26, 2008 2:48 pm
by Nemesis
Eke wrote:
Stef wrote:Yep, that should do it in theory.
As you said the YM2612 is probably using internally a non signed fixed size register and in some case it underflows. Your fix should emulate it correctly =)
well, it doesn't :(
I'm probably missing something with this phase increment stuff (this is definitely one of the thing I'm still not sure to understand in the emulator code)
I added the following lines to CALC_FINC_SL in Gens to approximate the effect when I was doing testing:
if(SL->Finc < 0)
{
finc = FINC_TAB[0x7FF] >> (7 - 0x7);
SL->Finc = (finc + SL->DT[kc]) * SL->MUL;
}
Based on what notaz said, you might find the result sounds closer if you set block to 5 instead of 7.
TmEE co.(TM) wrote:What is this CSM mode ?
CSM mode is another special mode for channel 3, where Timer A automatically does key on/off for the channel.

Posted: Thu Jun 26, 2008 5:59 pm
by TmEE co.(TM)
I can't make use of CSM mode in my sound engine then... Timer A is used for SFX, Timer B for BGM, VBLs are not touched.

Posted: Thu Jun 26, 2008 6:01 pm
by Chilly Willy
TmEE co.(TM) wrote:What is this CSM mode ?
It's a mode meant for formant speech synthesis. One of the better methods of synthesizing speech is to break it into the addition of resonant frequencies that last a specific time. These are called formants and if you add the correct ones, you get a phoneme. You might want to check the proper wiki pages for more info.

http://en.wikipedia.org/wiki/Speech_syn ... _synthesis
http://en.wikipedia.org/wiki/Formant

Posted: Thu Jun 26, 2008 6:22 pm
by TmEE co.(TM)
For speech synthesis I use samples... 50K of samples are enough for well understandable text :) only limitation of my synth : you need to be Estonian to make it talk (all languages that have "say what you read" and no pronounciation stuff will do. in Estonian "a" is spelled exactly the same in any word you encounter not like in English where the pronounciation depends on word).

Posted: Thu Jun 26, 2008 6:55 pm
by TulioAdriano
It would work well for Portuguese, though, and most romance languages, except for French which has lots of irregularities... interesting, very nice.

Btw, I haven't seen any concrete report on the famous channel 3 special mode which would allow individual operators to be set on different frequencies.

As far as I know most tests on that feature failed to succeed, maybe wrong documentation again?

Posted: Thu Jun 26, 2008 7:00 pm
by notaz
Eke wrote:what did you do exactly to fix the MAME core ?
I changed the start of refresh_fc_eg_slot() to this:

Code: Select all

INLINE void refresh_fc_eg_slot(FM_SLOT *SLOT, int fc, int kc)
{
        int ksr, fdt;

        /* (frequency) phase increment counter */
        fdt = fc+SLOT->DT[kc];
        /* detect overflow */
        if (fdt < 0) fdt += fn_table[0x7ff*2] >> 2;
        SLOT->Incr = fdt*SLOT->mul >> 1;

...
Note that this only works when sampling @ 44.1hHz, so it's probably wrong. Multiplier may have something to do with all this too.

Posted: Thu Jun 26, 2008 7:08 pm
by Shiru
TulioAdriano wrote:Btw, I haven't seen any concrete report on the famous channel 3 special mode which would allow individual operators to be set on different frequencies.

As far as I know most tests on that feature failed to succeed, maybe wrong documentation again?
What you mean 'failed'? This mode works well both in emulators and on real hardware, some games use it. I even added basic support for this mode in TFM MM long ago.

Posted: Thu Jun 26, 2008 8:11 pm
by Mask of Destiny
Shiru wrote:
TulioAdriano wrote:Btw, I haven't seen any concrete report on the famous channel 3 special mode which would allow individual operators to be set on different frequencies.

As far as I know most tests on that feature failed to succeed, maybe wrong documentation again?
What you mean 'failed'? This mode works well both in emulators and on real hardware, some games use it. I even added basic support for this mode in TFM MM long ago.
My guess is he's thinking of the tests as to whether or not Channel 3 special mode also worked on Channel 6.