download MKMixerInstrument.h
Language: ObjectiveC
Copyright: (c) 1988-1992, NeXT Computer, Inc. (c) 1994 Stanford University. (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT (c) 1999-2004 The MusicKit Project.
LOC: 32
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

/*
  $Id: MKMixerInstrument.h,v 2.3 2005/05/09 15:52:51 leighsmith Exp $
  Defined In: The MusicKit
  HEADER FILES: MusicKit.h

  Description:
    See the headerdoc description below.

  Original Author: David A. Jaffe, with Michael McNabb adding the
    enveloping and pitch transposition, the latter based on code
    provided by Julius Smith. Incorporation into the MusicKit framework, conversion
    to OpenStep and the SndKit by Leigh M. Smith.

  Copyright (c) 1988-1992, NeXT Computer, Inc.
  Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT
  Portions Copyright (c) 1994 Stanford University.
  Portions Copyright (c) 1999-2004 The MusicKit Project.
*/
/*!
  @class MKMixerInstrument
  @brief MKMixerInstrument mixes soundfiles based on a score description of the mix.
  
  
  MKMixerInstrument mixes soundfiles based on a score description of the mix. 
  It allows setting the amplitude scaling of each soundfile and to
  change that scaling over time by applying an amplitude envelope. It
  allows resampling (change the pitch of) a file.  It also allows
  you to specify that only a portion of a file be used in the mix.
  There is no limit to the number of soundfiles that may be mixed
  together. Also, the same soundfile may be mixed several times and may
  overlap with itself.  The soundfiles may have different sampling rates
  and different formats.  However, the output must be 16 bit linear.
  The more files you mix, the longer it will take the program to run.
  Note also that if you mix many large files, you will need a fair degree of swap
  space--keep some room free on the disk off of which you booted.

  MKMixerInstrument is also an illustration of how to make your own MusicKit
  MKInstrument subclass to "realize MKNotes" in some novel fashion. In this
  case, MKNotes are soundfile mix specifications. They are "realized" by
  being mixed into the output file.
*/
#ifndef __MK_MixerInstrument_H___
#define __MK_MixerInstrument_H___
#import "MKInstrument.h"
#import <SndKit/SndKit.h>

@interface MKMixerInstrument: MKInstrument
{
    /*! @var samplesToMix Dictionary of MKSamples to mix, keyed by noteTags */
    NSMutableDictionary *samplesToMix;
    /*! @var currentMixFrame Index of current output sample. */
    unsigned int currentMixFrame;
    /*! @var soundFormat The format for the final sound, (sample rate, channels, sample format). */
    SndFormat soundFormat;
    /*! @var sound Output sound */
    Snd *sound;                       
    /*! @var mixedProcessorChain A chain of SndAudioProcessing instances, including fader, applied after mixing all sounds. */
    SndAudioProcessorChain *mixedProcessorChain;
    /*! @var defaultAmplitude Default amplitude (set at the start of a MK_noteDur and modified with MK_noteUpdate) */
    double defaultAmplitude;
    /*! @var defaultBearing Default bearing in +/- degrees (set at the start of a MK_noteDur and modified with MK_noteUpdate) */
    double defaultBearing;
    /*! @var defaultNewFrequency Default resampling factor numerator. What the new frequency of the sample is desired to be. */
    double defaultNewFrequency;
    /*! @var defaultOriginalFrequency Default resampling factor denominator. What the original frequency of the sample is. */
    double defaultOriginalFrequency;
    /*! @var defaultFile Default sound file name */
    NSString *defaultFile;
    /*! @var defaultEnvelope Default amplitude envelope */
    id defaultEnvelope;
    /*! @var defaultTimeScale See README */
    int defaultTimeScale;
    /*! @var currentlyLooping Loop the sound if the duration exceeds the sounds length. */
    BOOL currentlyLooping;
}

/*!
  @brief Sets the sampling rate to be used when mixing sounds.
  
  This method should be invoked once before performance is started. 
  @param  aSrate is a double.
 */
- (void) setSamplingRate: (double) aSrate;

/*!
  @brief Sets the number of audio channels to be used when mixing sounds.
  
  This method should be invoked once before performance is started. 
  @param  chans is an int.
 */
- (void) setChannelCount: (int) chans;

/*!
  @brief Returns the sound that has been mixed.
  @return Returns a Snd instance.
 */
- (Snd *) mixedSound;

/*!
  @brief Initializes the instance to 44.1KHz, 16 bit stereo file output.
 */
- init;

- (void) dealloc;

/*!
  @param  aNote is an MKNote.
  @return Returns <b>self</b>.
  @brief You do not normally call this method explictly.

  
  It is invoked when first note is received during performance.
*/
- firstNote: (MKNote *) aNote;

/*!
  @brief Internal method to manage the reception of a new note.
  
  This method is not normally called, but may be overloaded by a subclass.
  @param thisNote An MKNote instance.
 */
- (BOOL) mixNewNote: (MKNote *) thisNote;

/*!
  @brief Internal method to manage the reception of an update MKNote.
  
  This method is not normally called, but may be overloaded by a subclass.
  @param thisNote An MKNote instance.
 */
- (BOOL) mixNoteUpdate: (MKNote *) thisNote;

/*!
  @param  aNote is an MKNote.
  @param  aNoteReceiver is an MKNoteReceiver.
  @brief This is invoked when a new MKNote is received during performance to perform the mixing.

  
  You do not normally call this method explictly. Each note is converted to a common format.
*/
- realizeNote: (MKNote *) aNote fromNoteReceiver: (MKNoteReceiver *) aNoteReceiver;

/*!
  @return Returns <b>self</b>.
  @brief You do not normally call this method explictly.

  
  It is invoked when performance is over. 
*/
- afterPerformance;

@end

#endif

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