Reimplemented audio data processing to closely match Milkdrop's algorithms and resulting sample/spectrum values.
proejctM's previous implementation was very simplistic, and thus resulted in sample/beat detection values which weren't even close to what Milkdrop passes to presets. This PR changes/fixes the following audio-related issues:
Waveform scaling is now using the same value range as Milkdrop, which is a floating-point representation of an 8-bit signed sample format. Milkdrop only gets 8-bit samples from Winamp, so the values are always whole numbers. projectM can also process floating-point samples. These are scaled to the same range (-128.0 to +127.0), but also have their decimals preserved. Waveform data scaling in the custom/default wave drawing code has been restored to Milkdrop's values.
The spectrum analyzer is now a (modernized) copy of Milkdrop's FFT class. It also smoothes and equalized the spectrum a bit to remove noise. Now spectrum-based custom waveforms draw properly.
The bass/mid/treb and attenuated beat-detection values are now calculated as relative values to the previous frame(s), as in Milkdrop. They're no longer absolute sums of the spectrum, but a difference value revolving around 1.0.
Waveforms are now best-match aligned to the previous frame, resulting in a more stable, less jaggy waveform rendering as the wave doesn't jump randomly around as much as before.
Reimplemented audio data processing to closely match Milkdrop's algorithms and resulting sample/spectrum values.
proejctM's previous implementation was very simplistic, and thus resulted in sample/beat detection values which weren't even close to what Milkdrop passes to presets. This PR changes/fixes the following audio-related issues:
FFT
class. It also smoothes and equalized the spectrum a bit to remove noise. Now spectrum-based custom waveforms draw properly.Fixes issue #708.