00001 /* 00002 $Id: ArielQP.h 3287 2005-05-27 09:52:26Z leighsmith $ 00003 Defined In: The MusicKit 00004 00005 Description: 00006 See the discussion below. With the demise of the QuintProcessor board (and NeXT hardware), 00007 this class becomes an example of multiple DSP operation. In theory it still works. 00008 00009 This class is the MKOrchestra that represents the Quint Processor "hub" 00010 (or "master") DSP. Creating an instance of ArielQP also creates the 00011 associated "satellite" DSPs ("sat" for short). These are also called 00012 "slave" DSPs. Note, however, that sending -open (or -run, etc.) to the ArielQP 00013 opens (or whatever) only the hub orchestra. To send a messge to all the 00014 satellite DSPs for this QuintProcessor, invoke the method makeSatellitesPerform:. 00015 Example: [anArielQP makeSatellitesPerform:@selector(open)]; To send to all 00016 the DSPs for the QP, invoked makeQPPerform:. 00017 00018 You may control whether sound from the satellite DSPs is brought into the 00019 hub DSP. To control whether such sound is included or excluded, send 00020 setSatSoundIn:. The defualt is to include it. Excluding it 00021 saves processing power on the hub, but means that the satellites will be useless, 00022 unless they send their sound out their serial port. 00023 00024 If the satellite sound is included, it can be accessed via the In1qpUG MKUnitGenerator. 00025 Each instance of this unit generator takes sound from a particular channel on 00026 a particular DSP. Note that you may have any number of these so that you can 00027 have multiple effects applied to the sound coming from a single source. 00028 00029 For the common case of simply mixing each satellite to the output sample stream, 00030 a MKSynthPatch called ArielQPMix is provided in the Music Kit MKSynthPatch Library. 00031 This MKSynthPatch needs only to be allocated to work. Be sure to deallocate it 00032 before closing the MKOrchestra. 00033 00034 FIXME: DRAM allocation 00035 00036 Original Author: David A. Jaffe 00037 00038 Copyright (c) 1988-1992, NeXT Computer, Inc. 00039 Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT 00040 Portions Copyright (c) 1994 CCRMA, Stanford University. 00041 Portions Copyright (c) 1999-2001, The MusicKit Project. 00042 */ 00043 /* 00044 $Log$ 00045 Revision 1.8 2005/05/27 09:52:25 leighsmith 00046 Added constants and types doxygen comments from old RTF doco 00047 00048 Revision 1.7 2005/05/22 07:34:06 leighsmith 00049 Corrected and updated headerdoc 00050 00051 Revision 1.6 2005/05/09 15:52:49 leighsmith 00052 Converted headerdoc comments to doxygen comments 00053 00054 Revision 1.5 2001/09/07 00:12:52 leighsmith 00055 Corrected naming of satellite class 00056 00057 Revision 1.4 2001/09/06 21:27:47 leighsmith 00058 Merged RTF Reference documentation into headerdoc comments and prepended MK to any older class names 00059 00060 Revision 1.3 2000/03/31 00:16:44 leigh 00061 TODOs have become more standard FIXMEs 00062 00063 Revision 1.2 1999/07/29 01:25:41 leigh 00064 Added Win32 compatibility, CVS logs, SBs changes 00065 00066 */ 00160 #ifndef __MK_ArielQP_H___ 00161 #define __MK_ArielQP_H___ 00162 00163 #import "MKOrchestra.h" 00164 #import "MKSynthData.h" 00165 00167 #define MK_DRAM_ZERO 0 /* Use first sample as a ZERO */ 00168 00169 #define MK_DRAM_SINK 1 /* Use second sample as a SINK */ 00170 00171 @interface ArielQP: MKOrchestra 00172 { 00173 int slot; /* One of 2, 4 or 6 */ 00174 BOOL satSoundIn; /* YES if we're receiving sound from the satellites */ 00175 BOOL DRAMAutoRefresh; /* YES if we're refreshing when needed */ 00176 MKSynthData *_satSynthData; /* Buffers for incoming sound data */ 00177 BOOL _initialized; 00178 NSDate * _reservedArielQP1; //sb: was double 00179 } 00180 00189 +new; 00190 00203 +newInSlot:(unsigned short)slot; 00204 00210 -satellite:(char)which; 00211 00226 -setSatSoundIn:(BOOL)yesOrNo; 00227 /* Controls whether sound is obtained from the satellites. Default is YES. */ 00228 00229 00243 - setDRAMAutoRefresh:(BOOL)yesOrNo; 00244 /* Controls whether DRAM auto refresh is on. Default is off. */ 00245 00246 00251 -(BOOL)DRAMAutoRefresh; 00252 00258 -(BOOL)satSoundIn; 00259 00265 -makeSatellitesPerform:(SEL)selector; 00266 00274 -makeSatellitesPerform:(SEL)selector with: (id) arg; 00275 00282 -makeQPPerform:(SEL)selector; 00283 00291 - makeQPPerform: (SEL) selector with: (id) arg; 00292 00306 - setDRAMAutoRefresh:(BOOL)yesOrNo; 00307 00308 @end 00309 00310 #import "MusicKit.h" 00311 00324 @interface ArielQPSat:MKOrchestra 00325 { 00326 BOOL hubSoundOut; /* YES if we're sending sound to the hub. */ 00327 NSDate * _reservedArielQPSat1; //sb: changed from double 00328 } 00329 00330 00335 -hub; 00336 00353 -setHubSoundOut:(BOOL)yesOrNo; 00354 /* Default is YES. Setting hubSoundOut disables serialSoundOut. 00355 * Must be invoked when the deviceStatus is closed. 00356 */ 00357 00358 00364 -(BOOL)hubSoundOut; 00365 00372 -(int)outputChannelOffset; 00373 00380 -(int)outputChannelCount; 00381 00388 -(int)outputInitialOffset; 00389 00396 -(BOOL)upSamplingOutput; 00397 00404 -(BOOL)isRealTime; 00405 /* 00406 * For all of these methods: 00407 * if hubSoundOut, forwards message to hubOrchestra. Otherwise, 00408 * invokes superclass implementation. 00409 */ 00410 00411 00419 -setSerialSoundOut:(BOOL)yesOrNo; 00420 00421 @end 00422 00423 #endif