Haven't researched this yet very fondly, but it looks like there is no easy way to just get an accurate song position in Buzz? You'd think it's in MasterInfo, but nope, all relative to the current tick, and subtick info is relative to current tick also..
i guess these two would help, but they return an int and no documentation on what that int is supposed to be:
virtual int GetSongPosition();
virtual int GetAudioFrame();
what i'm trying to do is to react to changes in the transport i.e. when song position changes, jump ahead in my sample playing too. I remember BTDSys audio track did this.
PVST must also somehow do this, as it needs to support things like kVstTransportChanged and audioMasterGetTime.
So, it's apparently possible to at least approximate, just asking before i waste time figuring this out myself.
How do you get an accurate song position and detect jumps?
Master Clock / Song Position
Re: Master Clock / Song Position
I'd assume GetSongPosition() returns current tick.
On the managed side you can do this to get position in samples:
Detecting jumps could be something like
(or compare ticks & subticks)
On the managed side you can do this to get position in samples:
Code: Select all
double avgSamplesPerTick = (60.0 * host.MasterInfo.SamplesPerSec) / (host.MasterInfo.BeatsPerMin * host.MasterInfo.TicksPerBeat);
int pos = (int)(song.PlayPosition * avgSamplesPerTick + host.MasterInfo.PosInTick);
Code: Select all
if (pos - prevPos > SamplesPerSubTick)...
Re: Master Clock / Song Position
thanks, yeah i had a hunch it was ticks and that you'd have to resort to subtick granularity to detect transport jump. should be good enough i guess.
Re: Master Clock / Song Position
BTDSys LiveJumpHack did a lot towards this... is the source still around? I once hosted it and it was also on sourceforge...but nowadays I dunno?
Re: Master Clock / Song Position
Still there, dusty and unloved... https://sourceforge.net/p/btdsys/code/H ... /LiveJump/