About the beatdetector...

Started by Led,

Led

I don't think this is a very relevant poll as a beatdetector is quite a project on its own.

I even dare to say I think the source-code for a *good*, *generic* beat-detector (depends on your defenition ofcourse) would probably be larger than the entire BASS-sourcecode :)

And in case you just want a *simple* beat-detector - just grab the lower frequencies of the FFT-data and you have your bassdrum-detection...

Largie

QuoteAnd in case you just want a *simple* beat-detector - just grab the lower frequencies of the FFT-data and you have your bassdrum-detection...

After the hours I have spendt searching for beat-detector stuff I also have realized that the project will be big to get it 100% right, but that is not what I'm looking for! ;)

I have tested using the FFT data to extract the low frequencies and that did not work very well for me. I just want to extract beats from easy techno, dance or trance music. There are no need for others to be detected.

Does anybody have any source or hints about this subject, it is pretty frustration since the really good DSP programmers laught about this features, but nobody makes a SDK (like Ian does with BASS) on this kind of feature...

I have uploaded a code made in linux:
ftp://www.un4seen.com/incoming/tapping.zip

And I have alos a complete session about how to make beat detectors in mathlab:

http://www-dsp.rice.edu/courses/elec301/Projects01/beat_sync/

I have never used mathlab, but if anybody is up to porting the linuxcode or the mathlab stuff, PLEASE GIVE ME A NOTE!  8)

Hopefully someone will reply about this! ;)

Led

Well, for a simple beatdetector using the low frequencies of the FFT you first have to process the FFT given to you by Bass to get a sort of linear scale.
The FFT given by Bass has a Logaritmic scale so the high frequencies are almost always 'scaled away'.

I had some good results on music like Hallucinogen & other trance, Cypress Hill would work too (Most hiphop is pretty good to detect as it's got a strong bassdrum and not too much interfering low frequencies)

paddy

Bass fft returns the magnitudes of the frequency spectrum. Thats a definite plus for beat detection.

From my earlier research - you may need to:

1. Find the "dominant" beat freq in a song (usually the low freq) "Boom boom boom" in House music :)

2. Apply a band pass filter to isolate it  

3. Analyze this freq to get the *average* beat interval over a period of time (say ten secs)

4. Hope that this is maintained throughout the entire song...  :-/

====

Its harder to get BPM of hip-hop songs because SNARES are mostly the "beat timers" - but not always. Trance can also be tricky. Try techno and house (kicks) to get the algo working, then tweak with trance and hip hop.

====

Hope that helps.
 
 ;D Cheers!  ;D

Largie

QuoteBass fft returns the magnitudes of the frequency spectrum. Thats a definite plus for beat detection.

From my earlier research - you may need to:

1. Find the "dominant" beat freq in a song (usually the low freq) "Boom boom boom" in House music :)

2. Apply a band pass filter to isolate it  

3. Analyze this freq to get the *average* beat interval over a period of time (say ten secs)

4. Hope that this is maintained throughout the entire song...  :-/

Hmm... To me that I need to have a huge register over every fft data and then try to see which peak is the highest and set a band pass filter on that dominant peak... How is that possible to do when music have some big boom intros for xample?!

It must be sometime of calculations that after 2 beats it gives the calculated time between them and compare it to the third and the secound etc... Then the BPM will after maybe 5 secs be +/- 2 % from the right bpm...

But I have not seen any code based on these solutions... Mainly since they are to complex... That is why I started the poll too... caz the DSP people have to make stuff that dsp people do best... I mainly program interfaces! ;)

paddy

Usually (I think) the assumption is that the low frequencies will be dominant because they often have the highest amplitude. With this assumption you don't have to anlyze the frequency data - Just use a low-pass (notch?) filter at a certain frequency and assume all music will conform. :-/

That is why many BPM detectors dont work with hip hop. A lot of Pro. decks provide a means of manually "Tapping" in the BPM. I guess this illustrates just how hard it is to get a universal BPM detector.   :'(

Also illustrates how advanced the human mind is - even compared to the most powerful computer in the world! I mean, we can "know" the BPM of a song without even thinking about it!  ;D  ;D  ;D

Rgds.

Largie

QuoteThat is why many BPM detectors dont work with hip hop. A lot of Pro. decks provide a means of manually "Tapping" in the BPM. I guess this illustrates just how hard it is to get a universal BPM detector.   :'(

Well... I'm just trying to get a jump start on a BPM detector that takes the most common stuff...

But I'll guess I never find a library that really does it for me...  :'(

Ryzer

Do you guys now MP3DJ???
It's a little prog for mixing MP3's, doesn't have too much functions, but... IT HAS A COOL BPM COUNTER...
So maybe, is there a way to kind of STEAL the source from this program?  ;D

Or create a petition with 2000 names under it that WE WANT THE FUCKING SOURCE!!!  8)  ::)

Largie

QuoteOr create a petition with 2000 names under it that WE WANT THE FUCKING SOURCE!!!  8)  ::)

Sign me up scotty!  :P

