Ingreso rápido:  

Forum: VirtualDJ Plugins

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

Este tópico es antiguo y puede contener información incorrecta para la nueva versión.

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 ?


 

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

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

Mensajes Sun 27 Sep 20 @ 4:11 pm


(Los tópicos y foros antiguos son automáticamente cerrados)