-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beat Detection Tweak #9
base: main
Are you sure you want to change the base?
Conversation
I fixed the beat detection from hearing the treble (high frequencies) to bass, mid and treb variables. Now I made the perfect and accurate beat detection for any music you want. Check [this video demo](https://twitter.com/OctobellaMilkD/status/1625587045174476800?s=20) how I fixed the beat detection. Plus, this can be reacted on both channels (mono), like projectM.
MilkDrop has been like this for the past 20 years, and changing the beat detection will make many presets react differently than intended. |
With the first minute of that song for example : https://www.youtube.com/watch?v=s_nc1IVoMxc |
If you prefer the old beat detection, i don't like it :( If you hear some low frequencies, then boom, the red dot goes up! Why don't you see the 20hz-20000hz frequency test with the new beat detection to show how it works? First, you should try to listen the music or tests with headphones or speakers with bass (or subwoofers). EDIT: Well, I can record more if I have time. Note that all the beat detections are auto-gained. If you hear some quiet songs, it can react the same level (aprox. to 1). |
I think with any change, beat detection or otherwise, backwards compatibility is a big concern. There aren't many people actively authoring new presets, so we are essentially just stuck with the old ones. |
You see a little white dot that reacts in a different beat detections using my improved one. DotinDifferentBeatDetectionsExpl.MP4I created the q1 variable in per-frame code and added the changeable beat detection mode with smoothing, such as bass_att, mid_att and treb_att. I recommend you to use headphones or subwoofers (or speakers with bass) before trying that. In conclusion, my improved beat detection that I implemented gone too accurate than before. The old one reacts only high frequencies to bass, mid and treb values. Song: Deeplowdog feat. Ryan Konline - Been a While (Deepjack Remix) Also, sorry for the notification sound in the end. |
First, thank you Milkdrop2077, for your work : I was looking for a easy to use, nice looking visualizer for my music, and it seems you've made the perfect combination :) I'm not sure however the beat detection is worrking : would it be possible to use it to have it change only at the end of each songs ? And if 'yes', how would I achieve that ? And if 'no', do you think it could be possible / doable ? |
Well, the problem is not on presets using beat detection variables. It's the beat detection itself because it only jumps to the high frequencies reacting to bass, mid and treb variables. That's pretty old and trash. |
What if the new beat detection algorithm was just used for transitioning presets? Or if presets built with the new detection were flagged to use that algorithm, while the rest use the original? I think there's definitely use for better beat detection, though I get the compatibility issue. |
backwards compatibility issue aside, I believe the implementation of this PR is wrong. First, let's understand what we have in fSpecLeft/fSpecRight: First, it says that the range of that FFT is from 0 to 1/4th of the sampling rate. It also says that the frequency linearly increases. With that, 11Khz/576 samples = 19.14Hz each output sample
This turns into samples like this: The old implementation does: The proposed implementation in this PR does: One can argue that the old bass range is too wide, but the proposed bass and mid range is way off and leaves holes between ranges. So, In case anyone pretends to fix this, the fix should obviously be what the FFT algorithm comemnts suggest. Then, it could be a user option to choose between old and new beat detector. Last edit note: One should also be aware that this depends on the sampling rate. So the actual samples limits should be dynamically determined from the input sampling rate |
Just looked at the loopback-capture's supported sample rate and it only supports 44100hz and 48000hz. Did you try to change any sample rate and try it with Milkdrop3 if it works? I recommend to try this tone generator website to test it if it works good or not. I tried this today and the bass actually reacts as a real middle and almost a treble. EDIT: The recommended sample rate of the new beat detection I've made is 44000hz. So I think you should look at fft.cpp and make some changes if you want. |
Thank you @JosepMaJAZ for the technical details! |
I think is easy to just add an option in the configuration to specify which algorithm to use |
I fixed the beat detection from reacting the treble (high frequencies) to bass, mid and treb variables.
Now I made the perfect and accurate beat detection for any music you want.
Check this video demo how I fixed the beat detection.
Plus, this can be reacted on both channels (mono), like projectM.