Connexion rapide:  

Forum: VirtualDJ Plugins

Sujet Tips to find the position of the first beat of the next bar?

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

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 ?


 

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

Posté Sun 27 Sep 20 @ 11:55 am
Thank you Adion.
It works !!!
 

Posté Sun 27 Sep 20 @ 4:11 pm


(Les anciens sujets et forums sont automatiquement fermés)