Closed Gadgetoid closed 4 years ago
Does looks a bit off:
(That's max volume)
Edit: Also, should it be using blit::random
instead of rand
?
Ooof! Yeah- that’s a bit off all right! Pretty much consistent with my findings.
I wonder if it should use a LFSR with a configurable seed/taps rather than rand or blit:random. Both for consistency across platforms and - although I can’t remember the cycle timings for the HRNG - performance.
The noise value is re-calculated every time the waveform counter overflows to 65536.
This value should be the Be All And End All of noise, but it seems to be mangled later when it's used by the waveform generator:
https://github.com/pimoroni/32blit-beta/blob/3ddddb3e7c319ac332ebd41e1867378640e669a7/32blit/audio/audio.cpp#L80-L84
A quick tinker in Python (bear in mind I'm tired and my brain is addled so I could be spouting nonsense) suggests the output range is
-5632
to-10751
:Am I wrong?