download MKConductorDelegate.h
Language: ObjectiveC
Copyright: Copyright 1988-1992, NeXT Inc. All rights reserved. */
LOC: 17
Project Info
The MusicKit(musickit)
Server: SourceForge
Type: cvs
...sicKit\Frameworks\MusicKit\
   _ArielQP.h
   _DSPMK.h
   _error.h
   _midi.h
   _MKAppProxy.h
   _MKAppProxy.m
   _MKNameTable.h
   _MKNameTable.m
   _MKParameter.h
   _MTCHelper.h
   _MTCHelper.m
   _musickit.h
   _noteRecorder.h
   _OrchloopbeginUG.h
   _OrchloopbeginUG.m
   _ParName.h
   _ParName.m
   _scorefile.h
   _ScorefileVar.h
   _ScorefileVar.m
   _SharedSynthInfo.h
   _SharedSynthInfo.m
   _synthElementMethods.m
   _time.h
   ArielQP.h
   ArielQP.m
   classFuncs.h
   ConductorPrivate.h
   dsp_types.h
   DSPSerialPortDevice.h
   dspwrap.h
   EnvelopePrivate.h
   equalTempered.m
   errors.h
   fastFFT.c
   fastFFT.h
   GNUmakefile.postamble
   GNUmakefile.preamble.in
   InstrumentPrivate.h
   keynums.h
   libMusicKit.def
   Localized.strings
   make.sh
   Makefile.postamble
   Makefile.preamble
   midi_spec.h
   midifile.h
   midifile.m
   MidiPrivate.h
   midiTranslation.h
   MKConductor.h
   MKConductor.m
   MKConductorDelegate.h
   MKDeviceStatus.h
   MKEnvelope.h
   MKEnvelope.m
   MKFilePerformer.h
   MKFilePerformer.m
   MKFileWriter.h
   MKFileWriter.m
   MKInstrument.h
   MKInstrument.m
   MKMidi.h
   MKMidi.m
   MKMixerInstrument.h
   MKMixerInstrument.m
   MKMTCPerformer.h
   MKMTCPerformer.m
   MKNote.h
   MKNoteFilter.h
   MKNoteFilter.m
   MKNoteReceiver.h
   MKNoteReceiver.m
   MKNoteSender.h
   MKNoteSender.m
   MKOrchestra.h
   MKPart.m
   MKPartials.h
   MKPartials.m
   ...tialsWaveshapingTable.m
   MKPartPerformer.h
   MKPartPerformer.m
   MKPartRecorder.h
   MKPartRecorder.m
   MKPatch.h
   MKPatch.m
   MKPatchConnection.h
   MKPatchConnection.m
   MKPatchEntry.h
   MKPatchEntry.m
   MKPatchTemplate.h
   MKPatchTemplate.m
   MKPerformer.h
   MKPerformer.m
   MKPerformerDelegate.h
   MKPlugin.h
   MKSamplerInstrument.h
   MKSamplerInstrument.m
   MKSamples.h
   MKScore.h
   MKScore.m
   MKScorefileObject.h
   MKScorefilePerformer.h
   MKScorefilePerformer.m
   MKScorefileWriter.m
   MKScorePerformer.h
   MKScorePerformer.m
   MKScoreRecorder.h
   MKScoreRecorder.m
   MKSynthData.h
   MKSynthData.m
   MKSynthInstrument.h
   MKSynthPatch.h
   MKTimbre.h
   MKTimbre.m
   MKTuningSystem.h
   MKTuningSystem.m
   MKUnitGenerator.h
   MKUnitGenerator.m
   MKWaveTable.h
   MKWaveTable.m
   mtcMidi.m
   mtcMidiPrivate.m
   MusicKit-Info.plist
   MusicKit.h
   MusicKitConfig.h.in
   names.h
   noDVal.h
   noteDispatcherMethods.m
   NotePrivate.h
   noteRecorderCFuncs.m
   noteRecorderMethods.m
   orch.h
   OrchestraPrivate.h
   OrchloopbeginUG.h
   OrchloopbeginUG.m
   orchloopbeginUGInclude.m
   params.h
   parNames.m
   partialsDBInclude.m
   PartialsPrivate.h
   PartPerformerPrivate.h
   PartPrivate.h
   PartRecorderPrivate.h
   PatchTemplatePrivate.h
   PB.project
   PerformerPrivate.h
   pitches.h
   platform.make
   ...efilePerformerPrivate.h
   ScorePerformerPrivate.h
   ScorePrivate.h
   ScoreRecorderPrivate.h
   SynthDataPrivate.h
   synthElementCFuncs.m
   synthElementMethods.m
   SynthInstrumentPrivate.h
   SynthPatchList.h
   SynthPatchList.m
   SynthPatchPrivate.h
   timetagInclude.m
   timeunits.h
   tokenNames.m
   tokens.h
   trigonometry.c
   trigonometry.h
   TuningSystemPrivate.h
   UnitGeneratorPrivate.h
   win32-def.top
   writeBinary.m
   writeMidi.m
   writeScore.m

