Page 17 of 20

Posted: Sun Aug 26, 2007 8:39 am
by Eke
Shiru, as you seem to know YMxxx chips pretty well, do you know if CH3 special mode (where each four operator can have a separate frequencie), also apply to CH6 (DAC disabled) when setting bit6 in register 27h ?

Sega's devellopper manual tell so and this seems logic as "Part II" is only a duplication of 30H - B4H, where channels 1-3 are replaced by 4-6 but emulators out there only seem to support this feature for Ch3 :?:

Posted: Sun Aug 26, 2007 9:04 am
by Shiru
Eke wrote:Shiru, as you seem to know YMxxx chips pretty well, do you know if CH3 special mode (where each four operator can have a separate frequencie), also apply to CH6 (DAC disabled) when setting bit6 in register 27h ?

Sega's devellopper manual tell so and this seems logic as "Part II" is only a duplication of 30H - B4H, where channels 1-3 are replaced by 4-6 but emulators out there only seem to support this feature for Ch3 :?:
I don't know, but if somebody with real hardware can help (run 1-2 test programs), it's easy to test.

However, I think, Ch6 has special mode too. We already know that MAME emulation of OPN chips is not perfect.

Posted: Sun Aug 26, 2007 10:43 am
by Eke
Yes, even if this seem correct enough for most games. But there are also some game musics that sound completely wrong, something like high-frequency blip sounds covering the original music. Try for example Flashback bgm3 in sound test, actually only Kega with HQ mode activated could handle this correctly... even Gens with FM Interpolation ON sound weird on this one.

Do you know what might cause such harsh blips ? bad frequency calculations, unacurrate sampling ... ?


I also wonder about bit7 in the same register (27h), undocumented in sega's doc but refered as CSM Key control in MAME. This switch all operators in Channel 3 to Key OFF when TimerA expires (i wonder why) but this behaviour is documented as being "wrong at the moment" in the sourcecode.

Posted: Sun Aug 26, 2007 11:45 am
by Shiru
Eke wrote:Try for example Flashback bgm3 in sound test, actually only Kega with HQ mode activated could handle this correctly... even Gens with FM Interpolation ON sound weird on this one.

Do you know what might cause such harsh blips ? bad frequency calculations, unacurrate sampling ... ?
I don't know exactly. Something strange, seems this instrument does not use anything special, just usual melodic instrument. So possibly it because unaccuracy sampling, and combination of parameters of this instrument with given frequency can produce such distorted sound.

Interesting thing, according to GensKMod, Flashback sometimes uses separate keyons for operators.
Eke wrote:I also wonder about bit7 in the same register (27h), undocumented in sega's doc but refered as CSM Key control in MAME. This switch all operators in Channel 3 to Key OFF when TimerA expires (i wonder why) but this behaviour is documented as being "wrong at the moment" in the sourcecode.
I think, that is because lack of real documentation, and coders assume that all chips in OPNx family has mostly same features. 'CSM' feature is present in YM2151, but as far as I know, it must key ON for all operators by timer A overflow. There is also some mess with name of feature, on YM3812 (OPL2) soundchip CSM is a something like 'Composite Sinusoidal Modeling' or 'Composite Sine-wave Speech Synthesis Mode' (enabled by bit 7 in register 08h).

Posted: Sun Aug 26, 2007 12:01 pm
by Stef
Shiru wrote:
Eke wrote:Try for example Flashback bgm3 in sound test, actually only Kega with HQ mode activated could handle this correctly... even Gens with FM Interpolation ON sound weird on this one.

Do you know what might cause such harsh blips ? bad frequency calculations, unacurrate sampling ... ?
I don't know exactly. Something strange, seems this instrument does not use anything special, just usual melodic instrument. So possibly it because unaccuracy sampling, and combination of parameters of this instrument with given frequency can produce such distorted sound.

Interesting thing, according to GensKMod, Flashback sometimes uses separate keyons for operators.
I searched a long time to understand what was wrong with my YM2612 core about this instrument. I tested it with Shaq Fu as this game uses in intensively. I still don't know how to fix the problem but i'm pretty sure it's a sort of "bug" from the real YM2612 with certains settings...

