MusicKit  0.0.0
Fm1i.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 */
00167 #ifndef __MK_Fm1i_H___
00168 #define __MK_Fm1i_H___
00169 
00170 #import <MusicKit/MKSynthPatch.h>
00171 #import <MusicKit/MKEnvelope.h>
00172 #import <MusicKit/MKWaveTable.h>
00173 
00174 @interface Fm1i:MKSynthPatch
00175 {
00176     /* Instance variables for the parameters to which the MKSynthPatch 
00177        responds. */
00178 
00179     MKWaveTable *waveform;    /* Carrier waveform */
00180     MKWaveTable *m1Waveform;  /* Modulator waveform */
00181 
00182     double cRatio;    /* Carrier frequency scaler. */
00183     double m1Ratio;   /* Modulater frequency scaler. */
00184 
00185     MKEnvelope *ampEnv; /* Amplitude envelope. */ 
00186     double amp0;      /* Amplitude when ampEnv is at 0 */
00187     double amp1;      /* Amplitude when ampEnv is at 1 */
00188     double ampAtt;    /* ampEnv attack time or MK_NODVAL for 'not set'. */
00189     double ampRel;    /* ampEnv release time or MK_NODVAL for 'not set'. */
00190 
00191     MKEnvelope *freqEnv; /* Frequency envelope. */
00192     double freq0;     /* Frequency when freqEnv is at 0. */
00193     double freq1;     /* Frequency when freqEnv is at 1. */
00194     double freqAtt;   /* freqEnv attack time or MK_NODVAL for 'not set'. */
00195     double freqRel;   /* freqEnv release time or MK_NODVAL for 'not set'. */
00196 
00197     MKEnvelope *m1IndEnv;/* FM index envelope */
00198     double m1Ind0;    /* FM index when m1IndEnv is at 0 */
00199     double m1Ind1;    /* FM index when m1IndEnv is at 1 */
00200     double m1IndAtt;  /* m1IndEnv attack time or MK_NODVAL for 'not set'. */
00201     double m1IndRel;  /* m1IndEnv release time or MK_NODVAL for 'not set'. */
00202 
00203     double bright;    /* Brightness. A multiplier on index. */
00204 
00205     double bearing;   /* Left/right panning. -45 to 45. */
00206 
00207     double portamento;/* Transition time upon rearticulation, in seconds. */
00208 
00209     double phase;     /* Initial phase in degrees */
00210     double m1Phase;   /* Initial modulator phase in degrees */
00211 
00212     double velocitySensitivity; /* Sensitivity to velocity. Scale of 0 to 1 */
00213     double afterTouchSensitivity;/* Sensitivity to afterTouch. 0 to 1. */
00214     double pitchbendSensitivity; /* Sensitivity to pitchBend in semitones. */
00215 
00216     int velocity;     /* MIDI velocity. Boosts or attenuates amplitude. */
00217     int pitchbend;    /* MIDI pitchBend. Raises or lowers pitch. */
00218     int afterTouch;   /* MIDI afterTouch. Anything less than full after touch 
00219                          functions as an attenuation. */
00220     int volume;       /* MIDI volume pedal. Anything less than full pedal 
00221                          functions as an attenuation. */
00222 
00223     int wavelen;      /* WaveTable size. Rarely needed. */
00224     void *_reservedFm1i;
00225 }
00226 
00227 /* Default parameter values, if corresponding parameter is omitted: 
00228    
00229    waveform - sine wave
00230    m1Waveform - sine wave
00231 
00232    cRatio - 1.0
00233    m1Ratio - 1.0
00234 
00235    ampEnv - none
00236    amp0 - 0
00237    amp1 - 0.1
00238    ampAtt - not set (use times specified in envelope directly)
00239    ampRel - not set (use times specified in envelope directly)
00240 
00241    freqEnv - none
00242    freq0 - 0.0 Hz.
00243    freq1 - 440.0 Hz.
00244    freqAtt - not set (use times specified in envelope directly)
00245    freqRel - not set (use times specified in envelope directly)
00246 
00247    m1IndEnv - none
00248    m1Ind0 - 0.0
00249    m1Ind1 - 2.0
00250    m1IndAtt - not set (use times specified in envelope directly)
00251    m1IndRel - not set (use times specified in envelope directly)
00252 
00253    bright - 1.0
00254 
00255    bearing - 0.0
00256 
00257    portamento - not set (use times specified in envelope directly)
00258 
00259    phase - 0.0 deg
00260    m1Phase - 0.0 deg
00261 
00262    velocitySensitivity - 0.5 of maximum
00263    afterTouchSensitivity - 0.5 of maximum
00264    pitchbendSensitivity - 3.0 semitones
00265 
00266    velocity - no boost or attenuation (64)
00267    pitchbend - no bend (MIDI_ZEROBEND -- see <midi/midi_types.h>)
00268    afterTouch - no attenuation (127)
00269    volume - no attenuation (127)
00270 
00271    wavelen - automatically-selected value
00272 */
00273 
00274 /* The methods are all explained in the class description for MKSynthPatch */
00275 
00283 +patchTemplateFor: (id) currentNote;
00284 
00285 -init;
00286 -controllerValues:controllers;
00287 
00298 -noteOnSelf: (MKNote *) aNote;
00299 
00307 -preemptFor: (MKNote *) aNote;
00308 
00318 -noteUpdateSelf: (MKNote *) aNote;
00319 
00330 -(double)noteOffSelf: (MKNote *) aNote;
00331 
00338 -noteEndSelf;
00339 
00340 @end
00341 
00342 #endif