/* Copyright 1988-1992, NeXT Inc.  All rights reserved. */
/*
  $Id: MKConductorDelegate.h,v 1.4 2005/05/20 01:58:32 leighsmith Exp $
*/
#ifndef __MK_ConductorDelegate_H___
#define __MK_ConductorDelegate_H___

#import <Foundation/NSObject.h>
@interface MKConductorDelegate : NSObject

- conductorWillSeek: (id) sender;
- conductorDidSeek: (id) sender;
- conductorDidReverse: (id) sender;
- conductorDidPause: (id) sender;
- conductorDidResume: (id) sender;

-(double) beatToClock:(double)t from: (id) sender;
-(double) clockToBeat:(double)t from: (id) sender;

- conductorCrossedLowDeltaTThreshold;
- conductorCrossedHighDeltaTThreshold;

/*!
  @brief Set and get Music Kit time values

  <b>MKGetTime()</b> returns the current time, in seconds, during a Music
  Kit performance.   In a conducted performance (the norm), this is the
  same as [MKConductor time]. 
   
   <b>MKSetDeltaT()</b> 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 <b>MKSetDeltaTMode()</b>.  In
  MK_DELTAT_DEVICE_LAG mode, deltaT is added into the timestamps of DSP
  and MIDI messages, thus imposing a time lag between the Music Kit 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
  Music Kit MKConductor attempts to run ahead of the devices.  In either
  case, the lag is sometimes necessary to allow the Music Kit 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 <b>[orchestra run]</b> and <b>[midi run]</b> immediately before
  sending <b>[MKConductor startPerformance]</b>;
   
   <b>MKGetDeltaT()</b> 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
  <i>approximately</i> delta time seconds ahead of the devices (e.g. DSP).
  In an unclocked performance, MKConductor tries to stay <i>at least</i>
  delta time seconds ahead of the devices. Delta time has an effect only
  if the device is in timed mode.
   
   <b>MKGetDeltaTTime()</b> returns the sum of the values returned by
  <b>MKGetTime()</b> and <b>MKGetDeltaT()</b>.  
   
   <b>MKSetTime()</b> and <b>MKFinishPerformance()</b> are provided to
  set the performance time and to end a performance, respectively, <i>but
  only in the case of a performance that doesn't use the MKConductor
  class.</i>  <i></i> During a conducted performance, <b>MKSetTime()</b>
  has no effect and <b>MKFinishPerformance()</b> is the same as sending
  <b>finishPerformance</b> to the MKConductor class.    Precisely,
  <b>MKFinishPerformance()</b> his the effect of evaluating the
  MKConductor's "after performance" queue of messages, which in turn tells
  the Performers and Instruments that the performance is finished. 
     
   <b>MKSetLowDeltaTThreshold()</b> and <b>MKSetHighDeltaTThreshold()</b> controls the high and low watermark for the delta time notification mechanism. For example, to receive a message when the MKConductor has fallen behind such that the effective delta time is less than 1/4 of the value of MKGetDeltaT(), you'd call <b>MKSetLowDeltaTThreshold(.25);</b>  Similarly, to receive a message when the MKConductor has recovered such that the effective delta time is more than 3/4 of the value of <b>MKGetDeltaT()</b>, you'd call <b>MKSetHighDeltaTThreshold(.75);  </b>This mechanism allows you to receive a warning when the MKConductor is about to fall out of real time, due to heavy computation.   For example, you might want to automatically reduce the tempo in this case.  The notification itself is sent to the MKConductor class' delegate object.  See MKConductor.h for further details.  
   
   <b>MKSetDeltaTMode();</b>  Sets the delta time mode to one of
  MK_DELTAT_DEVICE_LAG or MK_DELTAT_SCHEDULER_ADVANCE .    The default is
  MK_DELTAT_DEVICE_LAG.
   
   <b>MKGetDeltaTMode();</b>  Returns the delta time mode.
  @param  percentageOfDeltaT is a double.
*/
void MKSetLowDeltaTThreshold(double percentageOfDeltaT);

