You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AudiogeneratorMOD: use full 16bit with slightly better accuracy (earlephilhower#479)
* Fix a tricky bug that causes delays in playback
... this bug was already present in stellaplayer. Obviously "effectNumber" must be checked, because "effectParameterX" just holds the "upper nibble" of effectParameter
* fix for issue earlephilhower#474
- do channel mixing in 32bit, to avoid noise from over/underflow
- write audio output as "signed int" (not unsigned)
- add int16 saturation check ("clipping")
* avoid crash when MOD file has to many CHANNELS
- avoid guru meditation, by logging an error and refusing playback in case MOD.numberOfChannels > CHANNELS
- correct small typo
* internal DAC: avoid possible overflow in conversion int16 -> uint16
* update constants
.. we can do 16bit and 8 channels, so let's do it ;-)
This adds some debugging code to better understand what is going on inside the mixer code (AudioGeneratorMOD::GetSample). And it also prints out some usefull information from the MOD file.
Only active when do_MIXER_DEBUG is defined.
* MOD generator: 12 bits of "real" resolution (instead of 10)
With this change, we gain 2 additional bits of "real resolution" from the sample interpolation step.
Still need some testing to be sure that nothing get "lost" at the same time.
* limit to 4 channels on ESP8266
As discussed in earlephilhower#479 (comment)
// Downscale to BITDEPTH - a bit faster because the compiler can replaced division by constants with proper "right shift" + correct handling of sign bit
0 commit comments