Home Information Classes Download Usage Mail List Requirements Links Tutorial

# Sampler.h

    00001 /***************************************************/
    00010 /***************************************************/
    00011
    00012 #if !defined(__SAMPLER_H)
    00013 #define __SAMPLER_H
    00014
    00015 #include "Instrmnt.h"
    00016 #include "ADSR.h"
    00017 #include "WvIn.h"
    00018 #include "WaveLoop.h"
    00019 #include "OnePole.h"
    00020
    00021 class Sampler : public Instrmnt
    00022 {
    00023  public:
    00025   Sampler();
    00026
    00028   virtual ~Sampler();
    00029
    00031   void clear();
    00032
    00034   virtual void setFrequency(MY_FLOAT frequency) = 0;
    00035
    00037   void keyOn();
    00038
    00040   void keyOff();
    00041
    00043   virtual void noteOff(MY_FLOAT amplitude);
    00044
    00046   virtual MY_FLOAT tick();
    00047
    00049   virtual void controlChange(int number, MY_FLOAT value) = 0;
    00050
    00051  protected:
    00052   ADSR     *adsr;
    00053   WvIn     *attacks[5];
    00054   WaveLoop *loops[5];
    00055   OnePole  *filter;
    00056   MY_FLOAT baseFrequency;
    00057   MY_FLOAT attackRatios[5];
    00058   MY_FLOAT loopRatios[5];
    00059   MY_FLOAT attackGain;
    00060   MY_FLOAT loopGain;
    00061   int whichOne;
    00062
    00063 };
    00064
    00065 #endif

The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.