00001 /* 00002 * C S O U N D V S T 00003 * 00004 * A VST plugin version of Csound, with Python scripting. 00005 * 00006 * L I C E N S E 00007 * 00008 * This software is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This software is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this software; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 #ifndef STRANGEATTRACTOR_H 00023 #define STRANGEATTRACTOR_H 00024 00025 #include "Platform.hpp" 00026 #ifdef SWIG 00027 %module CsoundAC 00028 %{ 00029 #include "Silence.hpp" 00030 #include <string> 00031 #include <vector> 00032 #include <boost/random.hpp> 00033 #include <boost/numeric/ublas/matrix.hpp> 00034 %} 00035 %include "std_string.i" 00036 %include "std_vector.i" 00037 #else 00038 #include "Silence.hpp" 00039 #include <string> 00040 #include <vector> 00041 #include <boost/random.hpp> 00042 #include <boost/numeric/ublas/matrix.hpp> 00043 using namespace boost::numeric; 00044 #endif 00045 00046 namespace csound 00047 { 00057 class StrangeAttractor : 00058 public ScoreNode 00059 { 00060 protected: 00061 std::string code; 00062 std::string filename; 00063 int scoreType; 00064 int NMAX; 00065 std::vector<double> A; 00066 double AL; 00067 double COSAL; 00068 int D; 00069 int DD; 00070 double D2; 00071 double D2MAX; 00072 double decibels; 00073 double DF; 00074 double DL2; 00075 double DLW; 00076 double DLX; 00077 double DLY; 00078 double DLZ; 00079 double DUM; 00080 double DW; 00081 double DX; 00082 double DY; 00083 double DZ; 00084 double EPS; 00085 double F; 00086 int I; 00087 double instrument; 00088 int I1; 00089 int I2; 00090 int I3; 00091 int I4; 00092 int I5; 00093 int J; 00094 double L; 00095 double duration; 00096 double LSUM; 00097 int M; 00098 double MX; 00099 double MY; 00100 int N; 00101 double N1; 00102 double N2; 00103 double NL; 00104 int O; 00105 double octave; 00106 int ODE; 00107 int OMAX; 00108 int P; 00109 double x; 00110 double pitchClassSet; 00111 int PREV; 00112 double PT; 00113 double RAN; 00114 double RS; 00115 double SH; 00116 double SINAL; 00117 double time; 00118 double SW; 00119 int T; 00120 double TIA; 00121 double TT; 00122 int TWOD; 00123 //double TWOPI; 00124 std::vector<double> V; 00125 double W; 00126 double WE; 00127 double WMAX; 00128 double WMIN; 00129 double WNEW; 00130 double WP; 00131 std::vector<double> WS; 00132 double WSAVE; 00133 double X; 00134 double XA; 00135 double XE; 00136 double XH; 00137 double XL; 00138 double XMAX; 00139 double XMIN; 00140 std::vector<double> XN; 00141 double XNEW; 00142 double XP; 00143 std::vector<double> XS; 00144 double XSAVE; 00145 double XW; 00146 std::vector<double> XY; 00147 double XZ; 00148 double Y; 00149 double YA; 00150 double YE; 00151 double YH; 00152 double YL; 00153 double YMAX; 00154 double YMIN; 00155 double YNEW; 00156 double YP; 00157 std::vector<double> YS; 00158 double YSAVE; 00159 double YW; 00160 double YZ; 00161 double Z; 00162 double ZA; 00163 double ZE; 00164 double ZMAX; 00165 double ZMIN; 00166 double ZNEW; 00167 double ZP; 00168 std::vector<double> ZS; 00169 double ZSAVE; 00170 public: 00171 Random randomNode; 00172 StrangeAttractor(void); 00173 virtual ~StrangeAttractor(void); 00174 virtual void setCode(std::string code); 00175 virtual std::string getCode() const; 00176 virtual void setIterationCount(size_t iterationCount); 00177 virtual size_t getIterationCount() const; 00178 virtual void setIteration(size_t iteration); 00179 virtual size_t getIteration() const; 00190 virtual void setAttractorType(int attractorType); 00191 virtual int getAttractorType() const; 00192 virtual void setScoreType(int attractorType); 00193 virtual int getScoreType() const; 00194 virtual void initialize(); 00195 virtual void reinitialize(); 00196 virtual void reset(); 00197 virtual void codeRandomize(); 00198 virtual void specialFunctions(); 00199 virtual void getDimensionAndOrder(); 00200 virtual void getCoefficients(); 00201 virtual void shuffleRandomNumbers(); 00202 virtual void calculateLyupanovExponent(); 00203 virtual void calculateFractalDimension(); 00204 virtual double getFractalDimension() const; 00205 virtual double getLyupanovExponent() const; 00206 virtual void setX(double X); 00207 virtual double getX() const; 00208 virtual void setY(double X); 00209 virtual double getY() const; 00210 virtual void setZ(double X); 00211 virtual double getZ() const; 00212 virtual void setW(double X); 00213 virtual double getW() const; 00214 virtual bool searchForAttractor(); 00215 virtual bool evaluateAttractor(); 00216 virtual void iterate(); 00217 virtual void generate(); 00218 virtual void render (int N, double X, double Y, double Z, double W); 00219 virtual void setDimensionCount(int D); 00220 virtual int getDimensionCount() const; 00221 }; 00222 } 00223 00224 #endif