00001 #ifndef MARSYAS_PHISEMSOURCE_H
00002 #define MARSYAS_PHISEMSOURCE_H
00003
00004 #include "MarSystem.h"
00005
00006 #include <cstdlib>
00007
00008 namespace Marsyas
00009 {
00010
00011 class PhiSEMSource: public MarSystem
00012 {
00013 private:
00014 MarControlPtr numObjects_;
00015 MarControlPtr systemDecay_;
00016 MarControlPtr soundDecay_;
00017 MarControlPtr baseGain_;
00018
00019
00020 mrs_real shakeEnergy_;
00021 mrs_real soundLevel_;
00022 mrs_real gain_;
00023 mrs_real temp_;
00024 int sample_;
00025
00026 void addControls();
00027 void myUpdate(MarControlPtr sender);
00028
00029 mrs_real noiseTick();
00030 mrs_real randomFloat(mrs_real max);
00031 int randomInt(int max);
00032
00033 mrs_real computeSample();
00034
00035 public:
00036 static const mrs_real MIN_ENERGY;
00037 static const mrs_real MAX_ENERGY;
00038
00039 PhiSEMSource(std::string name);
00040 PhiSEMSource(const PhiSEMSource& source);
00041 ~PhiSEMSource();
00042 MarSystem* clone() const;
00043
00044 void myProcess(realvec& in, realvec& out);
00045 };
00046
00047 }
00048
00049 #endif