Functions | |
double | MKGetTime (void) |
Returns the time in seconds. | |
double | MKGetDeltaT (void) |
Returns deltaT, in seconds. | |
void | MKSetDeltaT (double val) |
Sets deltaT, in seconds. | |
double | MKGetDeltaTTime (void) |
Returns deltaT + time, in seconds. | |
void | MKSetDeltaTMode (int newMode) |
Sets the delta time mode. | |
int | MKGetDeltaTMode (void) |
Returns the delta time mode. | |
double | MKSetTime (double newTime) |
Set the performance time. |
double MKGetDeltaT | ( | void | ) |
Returns deltaT, in seconds.
MKGetDeltaT() returns the delta time value, in seconds. The meaning of delta time depends on whether the performance is clocked or unclocked. In a clocked performance, the MKConductor tries to stay approximately delta time seconds ahead of the devices (e.g. DSP). In an unclocked performance, MKConductor tries to stay at least delta time seconds ahead of the devices. Delta time has an effect only if the device is in timed mode.
int MKGetDeltaTMode | ( | void | ) |
double MKGetDeltaTTime | ( | void | ) |
Returns deltaT + time, in seconds.
MKGetDeltaTTime() returns the sum of the values returned by MKGetTime() and MKGetDeltaT().
double MKGetTime | ( | void | ) |
Returns the time in seconds.
MKGetTime() returns the current time, in seconds, during a MusicKit performance. In a conducted performance (the norm), this is the same as [MKConductor time].
void MKSetDeltaT | ( | double | val | ) |
Sets deltaT, in seconds.
MKSetDeltaT() sets a performance's delta time in seconds. The delta time value is used in one of two ways, depending on the delta time "mode", which is set with MKSetDeltaTMode(). In MK_DELTAT_DEVICE_LAG mode, deltaT is added into the timestamps of DSP and MIDI messages, thus imposing a time lag between the MusicKit and these devices. If, on the other hand, the delta time mode is MK_DELTAT_SCHEDULER_ADVANCE, then deltaT is the amount by which the MusicKit MKConductor attempts to run ahead of the devices. In either case, the lag is sometimes necessary to allow the MusicKit sufficient compute time while maintaining rhythmic integrity. Effective delta time values can be quite small; for an application that requires real-time response, a delta time of as much as 10 milliseconds (0.01 seconds) is tolerable. Delta time only affects devices that are timed. In addition, in order for the delta time value to be valid, the performance and the devices must be started at (virtually) the same time. That is, send [orchestra run] and [midi run] immediately before sending [MKConductor startPerformance];
val | is a double. |
void MKSetDeltaTMode | ( | int | newMode | ) |
Sets the delta time mode.
Sets the delta time mode to one of MK_DELTAT_DEVICE_LAG or MK_DELTAT_SCHEDULER_ADVANCE. The default is MK_DELTAT_DEVICE_LAG.
newMode | is an int. |
double MKSetTime | ( | double | newTime | ) |
Set the performance time.
Rarely used. MKSetTime() and MKFinishPerformance() are provided to set the performance time and to end a performance, respectively, but only in the case of a performance that doesn't use the MKConductor class. During a conducted performance, MKSetTime() has no effect and MKFinishPerformance() is the same as sending finishPerformance to the MKConductor class. Precisely, MKFinishPerformance() has the effect of evaluating the MKConductor's "after performance" queue of messages, which in turn tells the MKPerformers and MKInstruments that the performance is finished.
newTime | is a double. |