projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 364 forks source link

Beat detection values (bass, mid, treb + _att variants) are too high. #708

Closed kblaschke closed 7 months ago

kblaschke commented 1 year ago

While working on integrating the new preset parser and rewriting the preset rendering process, I noticed some presets were behaving highly erratic or were completely broken (e.g. "shifter - robotopia"). I've tracked down these issues to the beat values being way too high.

The Milkdrop preset authoring guide isn't very specific about the actual value range (>0), but says that the values are expected to be in the range from 0.7 to 1.3 in general and around 1.0 if the levels don't change much.

Looking at Milkdrop's audio analyzing code, these values aren't absolute sums/averages of the current frequency spectrum intensity, but rather slighly or more smoothed relative values to the intensities of previous frames.

@ErikPrantare - you've refactored the beat detection code a while ago. Would you mind looking into this again and implement it in a more Milkdrop'esque way to keep the value ranges in the expected range?

kblaschke commented 1 year ago

A few other issues showed up during testing: