New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signal Offset in Freeboy causing Clicks and Clipping #6556
Comments
Here's a demonstration project for this bug: https://lmms.io/lsp/?action=show&file=20372 |
The click is because you have channel-3 active without anything drawed in the window. |
|
I already wrote what the original gameboy did. I wasn't completely right, but close enough I think. It seems the gameboy digital to analog converters convert values from 0 to 15 to -1 to 1. This means that a digital signal of 0 produces an analog one of -1. It additionally has a highpass filter (capacitor) to remove DC offset after the initial click. Not sure if all models have this, as it's listed in "obscure behaviour" with mention of the DMG. There's also a line saying "In general, all units in the channels are always running.", implying that channels that aren't in use are still running at volume 0. This means if they do have a DC offset, it doesn't cause clicking on note start/end on the hardware, but when the gameboy is actually turned on or off. Source: https://gbdev.gg8.se/wiki/articles/Gameboy_sound_hardware However, I want to note that LMMS shouldn't go for "true to the original", but for sound output that's intuitive and sounds good. There's trackers for people who want to make music true to the original. Freeboy even has channel polyphony, so it's already not even close to the hardware. |
Bug Summary
A signal offset is causing clicking on note start/end and sometimes even Clipping, when too many notes are playing at once. If you set bass to something greater than 0, the offset gets filtered out after the first few sample, causing the clicks to only appear at note start.
I believe this has to do with how gameboy audio worked - it was strictly subtractive instead of having a signal center. This also causes clicking when turning a gameboy on or off, which is what I assume LMMS is doing every time a note starts and ends. Treble and Bass filtering isn't possible on gameboy hardware, so I assume that's post processing being done by LMMS.
Steps to reproduce
play some notes inside freeboy with all channels disabled
Expected behavior
No sound output
Actual behavior
Clicking on note start, caused by the offset
Woraround
By playing the exact same notes on a second freeboy instance with the same bass setting with all instruments disabled and the signal inverted via the stereo matrix effect, the clicking and offset are mostly cancelled out.
Affected LMMS versions
At least master and 1.2.2
The text was updated successfully, but these errors were encountered: