MusicKit  0.0.0
Wave1i.h
00001 /*
00002   $Id$
00003   
00004   Defined In: The MusicKit
00005   Description:
00006     (See discussion below)
00007 
00008   Original Author: David A. 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-2005, The MusicKit Project.
00014 */
00077 #import <MusicKit/MKSynthPatch.h>
00078 #import <MusicKit/MKWaveTable.h>
00079 #import <MusicKit/MKEnvelope.h>
00080 
00081 @interface Wave1i: MKSynthPatch
00082 {
00083     /* Instance variables for the parameters to which the MKSynthPatch 
00084        responds. */
00085 
00086     MKWaveTable *waveform;    /* Carrier waveform */
00087 
00088     MKEnvelope *ampEnv; /* Amplitude envelope. */ 
00089     double amp0;      /* Amplitude when ampEnv is at 0 */
00090     double amp1;      /* Amplitude when ampEnv is at 1 */
00091     double ampAtt;    /* ampEnv attack time or MK_NODVAL for 'not set'. */
00092     double ampRel;    /* ampEnv release time or MK_NODVAL for 'not set'. */
00093 
00094     MKEnvelope *freqEnv; /* Frequency envelope. */
00095     double freq0;     /* Frequency when freqEnv is at 0. */
00096     double freq1;     /* Frequency when freqEnv is at 1. */
00097     double freqAtt;   /* freqEnv attack time or MK_NODVAL for 'not set'. */
00098     double freqRel;   /* freqEnv release time or MK_NODVAL for 'not set'. */
00099 
00100     double bearing;   /* Left/right panning. -45 to 45. */
00101 
00102     double portamento;/* Transition time upon rearticulation, in seconds. */
00103 
00104     double phase;     /* Initial phase in degrees */
00105 
00106     double velocitySensitivity; /* Sensitivity to velocity. Scale of 0 to 1 */
00107     double pitchbendSensitivity; /* Sensitivity to pitchBend in semitones. */
00108 
00109     int velocity;     /* MIDI velocity. Boosts or attenuates amplitude. */
00110     int pitchbend;    /* MIDI pitchBend. Raises or lowers pitch. */
00111     int volume;       /* MIDI volume pedal. Anything less than full pedal 
00112                          functions as an attenuation. */
00113 
00114     int wavelen;      /* WaveTable size. Rarely needed. */
00115     void *_reservedWave1i;
00116 }
00117 
00118 /* Default parameter values, if corresponding parameter is omitted: 
00119    
00120    waveform - sine wave
00121 
00122    ampEnv - none
00123    amp0 - 0
00124    amp1 - 0.1
00125    ampAtt - not set (use times specified in envelope directly)
00126    ampRel - not set (use times specified in envelope directly)
00127 
00128    freqEnv - none
00129    freq0 - 0.0 Hz.
00130    freq1 - 440.0 Hz.
00131    freqAtt - not set (use times specified in envelope directly)
00132    freqRel - not set (use times specified in envelope directly)
00133 
00134    bearing - 0.0
00135 
00136    portamento - not set (use times specified in envelope directly)
00137 
00138    phase - 0.0 degrees
00139 
00140    velocitySensitivity - 0.5 of maximum
00141    pitchbendSensitivity - 3.0 semitones
00142 
00143    velocity - no boost or attenuation (64)
00144    pitchbend - no bend (MIDI_ZEROBEND -- see <midi/midi_types.h>)
00145    volume - no attenuation (127)
00146 
00147    wavelen - automatically-selected value
00148 */
00149 
00150 /* The methods are all explained in the class description for MKSynthPatch */
00151 
00159 + patchTemplateFor: (MKNote *) currentNote;
00160 
00161 -init;
00162 -controllerValues:controllers;
00163 
00173 - noteOnSelf: (MKNote *) aNote;
00174 
00180 - preemptFor: (MKNote *) aNote;
00181 
00190 - noteUpdateSelf: (MKNote *) aNote;
00191 
00201 - (double) noteOffSelf: (MKNote *) aNote;
00202 
00207 - noteEndSelf;
00208 
00209 @end