快速登录:  

Forum: VirtualDJ Plugins

话题: Detect beats

由于该帖子已年深日久,可能包含陈旧过时或描述错误的信息。

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 ?
 

发表时间 Mon 21 Aug 06 @ 3:27 am
claxPRO InfinityMember since 2004
One possibility:
-----------------

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

 

发表时间 Mon 21 Aug 06 @ 8:46 am
yeah, thanks you, it work.. we need to add i to pos

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


 

发表时间 Mon 21 Aug 06 @ 1:33 pm
TexZKPRO InfinityMember since 2005
Remember real-time programming eats too much memory. Use array maths instead!
 

发表时间 Mon 21 Aug 06 @ 2:51 pm


(陈旧帖子或论坛版块会自动关闭)