Anmelden:     


Forum: VirtualDJ Plugins

Topic: Detect beats

Dieses Thema ist veraltet und kann veraltete oder falsche Informationen enthalten.

uh.. yeah, I read the topic where it tell how to detect beat, but nothing:

in the function OnComputeNewSamples :

if ((pos - SongPhase) % Bpm == 0)
{
//Do something
}

what's the trick ?
 

geposted Mon 21 Aug 06 @ 3:27 am
One possibility:
-----------------

#define SONGPOS (pos+i) // Offset from the first sample of the track
...
int nextbeat;
...
nextbeat=SongPhase; while (nextbeat<=SONGPOS) nextbeat+=bpm;

 

yeah, thanks you, it work.. we need to add i to pos

if (((pos+i) - SongPhase) % Bpm == 0)
{
//Do something
}


 

Remember real-time programming eats too much memory. Use array maths instead!
 



(Alte Themen und Foren werden automatisch geschlossen)