Accesso rapido:  

Forum: VirtualDJ Plugins

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

Questo argomento è obsoleto e potrebbe contenere informazioni obsolete o errate.

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 ?


 

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

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

Inviato Sun 27 Sep 20 @ 4:11 pm


(Vecchi argomenti e forum sono automaticamente chiusi)