AdditiveInstrument.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 #ifndef INCLUDE_ADDITIVE_Instrument_H
00024 #define INCLUDE_ADDITIVE_Instrument_H
00025 
00026 #include "Instrument.h"
00027 #include "Mixer.h"
00028 
00029 namespace csl  {
00030 
00034 
00035 class AdditiveInstrument : public Instrument {
00036 public:
00037     AdditiveInstrument();           
00038     AdditiveInstrument(SumOfSines & sos);
00039     AdditiveInstrument(unsigned numHarms, float noise);
00040     AdditiveInstrument(SHARCSpectrum & spect);
00041 
00042     AdditiveInstrument(AdditiveInstrument&);        
00043     ~AdditiveInstrument();
00045     void setParameter(unsigned selector, int argc, void **argv, const char *types);
00047     void playOSC(int argc, void **argv, const char *types); 
00048     
00049     void playNote(float dur = 1, float ampl = 1, 
00050                 float c_fr = 110, float pos = 0,
00051                 float att = 0.05, float dec = 0.05, float sus = 0.5, float rel = 0.5);
00052     void playMIDI(float dur, int chan, int key, int vel);   
00053 
00054     ADSR mAEnv;                 
00055     SumOfSines mSOS;            
00056     Panner mPanner;             
00057     
00058 protected:
00059     void init();
00060 };
00061 
00069 
00070 class VAdditiveInstrument : public Instrument {
00071 public:
00072     VAdditiveInstrument();          
00073     VAdditiveInstrument(SumOfSines & sos1, SumOfSines & sos2);
00074     VAdditiveInstrument(VAdditiveInstrument&);      
00075     ~VAdditiveInstrument();
00077     void setParameter(unsigned selector, int argc, void **argv, const char *types);
00079     void playOSC(int argc, void **argv, const char *types); 
00080     
00081     void playNote(float dur = 1, float ampl = 1, 
00082                 float c_fr = 110, float pos = 0,
00083                 float att = 0.05, float dec = 0.05, float sus = 0.5, float rel = 0.5);
00084     void playMIDI(float dur, int chan, int key, int vel);   
00085 
00086     ADSR mAEnv;                 
00087     AR mXEnv;                   
00088     SumOfSines mSOS1, mSOS2;    
00089     Panner mPanner;             
00090 };
00091 
00092 }
00093 
00094 #endif

Generated on Sat Oct 17 14:12:30 2009 for CSL by  doxygen 1.4.5-20051010