segfault16 / modular-led-controller-workstation

:musical_note: :rainbow: Real-time LED strip music visualization using Python and the ESP8266 or Raspberry Pi
MIT License
23 stars 9 forks source link

Beat Detection #57

Open fruechtegott opened 5 years ago

fruechtegott commented 5 years ago

We definitely need some kind of beat detection. http://www.flipcode.com/misc/BeatDetectionAlgorithms.pdf

Maybe https://github.com/aubio/aubio is usable?

fruechtegott commented 4 years ago

https://www.analyticsvidhya.com/blog/2018/02/audio-beat-tracking-for-music-information-retrieval/ This looks nice and works very well on wav-files:

import librosa
import IPython.display as ipd

x, sr = librosa.load('/path/to/file.wav')
ipd.Audio(x, rate=sr) # playable in jupyter notebook

tempo, beat_times = librosa.beat.beat_track(x, sr=sr, start_bpm=120, units='time')
clicks = librosa.clicks(beat_times, sr=sr, length=len(x))

ipd.Audio(x + clicks, rate=sr) # play again with clicks

For real time analysis: https://github.com/librosa/librosa/issues/220 Can this be implemented?