MusicKit  0.0.0
MKEnvelope.h
00001 /*
00002   $Id$
00003   
00004   Defined In: The MusicKit
00005   Description:
00006     (See discussion below)
00007 
00008   Original Author: David Jaffe
00009 
00010   Copyright (c) 1988-1992, NeXT Computer, Inc.
00011   Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT
00012   Portions Copyright (c) 1994 Stanford University
00013   Portions Copyright (c) 1999-2001, The MusicKit Project.
00014 */
00126 #ifndef __MK_Envelope_H___
00127 #define __MK_Envelope_H___
00128 
00129 #import <Foundation/Foundation.h>
00130 
00138 typedef enum _MKEnvStatus { 
00140     MK_noMorePoints = -1,
00142     MK_noEnvError = 0,
00144     MK_stickPoint,
00146     MK_lastPoint
00147 } MKEnvStatus;
00148 
00149 @interface MKEnvelope : NSObject
00150 {
00152     double defaultSmoothing;
00154     double samplingPeriod;
00156     double *xArray;
00158     double *yArray;
00160     double *smoothingArray;
00162     int stickPoint;
00164     int pointCount;
00165 }
00166 
00171 
00182 - init; 
00183 
00190 
00195 - (int) pointCount;
00196 
00204 - (double) defaultSmoothing;
00205 
00213 - (double) samplingPeriod;
00214 
00219 - (int) stickPoint; 
00220 
00225 - (double *) yArray;
00226 
00232 - (double *) xArray;
00233 
00239 - (double *) smoothingArray;
00240 
00279 - (MKEnvStatus) getNth: (int) n
00280                      x: (double *) xPtr
00281                      y: (double *) yPtr
00282              smoothing: (double *) smoothingPtr; 
00283 
00299 - writeScorefileStream: (NSMutableData *) aStream; 
00300 
00314 - (double) lookupYForX: (double) xVal;
00315 
00322 - (double) lookupYForXAsymptotic: (double) xVal;
00323 
00333 - (double) releaseDur;
00334 
00344 - (double) attackDur;
00345 
00352 
00361 - setStickPoint: (int) stickPointIndex; 
00362 
00381 -    setPointCount: (int) n
00382             xArray: (double *) xPtr
00383   orSamplingPeriod: (double) period
00384             yArray: (double *) yPtr
00385     smoothingArray: (double *) smoothingPtr
00386 orDefaultSmoothing: (double) smoothing;
00387 
00401 - setPointCount: (int) n
00402          xArray: (double *) xPtr
00403          yArray: (double *) yPtr;
00404 
00407 @end
00408 
00409 #endif