MusicKit  0.0.0
MKSamplePlayerInstrument.h
00001 /*
00002   $Id$
00003   Defined In: The MusicKit
00004 
00005   Description:
00006     Each MKSamplePlayerInstrument holds a collection of sound files indexed by noteTag.
00007     A MKNote has a MK_filename parameter which is the soundfile to be played, together with any
00008     particular tuning deviation to be applied to it using a keynumber or frequency which forms a ratio
00009     from the unity key number located in the (AIFF or ?WAV?). That does imply being able to load the file
00010     immediately (within the Delta) for playback. But then, we should be spooling from disk anyway.
00011 
00012   Original Author: Leigh M. Smith <leigh@tomandandy.com>
00013 
00014   Copyright (c) 1999 tomandandy, Inc.
00015   Permission is granted to use and modify this code for commercial and non-commercial
00016   purposes so long as the author attribution and this copyright message remains intact
00017   and accompanies all derived code.
00018 */
00019 #ifndef __MK_SamplerInstrument_H___
00020 #define __MK_SamplerInstrument_H___
00021 
00022 #import <SndKit/SndKit.h>
00023 #import "MKInstrument.h"
00024 
00025 @interface MKSamplePlayerInstrument: MKInstrument
00026 {
00027 @private
00028     double volume;
00029     double pitchBend;
00030     double pbSensitivity;
00031     BOOL preloadingEnabled;
00032 
00033     // TODO these are suspiciously GUI controls...
00034     id  preloadingSwitch;
00035     id  tieNotesSwitch;
00036     id  modeButtons;
00037     
00038     
00039     MKMsgStruct *startMessage, *stopMessage;
00040     char *directory;
00041 
00042     NSMutableDictionary *playingNotes;
00043     NSMutableArray *nameTable;
00044     BOOL sustained[128];
00045     int activeVoices;
00046     double amp;
00047     double bearing;
00048     int testKey;
00049     double pitchbendSensitivity;
00050     id soundOutDevice;
00051     BOOL damperOn;
00052     double velocitySensitivity;
00053 
00054     int voiceCount;
00055     int keyNum;                                 /* The current key number */
00056     BOOL diatonic;
00057     BOOL tieRepeats;
00058     float linearAmp;
00059         
00060     BOOL recordMode;
00061     int recordModeController;
00062     id recordModeInterface;
00063     int recordKey;
00064     int recordTag;
00065     Snd *recorder;
00066 }
00067 
00068 - init;
00069 - abort;
00070 
00075 - allNotesOff;
00076 
00077 - reset;
00078 - prepareSoundWithNote: (MKNote *) aNote;
00079 - (void) removePreparedSounds;
00080 - realizeNote: (MKNote *) aNote fromNoteReceiver: (MKNoteReceiver *) aNoteReceiver;
00081 
00082 // Snd delegate methods
00083 - (void) didPlay: (Snd *) sound duringPerformance: (SndPerformance *) performance;
00084 - (void) encodeWithCoder:(NSCoder *) coder;
00085 - (id) initWithCoder:(NSCoder *) decoder;
00086 - performerDidDeactivate: (id) sender;
00087 - performerDidActivate: (id) sender;
00088 
00089 @end
00090 
00091 
00092 #endif