VstTimeInfo as requested via audioMasterGetTime (getTimeInfo ()) refers
to the current time slice. note the new slice is already started when
processEvents ()
is called.
Current location, Note that it may jump backwards in cycle mode. It must always
be valid, and should not cost a lot to ask for.
The
sample pos is that of the sequencer ('unrolled', that means without cycle
jumps). in sequencer stop mode, it simply continues to count. a 32 bit integer
is too small for sample positions, and it's a double to make it easier to
convert between ppq and samples.
It must always be valid, and should not cost a lot to ask for.
System Time related to samplePos (which is related to the first sample in the
buffers passed to the process ()
methods). system time is derived
from timeGetTime ()
on WINDOWS platforms, Microseconds ()
on MAC platform, UST
for MOTIF, and BTimeSource::RealTime ()
for BEOS.
the quarter position related to samplePos. as this is a floating point value, it can be easily converted to any scale. provided that the tempo is also given, any linear positions (like samples, smpte) can also be calculated precisely.
At tempo 120, 1 quarter makes 1/2 second, so 2.0 ppq translates to 48000 samples
at 48kHz sample rate.
.25 ppq is one sixteenth note then. if you need something like 480ppq, you
simply multiply ppq by that scaler.
tempo in Beats Per Minute (no scaling).
In 1 pulse (unit) per quarter. Useful in conjunction with Time Signature, or to calculate a precise sample position of a beat or other measure.
Say we're at bars/beats readout 3.3.3. That's 2 bars + 2 q + 2 sixteenth, makes 2 * 4 + 2 + .25 = 10.25 ppq. at tempo 120, that's 10.25 * .5 = 5.125 seconds, times 48000 = 246000 samples (if my calculator servers me well :-).
locator positions in quarter notes. note the kVstTransportCycleActive
flag.
locator positions in quarter notes. note the kVstTransportCycleActive
flag.
Time Signature; 1/4 has timeSigNumerator == 1 and timeSigDenominator == 4.
Time Signature; 1/4 has timeSigNumerator == 1 and timeSigDenominator == 4.
in SMPTE subframes (bits; 1/80 of a frame). the current smpte position can be calculated using samplePos, sampleRate, and smpteFrameRate.
value | frames |
---|---|
0 | 24 |
1 | 25 |
2 | 24 |
3 | 30 |
4 | 29.97 df |
5 | 30 df |
midi clock resolution (24 ppq), can be negative the distance to the next midi clock (24 ppq, pulses per quarter) in samples. unless samplePos falls precicely on a midi clock, this will either be negative such that the previous midi clock is addressed, or positive when referencing the following (future) midi clock.
see below
kVstTransportChanged = 1
something has changed. this is not restricted to start/stop, or location changes but may also be set (once!) to indicate other changes like tempo, cycle state or positions etc.
kVstTransportPlaying = 1 << 1
Sequencer is started (running).
kVstTransportCycleActive = 1 << 2
Cycle mode is active.
kVstAutomationWriting = 1 << 6
Automation Write mode is activated.
kVstAutomationReading = 1 << 7
Automation Read mode is activated.
Flags which indicate which of the fields in this VstTimeInfo
are valid. SamplePos
and
sampleRate
are always valid.
kVstNanosValid = 1 << 8
The nanoSeconds
field in this VstTimeInfo
is valid (or requested from getTimeInfo
).
kVstPpqPosValid = 1 << 9
the ppqPos field in this VstTimeInfo is valid (or requested from getTimeInfo ()).
kVstTempoValid = 1 << 10
the tempo field in this VstTimeInfo is valid (or requested from getTimeInfo ()).
kVstBarsValid = 1 << 11
the barStartPos
field in this
VstTimeInfo is valid (or requested from getTimeInfo ()).
kVstCyclePosValid = 1 << 12
the cycleStartPos and cycleEndPos fields in this VstTimeInfo are valid (or requested from getTimeInfo ()).
kVstTimeSigValid = 1 << 13
the timeSigNumerator
and
timeSigDenominator
fields in this VstTimeInfo are valid (or
requested from getTimeInfo ()).
kVstSmpteValid = 1 << 14
the smpteOffset
and
smpteFrameRate
fields in this VstTimeInfo are valid (or
requested from getTimeInfo ()).
kVstClockValid = 1 << 15
the samplesToNextClock
field in this VstTimeInfo is valid (or requested from getTimeInfo ()).
A Plug will request time info by calling the function getTimeInfo(long mask)
which returns a VstTimeInfo
pointer (or NULL
if not implemented by the host). The mask
parameter is composed of the same flags which will be found in the flags
field of VstTimeInfo
when
returned, that is, if you need information about tempo, the parameter passed to
getTimeInfo
should have the kVstTempoValid
flag set.
This request and delivery system is important, as a request like this may cause
significant calculations at the application's end, which may take a lot of our
precious time. This obviously means you should only set those flags that are
required to get the information you need. Also please be aware that requesting
information does not necessarily mean that that information is provided in
return. Check the flags
field
in the VstTimeInfo
structure
to see if your request was actually met.
filter |
A mask indicating which fields are requested, as some items may require
extensive conversions. See the flags in
VstTimeInfo . |
---|---|
return |
A pointer to a VstTimeInfo structure or
null if not implemented by the host. |
Gets the tempo at position
. Note that this call may cause heavy
calculations on the application side.
position |
Sample frame. |
---|---|
return |
Tempo (in bpm * 10000). |
Sample position and other time info can be obtained though
VstTimeInfo
.