Author Topic: About the beatdetector...  (Read 54925 times)

Led

  • Posts: 40
About the beatdetector...
« on: 4 Jul '02 - 23:25 »
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

  • Posts: 110
Re: About the beatdetector...
« Reply #1 on: 5 Jul '02 - 07:11 »
Quote

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...


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

  • Posts: 40
Re: About the beatdetector...
« Reply #2 on: 5 Jul '02 - 11:55 »
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

  • Posts: 142
Re: About the beatdetector...
« Reply #3 on: 5 Jul '02 - 14:56 »
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

  • Posts: 110
Re: About the beatdetector...
« Reply #4 on: 5 Jul '02 - 17:31 »
Quote

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... :-/


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

  • Posts: 142
Re: About the beatdetector...
« Reply #5 on: 5 Jul '02 - 18:11 »
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

  • Posts: 110
Re: About the beatdetector...
« Reply #6 on: 5 Jul '02 - 18:24 »
Quote

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. :'(


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

  • Posts: 73
Re: About the beatdetector...
« Reply #7 on: 20 Jul '02 - 11:43 »
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

  • Posts: 110
Re: About the beatdetector...
« Reply #8 on: 20 Jul '02 - 11:54 »
Quote

Or 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

  • Posts: 73
Re: About the beatdetector...
« Reply #9 on: 20 Jul '02 - 12:03 »
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

  • Posts: 73
Re: About the beatdetector...
« Reply #10 on: 20 Jul '02 - 12:06 »
MP3DJ costs about 22 (I think)...
So what would they ask for the source?

Largie

  • Posts: 110
Re: About the beatdetector...
« Reply #11 on: 20 Jul '02 - 12:19 »
Quote

MP3DJ 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

  • Posts: 73
Re: About the beatdetector...
« Reply #12 on: 20 Jul '02 - 12:46 »
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

  • Posts: 110
Re: About the beatdetector...
« Reply #13 on: 20 Jul '02 - 12:54 »
Quote

Now 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

  • Posts: 73
Re: About the beatdetector...
« Reply #14 on: 20 Jul '02 - 12:57 »
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

  • Posts: 110
Re: About the beatdetector...
« Reply #15 on: 20 Jul '02 - 13:01 »
Quote

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?


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

  • Posts: 73
Re: About the beatdetector...
« Reply #16 on: 20 Jul '02 - 13:12 »
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

  • Posts: 73
Re: About the beatdetector...
« Reply #17 on: 20 Jul '02 - 19:49 »
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

  • Posts: 73
Re: About the beatdetector...
« Reply #18 on: 20 Jul '02 - 20:23 »
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

  • Posts: 110
Re: About the beatdetector...
« Reply #19 on: 20 Jul '02 - 20:28 »
Quote

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...


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! :)

Code: [Select]

#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;

}

Ryzer

  • Posts: 73
Re: About the beatdetector...
« Reply #20 on: 21 Jul '02 - 11:26 »
Ok, I'm not so good in C++, so help me out here:

Code: [Select]
#include "BeatCnt.h"
Doesn't that means that we need the file BeatCnt.h ?

Is this the full source? So we only need this and the DLL (and BeatCnt.h maybe?) ?

Can someone inhere turn this code into VB6-code? (Cause there are people inhere that uses VB6 for there programs and maybe also can read some C++...)

Thanks,
Ryzer

Largie

  • Posts: 110
Re: About the beatdetector...
« Reply #21 on: 21 Jul '02 - 16:48 »
Quote

Code: [Select]
#include "BeatCnt.h"
Doesn't that means that we need the file BeatCnt.h ?


If someone make a "wrapper" dll for you that you can use, the complete sdk includes the BeatCnt.h, BeatCnt.lib that is needed...

I guess Jobnik or something can get this thing to work... But I guess it is better if someone completes Carrots Bpm thingy first! :)

It is kinda buggy... :)
« Last Edit: 21 Jul '02 - 16:49 by Largie »

Ryzer

  • Posts: 73
Re: About the beatdetector...
« Reply #22 on: 21 Jul '02 - 17:35 »
So we can't do shit with the code you gave?  ;)

Largie

  • Posts: 110
Re: About the beatdetector...
« Reply #23 on: 21 Jul '02 - 17:46 »
Quote

So we can't do shit with the code you gave? ;)


I see this as a perfect oppertunity for you to start programming Visual C++ stuff!  8)

Ryzer

  • Posts: 73
Re: About the beatdetector...
« Reply #24 on: 22 Jul '02 - 08:48 »

Quote



I see this as a perfect oppertunity for you to start programming Visual C++ stuff! 8)


Code: [Select]

Parse Error: Learning not understood in Bass-Forum on line 3
Parse Error: Refusing to learn in VACATION on line 3


Maybe l8tr...  8)