The BPM counter (beat detector) routines are needed now!!! I have tried making different stuff , but my math stops!  :-[

I have also tried to buy different sourcecodes from people, but the price is much to high!

Ryzer

Then hack there mainservers and steal the source  :P

Another way is to set up a team...
If everybody helps around here (and I can find some other people that would like to help) we can create a new addon DLL for Bass for calculating the BPM (on the fly)
I would take lots of time, but hey... it's vacation so...
I hope that the Bass-team would help us, cause they are good programmers  ;D

Ryzer

MP3DJ costs about 22€ (I think)...
So what would they ask for the source?

Largie

QuoteMP3DJ costs about 22€ (I think)...
So what would they ask for the source?

Maybe 1000euro...

I asked the autobpm maker for the source, and he said he wanted 2500 euro for it... (Best I have seen yet!)

I think now buying is the answer... Teaming up could be a way to solve it... I have not found any books on the net for this issue... But there are alot written on paper, books, examns ect...

Cubic Carrot has also a library made with delphi... But there are no more development on that: http://users.compaqnet.be/CubicCarrot/

There is something like cubiccarrot that we need... Someone good at math to get this thing done :)

Ryzer

The best Beatcounter I've ever seen is the one from the Traktor dj studio.
It know if a beat is dominant or not, then he knows when the next dominant beat will come. You can see how he analyzes the upcoming beats graphical. I have the app here somewhere, so I'll send you a shot maybe.
That app is just AI men... it's the best stuff I've ever seen...

Now this: Who wants to buy the
source for us for 1000$  :laugh: ??

Largie

QuoteNow this: Who wants to buy the
source for us for 1000$  :laugh: ??

:) Not me! hehe....

I have just put up a rent a coder bid round for doing the beat detector... Maybe someone will help me there!  :evil:

Ryzer

So they stopped developing it??? Then why don't we ask them if we can have the source, so we can take it over and make newer versions and stuff... if they already stopped, why won't they do it?

Largie

QuoteSo they stopped developing it??? Then why don't we ask them if we can have the source, so we can take it over and make newer versions and stuff... if they already stopped, why won't they do it?

I have sendt mails to the people that made Cubic Carrot, never got an answer! So I guess they just don't give a damn...

I have also tried to send a mail to Tonioware, no answer... He made the first beat detector I every saw... As a plugin for Winamp...

Ryzer

Creating a new BPM counter would be cool. But is would be better if we have something to start from.

I downloaded the BPM counter from the carrotstuff you told me, but it isn't on the fly. At least it's fast so...

I'll send some new mails to them, if they don't awnser I send some more mails, and more, and more  ;D and even more...

HEHEHE  :evil:

Ryzer

I think I've found a BPM counting source !!!
BUT: it's for linux... i think it is C code... or CLASS... no id...
But it's a good start!

http://users.pandora.be/t015682/bpm/beatroot-0.2-src.tgz

Take a look linux-users. And let me know what it really is and if we can use it.

Greetz,
 Ryzer

Ryzer

In that Carrot-soft-stuff you gave, i found a DLL BeatCnt.dll
So i opened it with Dependency Walker (can be found in Visual Studio 6). I found some functions like BeatGetBpmFromFile and stuff like that. But i don't know how to use them...

Help plz

Largie

QuoteIn that Carrot-soft-stuff you gave, i found a DLL BeatCnt.dll
So i opened it with Dependency Walker (can be found in Visual Studio 6). I found some functions like BeatGetBpmFromFile and stuff like that. But i don't know how to use them...

When I tested the Carrot! ;) I got this code from him for VC++
You can use the name main.cpp or something on it, and compile it as a win32 console app... it will work! :)

#include <windows.h>
#include <stdio.h>
#include "BeatCnt.h"


typedef double ( _stdcall *BEATGETBPMFROMFILE) ( char *FileName,
                                                                     double MinBeatsPM,
                                                                     double MaxBeatsPM,
                                                                     double *Progress,
                                                                     double *Certainty);
BEATGETBPMFROMFILE _BeatGetBpmFromFile;



void main(int argc, char* argv[] )
{
      HANDLE BCSDK = 0;

      BCSDK = LoadLibrary( "BeatCnt.dll" );

      if ( !BCSDK )
      {
            printf( "failed to load BeatCnt.dll\n" );
            return ;
      }

      _BeatGetBpmFromFile      = (BEATGETBPMFROMFILE) GetProcAddress( (HINSTANCE)BCSDK, "BeatGetBpmFromFile" );

      if( !_BeatGetBpmFromFile )
      {
            printf( "failed to GetProcAddress for BeatGetBpmFromFile\n" );
            return ;
      }

      double Progress = 0;
      double Certainty = 0;
      double dRet = 0;

      dRet = _BeatGetBpmFromFile(argv[1], 110, 150, &Progress, &Certainty);

      printf( "BeatGetBpmFromFile returned %f : Progress = %f, Certainty = %f", dRet, Progress, Certainty);

      FreeLibrary((HINSTANCE)BCSDK);
      BCSDK = 0;

}