/*!
  @brief Set and get Music Kit time values

  <b>MKGetTime()</b> returns the current time, in seconds, during a Music
  Kit performance.   In a conducted performance (the norm), this is the
  same as [MKConductor time]. 
   
   <b>MKSetDeltaT()</b> 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 <b>MKSetDeltaTMode()</b>.  In
  MK_DELTAT_DEVICE_LAG mode, deltaT is added into the timestamps of DSP
  and MIDI messages, thus imposing a time lag between the Music Kit 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
  Music Kit MKConductor attempts to run ahead of the devices.  In either
  case, the lag is sometimes necessary to allow the Music Kit 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 <b>[orchestra run]</b> and <b>[midi run]</b> immediately before
  sending <b>[MKConductor startPerformance]</b>;
   
   <b>MKGetDeltaT()</b> 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
  <i>approximately</i> delta time seconds ahead of the devices (e.g. DSP).
  In an unclocked performance, MKConductor tries to stay <i>at least</i>
  delta time seconds ahead of the devices. Delta time has an effect only
  if the device is in timed mode.
   
   <b>MKGetDeltaTTime()</b> returns the sum of the values returned by
  <b>MKGetTime()</b> and <b>MKGetDeltaT()</b>.  
   
   <b>MKSetTime()</b> and <b>MKFinishPerformance()</b> are provided to
  set the performance time and to end a performance, respectively, <i>but
  only in the case of a performance that doesn't use the MKConductor
  class.</i>  <i></i> During a conducted performance, <b>MKSetTime()</b>
  has no effect and <b>MKFinishPerformance()</b> is the same as sending
  <b>finishPerformance</b> to the MKConductor class.    Precisely,
  <b>MKFinishPerformance()</b> his the effect of evaluating the
  MKConductor's "after performance" queue of messages, which in turn tells
  the Performers and Instruments that the performance is finished. 
     
   <b>MKSetLowDeltaTThreshold()</b> and <b>MKSetHighDeltaTThreshold()</b> controls the high and low watermark for the delta time notification mechanism. For example, to receive a message when the MKConductor has fallen behind such that the effective delta time is less than 1/4 of the value of MKGetDeltaT(), you'd call <b>MKSetLowDeltaTThreshold(.25);</b>  Similarly, to receive a message when the MKConductor has recovered such that the effective delta time is more than 3/4 of the value of <b>MKGetDeltaT()</b>, you'd call <b>MKSetHighDeltaTThreshold(.75);  </b>This mechanism allows you to receive a warning when the MKConductor is about to fall out of real time, due to heavy computation.   For example, you might want to automatically reduce the tempo in this case.  The notification itself is sent to the MKConductor class' delegate object.  See MKConductor.h for further details.  
   
   <b>MKSetDeltaTMode();</b>  Sets the delta time mode to one of
  MK_DELTAT_DEVICE_LAG or MK_DELTAT_SCHEDULER_ADVANCE .    The default is
  MK_DELTAT_DEVICE_LAG.
   
   <b>MKGetDeltaTMode();</b>  Returns the delta time mode.
  @param  percentageOfDeltaT is a double.
*/
void MKSetHighDeltaTThreshold(double percentageOfDeltaT);

@end

#endif

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us