nukeykt / Nuked-OPN2

Cycle-accurate Yamaha YM3438(YM2612) emulator
GNU Lesser General Public License v2.1
214 stars 15 forks source link

G# of any octave gives weird playback when FM modulation is more than 1 #6

Closed Wohlstand closed 6 years ago

Wohlstand commented 6 years ago

While I experimenting with a bank editor to implement switchable emulators, I found a weird thing with playback. Reproduce of this is shown on this video: https://youtu.be/a48FXMY1ZNM Is it's a bug of emulator or it's a normal behavior of real chip?

A bit later I'll post my stuff into OPN2 Bank Editor repo where everything will be.

nukeykt commented 6 years ago

Can you write exact F-number and block values here?

Wohlstand commented 6 years ago

Wait a sec, I'll put the dumper to capture entire stuff passing to the chip...

Wohlstand commented 6 years ago

Port: Address => value

"0: 0x30 => 0x31"
"0: 0x40 => 0x1d"
"0: 0x50 => 0xce"
"0: 0x60 => 0x0b"
"0: 0x70 => 0x00"
"0: 0x80 => 0x04"
"0: 0x90 => 0x00"
"0: 0x34 => 0x01"
"0: 0x44 => 0x1c"
"0: 0x54 => 0x8e"
"0: 0x64 => 0x8a"
"0: 0x74 => 0x00"
"0: 0x84 => 0x15"
"0: 0x94 => 0x00"
"0: 0x38 => 0x05"
"0: 0x48 => 0x06"
"0: 0x58 => 0x0e"
"0: 0x68 => 0x8a"
"0: 0x78 => 0x00"
"0: 0x88 => 0x28"
"0: 0x98 => 0x00"
"0: 0x3c => 0x01"
"0: 0x4c => 0x00"
"0: 0x5c => 0x0f"
"0: 0x6c => 0x0a"
"0: 0x7c => 0x00"
"0: 0x8c => 0x18"
"0: 0x9c => 0x00"
"0: 0xb0 => 0x3c"
"0: 0xb4 => 0xd3"
"0: 0xb4 => 0xd3"
"0: 0x40 => 0x1d"
"0: 0x44 => 0x1c"
"0: 0x48 => 0x06"
"0: 0x4c => 0x00"
"0: 0xa4 => 0x1f"
"0: 0xa0 => 0xfc"
"0: 0x28 => 0xf0" //Note On
nukeykt commented 6 years ago

Ok. Thanks!

nukeykt commented 6 years ago

I think this is normal behavior of the chip(by looking ym3438 die shot and improved MAME core sources from Genesis Plus GX). Your F-Number value is too high and after applying LFO PM it just overflows. To workaround this bug you should half your F-Number and increase block.

Wohlstand commented 6 years ago

Okay, that crap has finally gone when I changed my formula to reduce F-Number and use higher block! :+1: Only left it on highest octaves where block has it's maximal value and F-Number is using to reach the maximum possible "height", which would be kept as-is.