It was not really ‘crackling’, which I believe I did hear from the CZ* functions, before I added UPDATE_PHASE_MORE_REGISTERS. It was more like noticeable distortion, which varied in quality when the oscillator parameter was changed.
Hm, it after some testing, it seems I wrongly accused the S16ClipS8 function of not working as intended. But I think it does rely on implementation defined behaviour… Just for a sanity check, could you please check that the firmware I uploaded before sounds fine on the Voxelito patch?
Here are my compilation flags, I have changed them a bit. By the way, I am also using 9.3.0.
/usr/bin/avr-g++ -c -g -O2 -std=c++2a -I. -mmcu=atmega328p -Wall -Wextra -pedantic -Wno-narrowing -Winline -ffreestanding -fno-common -fshort-enums -fno-move-loop-invariants -nostdlib -fverbose-asm -fdata-sections -ffunction-sections -flto -mrelax -mcall-prologues -DF_CPU=20000000 -DDISABLE_DEFAULT_UART_RX_ISR -DDISABLE_WAVETABLE_LFOS -DATMEGA328P -DSERIAL_RX_0 -fno-exceptions -fno-non-call-exceptions -fno-use-cxa-atexit -fno-rtti
Removing the irrelevant flags, we get
/usr/bin/avr-g++ -O2 -std=c++2a -Winline -ffreestanding -fno-common -fshort-enums -fno-move-loop-invariants -nostdlib -fverbose-asm -fdata-sections -ffunction-sections -flto -mrelax -mcall-prologues -fno-exceptions -fno-non-call-exceptions -fno-use-cxa-atexit -fno-rtti
The most significant differences I can see are that i used
-flto which may improve things for you. See if that helps. Otherwise, you are welcome to dig around / ask questions about my (significantly refactored) code to see if anything else works for you.