Posted: Tue Aug 28, 2007 1:57 pm
by Eke
Stef wrote:I still don't know how to fix the problem but i'm pretty sure it's a sort of "bug" from the real YM2612 with certains settings...
well, I owned Flashback when I had my MegaDrive and the incriminated soundtrack (BGM3 in soundtest) never sounded like that. :wink:

The fact is that if listening this track in Kega, turning "YM2612 HQ" option ON definitively makes all these noisy "blips" disappear, where as they are still present when this option is disactivated.

I don't know what "YM2612 HQ" does exactly but it maybe something similar to what you did in Gens (emulating the soundchip at the original rate, i.e VCLK/144, approx. 53270Hz) except that it also applies some kind of additional resampling (using appropriate FIR interpolation + decimation filters) to output at the given soundrate (44100 hz) ?

Posted: Tue Aug 28, 2007 4:32 pm
by Stef
Eke wrote:
Stef wrote:I still don't know how to fix the problem but i'm pretty sure it's a sort of "bug" from the real YM2612 with certains settings...
well, I owned Flashback when I had my MegaDrive and the incriminated soundtrack (BGM3 in soundtest) never sounded like that. :wink:

The fact is that if listening this track in Kega, turning "YM2612 HQ" option ON definitively makes all these noisy "blips" disappear, where as they are still present when this option is disactivated.

I don't know what "YM2612 HQ" does exactly but it maybe something similar to what you did in Gens (emulating the soundchip at the original rate, i.e VCLK/144, approx. 53270Hz) except that it also applies some kind of additional resampling (using appropriate FIR interpolation + decimation filters) to output at the given soundrate (44100 hz) ?
Yes, HQ does calculation at the YM2612 rate then extrapolate to the output rate (44100 Hz).
But there is something more needed to reproduce correctly this sound...

