Experiment to create beat detection algorithm in cables.gl
If you can help to improve the detection algorithms please let me know.
The patch uses the MicrophoneIn operator to get audio input.
Open a browser and go to the Patch.
Accept that the browser want to use the microphone, e.g. click on "Allow". The visualizer will render stuff based on the sound from the computer microhone.
So start to play some music on your computer, e.g. open a browser and start playing the SHS31 mix from YouTube or SoundCloud: SHS31.
Press play on the play button to start the patch.
The patch renders a graph and three circles:
- The graph is the FFT audio analyzer array
- The gray circle is the audio analyzer avg. volume
- The green circle is beat detection algorithm #1
- The blue circle is beat detection algorithm #2
The AudioAnalyser operator produces an FFT array with parameters:
- Size = 256
- Smoothing = 0.3
The values in the array are between 0..1.
The average volume (AV) is calulated using the FFTAreaAverage operator.
Drums and beats then to have a low frequency. So the average volume is calculated from "the upper left" corner of the FFT array using these parameters:
- X pos = 0
- Y pos = 0
- Width = 0.2
- Height = 0.7
The value for AV is between 0..1.
Calculate delta from previous AV.
The value for AV is between 0..1.
If delta is postive...