快速登录:  

Forum: VirtualDJ Plugins

话题: Tips to find the position of the first beat of the next bar?

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

I have tried by :

SongBpm = SongBpm ? SongBpm : (SampleRate / 2);
int StartPos = int(SongPosBeats * SongBpm);
int intSongPosBeats = SongPosBeats;
int PosNextBar = StartPos + (SongBpm * (4 - (intSongPosBeats % 4))) + (SongBpm * (SongPosBeats - intSongPosBeats));


It doesn't work.
It can't work when the song doesn't start of the first beat of the bar.

Any idea ?


 

发表时间 Sun 27 Sep 20 @ 11:34 am
AdionPRO InfinityCTOMember since 2006
Something like this?
int PosNextBar = SongPos + (ceil(SongPosBeats/4)*4 - SongPosBeats) * SongBpm;
 

发表时间 Sun 27 Sep 20 @ 11:55 am
Thank you Adion.
It works !!!
 

发表时间 Sun 27 Sep 20 @ 4:11 pm


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