Closed vampirefrog closed 5 years ago
In fact in MAME it has been removed already https://github.com/mamedev/mame/blob/master/src/devices/sound/ym2151.cpp
We added that intentionally due to a song in X68K Space Harrier which had supposedly intentional clipping.
On Sun, Nov 19, 2017 at 10:51 PM, vampirefrog notifications@github.com wrote:
In fact in MAME it has been removed already https://github.com/mamedev/ mame/blob/master/src/devices/sound/ym2151.cpp
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vgmrips/vgmplay/issues/32#issuecomment-345552822, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGw8UScgEbeMxVVyq4dZRyuHeBTmPi9ks5s4KL7gaJpZM4QjjZ5 .
oh and don't forget to use MAXOUT and MINOUT either in the chip or in the mixing code. perhaps use soft clipping. For particular games that need clipping, perhaps add a VGM param that would emulate the opamp saturation.
Someone on IRC confirmed that the YM2151 doesn't clip a while ago.
Per-channel clipping was an addition made by me based on the wrong assumption that the YM2151 clips like the YM2612 does.
I forgot to fix the bug for v0.40.9, but it is fixed in libvgm (by not clipping at all anywhere), so I'll consider this issue solved.
Hello. When using the following voice with the ym2151 core:
which is the loudest sine wave I could get, you get clipping. Try values 1,3,7 and 15 for OP (operator mask). This is due to the code:
in chips/ym2151.c:1755 and chips/ym2151.c:1821
If you compare to XM6 Pro-68k, this clipping does not occur. I don't think it happens on the real OPM either.
Changing FINAL_SH doesn't help either, it just makes the signal smaller but still clipped.
Please either remove the clipping check or define it as MINOUT and MAXOUT. Either way, define it as a macro instead of raw numbers.
Thanks!