download _OrchloopbeginUG.m
Language: ObjectiveC
Copyright: Copyright 1988-1992, NeXT Inc. All rights reserved. */
LOC: 48
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. */
#ifdef SHLIB
#include "shlib.h"
#endif

/*
  $Id: _OrchloopbeginUG.m,v 1.2 1999/07/29 01:26:00 leigh Exp $
  Original Author: David A. Jaffe
  
  Defined In: The MusicKit
  HEADER FILES: musickit.h
*/
/* 
Modification history:

  $Log: _OrchloopbeginUG.m,v $
  Revision 1.2  1999/07/29 01:26:00  leigh
  Added Win32 compatibility, CVS logs, SBs changes

  11/10/89/daj - In order to implement filling up the sound out buffers
                 before starting to play, did the following:
		 Recompiled orchloopbeginIncludeUG.m. 
		 Added looper: argument to _setXArgsAddr:y:l:looper.
		 Added _unpause method. 
  03/13/90/daj - Changed name to _OrchloopbeginUG.
  04/23/90/daj - Got rid of instance variable and added arg to _pause:
                 to fix bug.
  04/25/90/daj - Changed arg order in calls to DSPWriteValue, to conform
                 with no libdsp api.
  05/01/90/jos - Removed "r" prefix from rData and rWordCount
  07/17/91/daj - Added setting of address of DSP_HM_SYSTEM_TICK_UPDATES;
*/
#import "_musickit.h"
#import "_OrchloopbeginUG.h"

@implementation _OrchloopbeginUG:MKUnitGenerator 
  /* See beg_orcl in dsp/smsrc/beginend.asm.  */ 

#import "orchloopbeginUGInclude.m"

#define LOOPER_JUMP(_arrSize) (_arrSize - 1)

+_setXArgsAddr:(int)xArgsAddr y:(int)yArgsAddr l:(int)lArgsAddr 
 looper:(int)looperWord
{
    MKLeafUGStruct *info = [self classInfo]; 
    DSPDataRecord *dRec = info->data[(int)DSP_LC_P]; 
    int *pData = dRec->data;         /* The data array */
    int arrSize = dRec->wordCount;   

#   define ADDR(_x) (_x << 8)
#   define UPDATE_SUBR_ADDR arrSize - 8
#   define XARG_ADDR arrSize - 6
#   define YARG_ADDR arrSize - 4
#   define LARG_MOVE arrSize - 3
#   define LMOVEOP ((unsigned)0x350000) /* Move of ADDR to register R_I2 (register 5) */

    /* Set location of tick subroutine */
    pData[UPDATE_SUBR_ADDR] = DSP_HM_SYSTEM_TICK_UPDATES;
    /* Fix up arg pointers */
    pData[XARG_ADDR] = xArgsAddr; 
    pData[YARG_ADDR] = yArgsAddr;

    pData[LARG_MOVE] = LMOVEOP | ADDR(lArgsAddr); 

    pData[LOOPER_JUMP(arrSize)] = looperWord; /* always loop back. */
    return self;
}

-_unpause
{
    MKLeafUGStruct *info = [self classInfo]; 
    DSPDataRecord *dRec = info->data[(int)DSP_LC_P]; 
    int arrSize = dRec->wordCount;   
    int address = LOOPER_JUMP(arrSize) + relocation.pLoop;
#   define NOOP 0x0      
    DSPWriteValue(NOOP,DSP_MS_P,address);
    return self;
}

-_pause:(int)looperWord
{
    MKLeafUGStruct *info = [self classInfo]; 
    DSPDataRecord *dRec = info->data[(int)DSP_LC_P]; 
    int arrSize = dRec->wordCount;   
    int address = LOOPER_JUMP(arrSize) + relocation.pLoop;
    DSPWriteValue(looperWord,DSP_MS_P,address);
    return self;
}

@end

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