Posted: Tue Oct 09, 2007 4:44 pm
by Eke
I recently made some testing about this YM2612 "bug" and discovered the following (I'm probably not the first one discovering this but I hope we could finally managed to understand how the "bug" really work):

1/ every game producing this noisy sound on emulators seem to use the same sound engine: GEMS . I suppose they all use the same preprogrammed instrument (don't found anything in GEMS documenation about these). So, this instrument probably use some kind of particular configuration which make use of a bug in real YM2612 to sound correctly on real hardware only.

2/ to my surprise, on real Hardware (megadrive 2 PAL), the same "blip" sound is present, the only difference being it is a lot more attenuated, compared with emulators. I tested both Shaq Fu (quite every music use this instrument) and Flashback (BGM #3 in sound test) and could hear it if I set the TV volume high enough.

This makes me think that the "bug" has something to do with TL values not being handled properly in certain condition (emulators handle this as the chip should normally do, which make this "blip" sounds a lot too loud)

I wonder what else could affect the output amplitude ? according to GensKMod, LFO AM seems not to be activated .

3/ then , I tested the Flashback VGM's track with in_vgm plugin to isolate the incriminated channel (hehe, that could be a nice addition to GensKMod) and found that the noisy blip sound was comming from Channel 3.

4/ Finally I run the above games under KgensMod and Genesis Plus, looking into Channel 3 configuration for some similarities when hearing the infamous "blip sound". Here are the most noticable coincidences between games:

- there are no LFO effects used (AMS nor FMS)
- Channel 3 is always configured to "special" mode
- Channel 3 algorithm is always algorithm #4 (feedback value = 4)
- Channel 3 operator 2 (which is used as output in this algorithm) has TL value always set to 0, which is the max amplitude.

I also noticed that the soundtracks that don't produce this bad sound never use a "zero" value in the operator 2 TL register so maybe the bug has something to do when using this value in this special channel ?

Posted: Wed Oct 10, 2007 5:21 am
by TmEE co.(TM)
My MD2 doesn't do this "blip" sound...

Posted: Wed Oct 10, 2007 8:08 am
by Eke
TmEE co.(TM) wrote:My MD2 doesn't do this "blip" sound...
as I said, it's only present in some specific games and at a very low level, making it sound a lot more "normal"
To hear it on real hardware, I guess you will need to set the volume high enough and to know exactly what you are looking for since it's covered by the other channels a lot
maybe I was so used to hear it on emulators that I immediately recognized it :wink:

Posted: Wed Oct 10, 2007 8:32 am
by TmEE co.(TM)
You know, I listen music so that ground shakes (I have VERY powerful HiFi in my home 8) ), and that applies to games aswell... I'll do a recording for some deeper examination...

Posted: Wed Oct 10, 2007 8:54 pm
by Stef
Eke wrote:I recently made some testing about this YM2612 "bug" and discovered the following (I'm probably not the first one discovering this but I hope we could finally managed to understand how the "bug" really work):

1/ every game producing this noisy sound on emulators seem to use the same sound engine: GEMS . I suppose they all use the same preprogrammed instrument (don't found anything in GEMS documenation about these). So, this instrument probably use some kind of particular configuration which make use of a bug in real YM2612 to sound correctly on real hardware only.

2/ to my surprise, on real Hardware (megadrive 2 PAL), the same "blip" sound is present, the only difference being it is a lot more attenuated, compared with emulators. I tested both Shaq Fu (quite every music use this instrument) and Flashback (BGM #3 in sound test) and could hear it if I set the TV volume high enough.

This makes me think that the "bug" has something to do with TL values not being handled properly in certain condition (emulators handle this as the chip should normally do, which make this "blip" sounds a lot too loud)

I wonder what else could affect the output amplitude ? according to GensKMod, LFO AM seems not to be activated .

3/ then , I tested the Flashback VGM's track with in_vgm plugin to isolate the incriminated channel (hehe, that could be a nice addition to GensKMod) and found that the noisy blip sound was comming from Channel 3.

4/ Finally I run the above games under KgensMod and Genesis Plus, looking into Channel 3 configuration for some similarities when hearing the infamous "blip sound". Here are the most noticable coincidences between games:

- there are no LFO effects used (AMS nor FMS)
- Channel 3 is always configured to "special" mode
- Channel 3 algorithm is always algorithm #4 (feedback value = 4)
- Channel 3 operator 2 (which is used as output in this algorithm) has TL value always set to 0, which is the max amplitude.

I also noticed that the soundtracks that don't produce this bad sound never use a "zero" value in the operator 2 TL register so maybe the bug has something to do when using this value in this special channel ?
I already did these examinations except about the TL 0 level.
I'm almost sure it's a bug or a strange pupose of the channel 3's special mode... maybe TL stuff, maybe not :-/

Posted: Thu Oct 11, 2007 8:09 am
by Eke
It's too bad Steve Snake never shared with you his finding about this one :?
He probably made thousand of test program to finally get it

Posted: Sun Oct 14, 2007 11:10 am
by TmEE co.(TM)
http://www.hot.ee/tmeeco3/FLASHBCK.OGG

Recording of FlashBack BGM3 that does this blip sound... recorded from my MD2 with Crystal Clear Audio Mod.

Posted: Sun Oct 14, 2007 12:06 pm
by Eke
it is very difficult to hear it but the blip sound (it's more something like cymbals, tingtingtingtingting, very fast) is there, in background (which means, very very low)

try the same bgm in an emulator (not kega off course) to get an idea about this sound then listen to your OGG again, it's mostly noticeable (but still hardly hearable) at the beginning, during the short periods where the main melody is lowered in loop... setting the volume at a very high level might help too


I'm convinced that this is a bug with the output amplitude on this particular channel with this particular configuration

here is a snapshot of the configuration used in Flashback BGM3: the only parameters that change in between games producing this sound (I checked Ariel, Shaq Fu, Berenstain's Bear, Spiderman Animated Series) are the TL values of operators 3 & 4 and the eventual use of timers or LFO.

Otherwise, all other settings are the same, especialy the '0' value for operator 2's TL, first and second decay.

Image