Skip to content

Experiment to create beat detection algorithm in cables.gl

License

MIT, GPL-3.0 licenses found

Licenses found

MIT
LICENCE
GPL-3.0
LICENSE
Notifications You must be signed in to change notification settings

athrane/beatdetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beatdetection

Experiment to create beat detection algorithm in cables.gl

If you can help to improve the detection algorithms please let me know.

Usage

The patch uses the MicrophoneIn operator to get audio input.

Go to the visualizer page

Open a browser and go to the Patch.

Accept michophone usage

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.

Start the music

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.

Start patch

Press play on the play button to start the patch.

Output

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

Algorithms

Adhoc Algorithm 1

Calculate FFT array

The AudioAnalyser operator produces an FFT array with parameters:

  • Size = 256
  • Smoothing = 0.3

The values in the array are between 0..1.

Get average volume (AV) for select frequencies

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 of average volume

Calculate delta from previous AV.

The value for AV is between 0..1.

Register single beat for sequence positive deltas

If delta is postive...

Inspiration

About

Experiment to create beat detection algorithm in cables.gl

Resources

License

MIT, GPL-3.0 licenses found

Licenses found

MIT
LICENCE
GPL-3.0
LICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages