Skip to content
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

Determining first beat in a measure #253

Open
KyleKotowick opened this issue May 7, 2015 · 9 comments
Open

Determining first beat in a measure #253

KyleKotowick opened this issue May 7, 2015 · 9 comments

Comments

@KyleKotowick
Copy link

I'm pretty new to Essentia but am quite impressed with it. There's one feature that I'm hoping someone can help me figure out (if it's even possible). Using RhythmExtractor2013 I can get the times of all beats in the song, and it's quite accurate. Is there any way, though, to find which beats are the first in each measure? e.g. beat 1 of a measure in 4/4 time.

Thanks! Keep up the great work.

@dbogdanov
Copy link
Member

It is not possible with the algorithms we currently have. This feature is in our wishlist. You can experiment with RhythmExtractor2013, if the music you analyze is 4/4, potentially the first beat in the list will often correspond to the first downbeat, but we did not evaluate that.

@KyleKotowick
Copy link
Author

Good to know that I'm not crazy, and it doesn't actually exist. I've tried it with different songs, and the RhythmExtractor2013 will start on the first beat < 50% of the time. Is there a way to see the "wishlist", and what priorities things on it have?

@georgid
Copy link
Contributor

georgid commented May 5, 2017

We plan to reimplement a state of the art beat and downbeat detection algorithm

PatternTrackingProcessor class is the main downbeat tracker class.
It is based on a dynamic Bayesian network (DBN) approximated by a Hidden Markov Model (HMM) for computationally faster decoding. The states of the HMM track a hypothetic pointer to a position in a metrical cycle (bar). The observation model for each state comes from pre-trained rhythmic pattern (a sequence of GMM models) per each given meter type (e.g. 4/4) that is based on the spectralFlux onset feature.

A script that runs the entire detection process
The PatternTrackingProcessor class is called in downbeat_processor = PatternTrackingProcessor(**vars(args))

Essentially the script does:
0. create the efficient joint bar-tempo state space

  1. extract the spectral flux
  2. load the pre-trained rhythmic patterns into the GMM observation model
  3. decode the states with Viterbi and convert them into beats

@georgid
Copy link
Contributor

georgid commented May 6, 2017

@dbogdanov
may you point me to the implementation of the Viterbi decoding algorithm for HMM in essentia? I need to review it.

@dbogdanov
Copy link
Member

@georgid
Copy link
Contributor

georgid commented May 8, 2017

The Viterbi algorithm from the existing beat tracking implementation can be reused. The Viterbi in madmom is here

The transition matrix is madmom is implemented in the transition model class which is based on the joint bar-tempo state space

@georgid
Copy link
Contributor

georgid commented May 10, 2017 via email

@declension
Copy link

Was there any progress with this? I'd love to see downbeat / bar tracking in Essentia

@Be-ing
Copy link

Be-ing commented May 11, 2020

@georgid @pabloEntropia has there been any progress on this? We're looking to implement this feature in Mixxx along with phrase and section detection and considering using Essentia. If Essentia had this in the library that would be a big help. From what I gather from the old posts in this thread, you were intending to reimplement the downbeat detection algorithm from Madmom in C++ for Essentia? Please correct me if I misunderstood that. If that's the case, perhaps we could help to get that upstream in Essentia instead of rolling our own.

Cc @crisclacerda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants