[PD-cvs] externals/chaos/src duffing_map.hpp,NONE,1.1 duffing_map_dsp.cpp,NONE,1.1 duffing_map_msg.cpp,NONE,1.1 latoocarfian.hpp,NONE,1.1 latoocarfian_dsp.cpp,NONE,1.1 latoocarfian_msg.cpp,NONE,1.1 latoomutalpha.hpp,NONE,1.1 latoomutalpha_dsp.cpp,NONE,1.1 latoomutalpha_msg.cpp,NONE,1.1 latoomutbeta.hpp,NONE,1.1 latoomutbeta_dsp.cpp,NONE,1.1 latoomutbeta_msg.cpp,NONE,1.1 latoomutgamma.hpp,NONE,1.1 latoomutgamma_dsp.cpp,NONE,1.1 latoomutgamma_msg.cpp,NONE,1.1 Makefile.am,1.6,1.7 chaos.hpp,1.4,1.5 chaos_defs.hpp,1.2,1.3 chaos_dsp.hpp,1.5,1.6 logistic_map.hpp,1.4,1.5 main.cpp,1.6,1.7

Tim Blechmann timblech at users.sourceforge.net
Tue Dec 28 13:38:47 CET 2004


Update of /cvsroot/pure-data/externals/chaos/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32207

Modified Files:
	Makefile.am chaos.hpp chaos_defs.hpp chaos_dsp.hpp 
	logistic_map.hpp main.cpp 
Added Files:
	duffing_map.hpp duffing_map_dsp.cpp duffing_map_msg.cpp 
	latoocarfian.hpp latoocarfian_dsp.cpp latoocarfian_msg.cpp 
	latoomutalpha.hpp latoomutalpha_dsp.cpp latoomutalpha_msg.cpp 
	latoomutbeta.hpp latoomutbeta_dsp.cpp latoomutbeta_msg.cpp 
	latoomutgamma.hpp latoomutgamma_dsp.cpp latoomutgamma_msg.cpp 
Log Message:
a few new attractors ...

Index: main.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/chaos/src/main.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** main.cpp	27 Dec 2004 22:55:41 -0000	1.6
--- main.cpp	28 Dec 2004 12:38:45 -0000	1.7
***************
*** 32,42 ****
  	CHAOS_ADD(driven_anharmonic);
  	CHAOS_ADD(driven_van_der_pol);
  	CHAOS_ADD(gauss_map);
  	CHAOS_ADD(henon);
  	CHAOS_ADD(ikeda_laser_map);
  	CHAOS_ADD(logistic);
  	CHAOS_ADD(lorenz);
  	CHAOS_ADD(lozi_map);
! 	CHAOS_ADD(roesser);
  	CHAOS_ADD(sine_map);
  	CHAOS_ADD(standard_map);
--- 32,47 ----
  	CHAOS_ADD(driven_anharmonic);
  	CHAOS_ADD(driven_van_der_pol);
+ 	CHAOS_ADD(duffing_map);
  	CHAOS_ADD(gauss_map);
  	CHAOS_ADD(henon);
  	CHAOS_ADD(ikeda_laser_map);
+ 	CHAOS_ADD(latoocarfian);
+ 	CHAOS_ADD(latoomutalpha);
+ 	CHAOS_ADD(latoomutbeta);
+ 	CHAOS_ADD(latoomutgamma);
  	CHAOS_ADD(logistic);
  	CHAOS_ADD(lorenz);
  	CHAOS_ADD(lozi_map);
! 	CHAOS_ADD(roessler);
  	CHAOS_ADD(sine_map);
  	CHAOS_ADD(standard_map);

--- NEW FILE: latoocarfian.hpp ---
// 
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "map_base.hpp"
#include <cmath>

//  latoocarfian model: x1[n+1] = sin(x2[n]*b) + c*sin(x1[n]*b)
//                      x2[n+1] = sin(x1[n]*a) + d*sin(x2[n]*a)
//                      -3 < a,b < 3
//                      -0.5 < c,d < 1.5
//  taken from Pickover: Chaos In Wonderland

class latoocarfian
	: public map_base
{
public:
	latoocarfian()
	{
		m_num_eq = 2;
		m_data = new data_t[m_num_eq];

		CHAOS_SYS_INIT(x1,0.5);
		CHAOS_SYS_INIT(x2,0);
		CHAOS_SYS_INIT(a,-0.966918);
		CHAOS_SYS_INIT(b,2.879879);
		CHAOS_SYS_INIT(c,0.765145);
		CHAOS_SYS_INIT(d,0.744728);
	}
	
	~latoocarfian()
	{
		delete m_data;
	}

	virtual void m_step()
	{
		data_t x1 = m_data[0], x2 = m_data[1];
		data_t a = CHAOS_PARAMETER(a), b = CHAOS_PARAMETER(b),
			c = CHAOS_PARAMETER(c), d = CHAOS_PARAMETER(d);
		
		m_data[0] = sin(x2*b) + c*sin(x1*b);
		m_data[1] = sin(x1*a) + d*sin(x2*a);
	}

	CHAOS_SYSVAR_FUNCS(x1, 0);
	CHAOS_SYSVAR_FUNCS(x2, 1);

	CHAOS_SYSPAR_FUNCS_PRED(a,m_pred_1);
	CHAOS_SYSPAR_FUNCS_PRED(b,m_pred_1);
	CHAOS_SYSPAR_FUNCS_PRED(c,m_pred_2);
	CHAOS_SYSPAR_FUNCS_PRED(d,m_pred_2);

	bool m_pred_1(t_float f)
	{
		return (f > -3.f) && (f < 3.f);
	}

	bool m_pred_2(t_float f)
	{
		return (f > -0.5) && (f < 1.5);
	}
};


#define LATOOCARFIAN_CALLBACKS					\
MAP_CALLBACKS;									\
CHAOS_SYS_CALLBACKS(x1);						\
CHAOS_SYS_CALLBACKS(x2);						\
CHAOS_SYS_CALLBACKS(a);							\
CHAOS_SYS_CALLBACKS(b);							\
CHAOS_SYS_CALLBACKS(c);							\
CHAOS_SYS_CALLBACKS(d);

#define LATOOCARFIAN_ATTRIBUTES					\
MAP_ATTRIBUTES;									\
CHAOS_SYS_ATTRIBUTE(x1);						\
CHAOS_SYS_ATTRIBUTE(x2);						\
CHAOS_SYS_ATTRIBUTE(a);							\
CHAOS_SYS_ATTRIBUTE(b);							\
CHAOS_SYS_ATTRIBUTE(c);							\
CHAOS_SYS_ATTRIBUTE(d);

--- NEW FILE: latoocarfian_msg.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "latoocarfian.hpp"
#include "chaos_msg.hpp"

CHAOS_MSG_CLASS(latoocarfian,LATOOCARFIAN);

--- NEW FILE: latoomutbeta.hpp ---
// 
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "map_base.hpp"
#include <cmath>

//  latoocarfian model, mutation beta:
//           x1[n+1] = sin(x2[n]*b) + pow(sin(x1[n]*b),2)
//           x2[n+1] = sin(x1[n]*a) + pow(sin(x2[n]*a),2)
//  taken from Pickover: Chaos In Wonderland

class latoomutbeta
	: public map_base
{
public:
	latoomutbeta()
	{
		m_num_eq = 2;
		m_data = new data_t[m_num_eq];

		CHAOS_SYS_INIT(x1,0.5);
		CHAOS_SYS_INIT(x2,0.5);
		CHAOS_SYS_INIT(a,-0.966918);
		CHAOS_SYS_INIT(b,2.879879);
	}
	
	~latoomutbeta()
	{
		delete m_data;
	}

	virtual void m_step()
	{
		data_t x1 = m_data[0], x2 = m_data[1];
		data_t a = CHAOS_PARAMETER(a), b = CHAOS_PARAMETER(b);
		data_t tmp;
		
		tmp = sin(x1*b);
		m_data[0] = sin(x2*b) + tmp*tmp;
		tmp = sin(x2*a);
		m_data[1] = sin(x1*a) + tmp*tmp;
	}

	CHAOS_SYSVAR_FUNCS(x1, 0);
	CHAOS_SYSVAR_FUNCS(x2, 1);

	CHAOS_SYSPAR_FUNCS(a);
	CHAOS_SYSPAR_FUNCS(b);
};


#define LATOOMUTBETA_CALLBACKS					\
MAP_CALLBACKS;									\
CHAOS_SYS_CALLBACKS(x1);						\
CHAOS_SYS_CALLBACKS(x2);						\
CHAOS_SYS_CALLBACKS(a);							\
CHAOS_SYS_CALLBACKS(b);


#define LATOOMUTBETA_ATTRIBUTES					\
MAP_ATTRIBUTES;									\
CHAOS_SYS_ATTRIBUTE(x1);						\
CHAOS_SYS_ATTRIBUTE(x2);						\
CHAOS_SYS_ATTRIBUTE(a);							\
CHAOS_SYS_ATTRIBUTE(b);


--- NEW FILE: duffing_map_msg.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "duffing_map.hpp"
#include "chaos_msg.hpp"

CHAOS_MSG_CLASS(duffing_map,DUFFING_MAP);

--- NEW FILE: latoomutbeta_msg.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "latoomutbeta.hpp"
#include "chaos_msg.hpp"

CHAOS_MSG_CLASS(latoomutbeta,LATOOMUTBETA);

--- NEW FILE: latoocarfian_dsp.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "latoocarfian.hpp"
#include "chaos_dsp.hpp"

CHAOS_DSP_CLASS(latoocarfian,LATOOCARFIAN);

Index: chaos.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/chaos/src/chaos.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** chaos.hpp	27 Dec 2004 22:55:41 -0000	1.4
--- chaos.hpp	28 Dec 2004 12:38:45 -0000	1.5
***************
*** 29,34 ****
  #ifdef DOUBLE_PRECISION
  typedef double data_t;
  #else
! typedef t_float data_t;
  #endif
  
--- 29,36 ----
  #ifdef DOUBLE_PRECISION
  typedef double data_t;
+ #define CHAOS_ABS(x) fabs(x)
  #else
! typedef float data_t;
! #define CHAOS_ABS(x) fabsf(x)
  #endif
  

Index: chaos_defs.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/chaos/src/chaos_defs.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** chaos_defs.hpp	27 Dec 2004 22:55:41 -0000	1.2
--- chaos_defs.hpp	28 Dec 2004 12:38:45 -0000	1.3
***************
*** 107,110 ****
--- 107,111 ----
  }												\
  FLEXT_CALLVAR_F(get_##NAME, set_##NAME);
+ 
   
  #define CHAOS_SYS_CALLBACKS_I(NAME)				\

Index: logistic_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/chaos/src/logistic_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** logistic_map.hpp	24 Dec 2004 23:20:22 -0000	1.4
--- logistic_map.hpp	28 Dec 2004 12:38:45 -0000	1.5
***************
*** 32,36 ****
  	{
  		m_num_eq = 1;
! 		m_data = new data_t[1];
  		CHAOS_SYS_INIT(alpha, 3.8);
  		CHAOS_SYS_INIT(x, 0.5);
--- 32,36 ----
  	{
  		m_num_eq = 1;
! 		m_data = new data_t[m_num_eq];
  		CHAOS_SYS_INIT(alpha, 3.8);
  		CHAOS_SYS_INIT(x, 0.5);

Index: chaos_dsp.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/chaos/src/chaos_dsp.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** chaos_dsp.hpp	27 Dec 2004 14:44:11 -0000	1.5
--- chaos_dsp.hpp	28 Dec 2004 12:38:45 -0000	1.6
***************
*** 61,120 ****
  	float m_sr;          /* sample rate */
  	
! 	int m_method;       /* interpolation method */
  	
  };
  
  
  /* create constructor / destructor */
! #define CHAOS_DSP_INIT(SYSTEM, ATTRIBUTES)		\
! FLEXT_HEADER(SYSTEM##_dsp, chaos_dsp<SYSTEM>)	\
! 												\
! SYSTEM##_dsp(int argc, t_atom* argv )			\
! {												\
! 	m_system = new SYSTEM;						\
! 												\
! 	int size = m_system->get_num_eq();			\
! 												\
! 	m_values = new t_float[size];				\
! 	m_slopes = new t_float[size];				\
! 	m_nextvalues = new t_float[size];			\
! 	m_nextmidpts = new t_float[size];			\
! 	m_curves = new t_float[size];				\
! 												\
!     /* create inlets and zero arrays*/ 			\
!     for (int i = 0; i != size; ++i)				\
! 	{											\
! 		AddOutSignal();							\
! 		m_values[i] = 0;						\
! 		m_slopes[i] = 0;						\
! 		m_nextvalues[i] = 0;					\
! 		m_nextmidpts[i] = 0;					\
! 		m_curves[i] = 0;						\
! 	}											\
! 												\
! 												\
! 												\
!     m_freq = GetAFloat(argv[0]);				\
! 	m_method = (char)GetAFloat(argv[1]);		\
!     m_phase = 0;								\
! 												\
!     FLEXT_ADDATTR_VAR1("frequency",m_freq);		\
!     FLEXT_ADDATTR_VAR1("method",m_method);		\
! 												\
!     ATTRIBUTES;									\
! }												\
! 												\
! ~SYSTEM##_dsp()									\
! {												\
! 	delete m_system;							\
! 	delete m_values;							\
! 	delete m_slopes;							\
! 	delete m_nextvalues;						\
! 	delete m_nextmidpts;						\
! 	delete m_curves;							\
! }												\
! 												\
! FLEXT_ATTRVAR_F(m_freq);						\
! FLEXT_ATTRVAR_I(m_method);
  
  
--- 61,176 ----
  	float m_sr;          /* sample rate */
  	
! 	int m_imethod;       /* interpolation method */
! 
! 	int get_imethod(int &i)
! 	{
! 		i = m_imethod;
! 	}
! 
! 	void set_imethod(int i)
! 	{
! 		if( (i >= 0) && (i <= 2) )
! 			m_imethod = i;
! 		else
! 		{
! 			post("interpolation method out of range");
! 			return;
! 		}
! 		if( i != 2)
! 		{
! 			for (int j = 0; j != m_system->get_num_eq(); ++j)
! 			{
! 				m_nextvalues[i] = 0;
! 				m_nextmidpts[i] = 0;
! 				m_curves[i] = 0;
! 			}
! 		}
! 
! 	}
! 
! 	int get_freq(float &f)
! 	{
! 		f = m_freq;
! 	}
! 
! 	void set_freq(float f)
! 	{
! 		if( (f >= 0) && (f <= m_sr*0.5) )
! 			m_freq = f;
! 		else
! 			post("frequency out of range");
! 	}
  	
+ 	FLEXT_CALLVAR_F(get_freq, set_freq);
+ 	FLEXT_CALLVAR_I(get_imethod, set_imethod);
  };
  
  
  /* create constructor / destructor */
! #define CHAOS_DSP_INIT(SYSTEM, ATTRIBUTES)									\
! FLEXT_HEADER(SYSTEM##_dsp, chaos_dsp<SYSTEM>)								\
! 																			\
! SYSTEM##_dsp(int argc, t_atom* argv )										\
! {																			\
!     m_sr = 44100; /* assume default sampling rate (for max frequency) */	\
! 	m_system = new SYSTEM;													\
! 																			\
! 	int size = m_system->get_num_eq();										\
! 																			\
! 	m_values = new t_float[size];											\
! 	m_slopes = new t_float[size];											\
! 	m_nextvalues = new t_float[size];										\
! 	m_nextmidpts = new t_float[size];										\
! 	m_curves = new t_float[size];											\
! 																			\
!     /* create inlets and zero arrays*/										\
!     for (int i = 0; i != size; ++i)											\
! 	{																		\
! 		AddOutSignal();														\
! 		m_values[i] = 0;													\
! 		m_slopes[i] = 0;													\
! 		m_nextvalues[i] = 0;												\
! 		m_nextmidpts[i] = 0;												\
! 		m_curves[i] = 0;													\
! 	}																		\
! 																			\
!     FLEXT_ADDATTR_VAR("frequency", get_freq, set_freq);						\
!     FLEXT_ADDATTR_VAR("interpolation_method",get_imethod, set_imethod);		\
! 																			\
!     if (argc > 0)															\
! 	{																		\
! 		CHAOS_SYS_INIT(freq, GetAInt(argv[0]));								\
! 	}																		\
!     else																	\
! 	{																		\
! 		CHAOS_SYS_INIT(freq, 440);											\
! 	}																		\
! 																			\
! 	if (argc > 1)															\
! 	{																		\
! 		CHAOS_SYS_INIT(imethod, GetAInt(argv[1]));							\
! 	}																		\
!     else																	\
!     {																		\
! 		CHAOS_SYS_INIT(imethod, 0);											\
!     }																		\
! 																			\
!     m_phase = 0;															\
! 																			\
!     ATTRIBUTES;																\
! }																			\
! 																			\
! ~SYSTEM##_dsp()																\
! {																			\
! 	delete m_system;														\
! 	delete m_values;														\
! 	delete m_slopes;														\
! 	delete m_nextvalues;													\
! 	delete m_nextmidpts;													\
! 	delete m_curves;														\
! }																			\
! 																			\
! FLEXT_ATTRVAR_F(m_freq);													\
! FLEXT_ATTRVAR_I(m_imethod);
  
  
***************
*** 130,134 ****
  	}
  
! 	switch (m_method)
  	{
  	case 0:
--- 186,190 ----
  	}
  
! 	switch (m_imethod)
  	{
  	case 0:

Index: Makefile.am
===================================================================
RCS file: /cvsroot/pure-data/externals/chaos/src/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Makefile.am	27 Dec 2004 22:55:40 -0000	1.6
--- Makefile.am	28 Dec 2004 12:38:45 -0000	1.7
***************
*** 8,14 ****
--- 8,19 ----
  	driven_anharmonic_dsp.cpp driven_anharmonic_msg.cpp \
  	driven_van_der_pol_dsp.cpp driven_van_der_pol_msg.cpp \
+ 	duffing_map_dsp.cpp duffing_map_msg.cpp \
  	gauss_map_dsp.cpp gauss_map_msg.cpp \
  	henon_map_dsp.cpp henon_map_msg.cpp \
  	ikeda_laser_map_dsp.cpp ikeda_laser_map_msg.cpp \
+ 	latoocarfian_dsp.cpp latoocarfian_msg.cpp \
+ 	latoomutalpha_dsp.cpp latoomutalpha_msg.cpp \
+ 	latoomutbeta_dsp.cpp latoomutbeta_msg.cpp \
+ 	latoomutgamma_dsp.cpp latoomutgamma_msg.cpp \
  	logistic_dsp.cpp logistic_msg.cpp \
  	lorenz_dsp.cpp lorenz_msg.cpp \

--- NEW FILE: latoomutgamma_msg.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "latoomutgamma.hpp"
#include "chaos_msg.hpp"

CHAOS_MSG_CLASS(latoomutgamma,LATOOMUTGAMMA);

--- NEW FILE: latoomutgamma_dsp.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "latoomutgamma.hpp"
#include "chaos_dsp.hpp"

CHAOS_DSP_CLASS(latoomutgamma,LATOOMUTGAMMA);

--- NEW FILE: latoomutalpha.hpp ---
// 
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "map_base.hpp"
#include <cmath>

//  latoocarfian model, mutation alpha:
//           x1[n+1] = sin(x2[n]*b) + pow(sin(x1[n]*b),2) + pow(sin(x1[n]*b),3)
//           x2[n+1] = sin(x1[n]*a) + pow(sin(x2[n]*a),2) + pow(sin(x2[n]*c),3)
//  taken from Pickover: Chaos In Wonderland

class latoomutalpha
	: public map_base
{
public:
	latoomutalpha()
	{
		m_num_eq = 2;
		m_data = new data_t[m_num_eq];

		CHAOS_SYS_INIT(x1,0.5);
		CHAOS_SYS_INIT(x2,0.2);
		CHAOS_SYS_INIT(a,-0.966918);
		CHAOS_SYS_INIT(b,2.879879);
		CHAOS_SYS_INIT(c,0.765145);
	}
	
	~latoomutalpha()
	{
		delete m_data;
	}

	virtual void m_step()
	{
		data_t x1 = m_data[0], x2 = m_data[1];
		data_t a = CHAOS_PARAMETER(a), b = CHAOS_PARAMETER(b),
			c = CHAOS_PARAMETER(c);
		data_t tmp1, tmp2;
		
		tmp1 = sin(x1*b);
		m_data[0] = sin(x2*b) + tmp1*tmp1 + tmp1*tmp1*tmp1;
		tmp1 = sin(x2*a);
		tmp2 = sin(x2*c);
		m_data[1] = sin(x1*a) + tmp1*tmp1 + tmp2*tmp2*tmp2;
	}

	CHAOS_SYSVAR_FUNCS(x1, 0);
	CHAOS_SYSVAR_FUNCS(x2, 1);

	CHAOS_SYSPAR_FUNCS(a);
	CHAOS_SYSPAR_FUNCS(b);
	CHAOS_SYSPAR_FUNCS(c);
};


#define LATOOMUTALPHA_CALLBACKS					\
MAP_CALLBACKS;									\
CHAOS_SYS_CALLBACKS(x1);						\
CHAOS_SYS_CALLBACKS(x2);						\
CHAOS_SYS_CALLBACKS(a);							\
CHAOS_SYS_CALLBACKS(b);							\
CHAOS_SYS_CALLBACKS(c);


#define LATOOMUTALPHA_ATTRIBUTES				\
MAP_ATTRIBUTES;									\
CHAOS_SYS_ATTRIBUTE(x1);						\
CHAOS_SYS_ATTRIBUTE(x2);						\
CHAOS_SYS_ATTRIBUTE(a);							\
CHAOS_SYS_ATTRIBUTE(b);							\
CHAOS_SYS_ATTRIBUTE(c);

--- NEW FILE: latoomutalpha_msg.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "latoomutalpha.hpp"
#include "chaos_msg.hpp"

CHAOS_MSG_CLASS(latoomutalpha,LATOOMUTALPHA);

--- NEW FILE: latoomutgamma.hpp ---
// 
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "map_base.hpp"
#include <cmath>

//  latoocarfian model, mutation gamma:
//           x1[n+1] = abs(sin(x2[n]*b)) + pow(sin(x1[n]*b),2)
//           x2[n+1] = abs(sin(x1[n]*a)) + pow(sin(x2[n]*a),2)
//  taken from Pickover: Chaos In Wonderland

class latoomutgamma
	: public map_base
{
public:
	latoomutgamma()
	{
		m_num_eq = 2;
		m_data = new data_t[m_num_eq];

		CHAOS_SYS_INIT(x1,0.5);
		CHAOS_SYS_INIT(x2,0.5);
		CHAOS_SYS_INIT(a,-0.966918);
		CHAOS_SYS_INIT(b,2.879879);
	}
	
	~latoomutgamma()
	{
		delete m_data;
	}

	virtual void m_step()
	{
		data_t x1 = m_data[0], x2 = m_data[1];
		data_t a = CHAOS_PARAMETER(a), b = CHAOS_PARAMETER(b);
		data_t tmp;
		
		tmp = sin(x1*b);
		m_data[0] = CHAOS_ABS(sin(x2*b)) + tmp*tmp;
		tmp = sin(x2*a);
		m_data[1] = CHAOS_ABS(sin(x1*a)) + tmp*tmp;
	}

	CHAOS_SYSVAR_FUNCS(x1, 0);
	CHAOS_SYSVAR_FUNCS(x2, 1);

	CHAOS_SYSPAR_FUNCS(a);
	CHAOS_SYSPAR_FUNCS(b);
};


#define LATOOMUTGAMMA_CALLBACKS					\
MAP_CALLBACKS;									\
CHAOS_SYS_CALLBACKS(x1);						\
CHAOS_SYS_CALLBACKS(x2);						\
CHAOS_SYS_CALLBACKS(a);							\
CHAOS_SYS_CALLBACKS(b);


#define LATOOMUTGAMMA_ATTRIBUTES				\
MAP_ATTRIBUTES;									\
CHAOS_SYS_ATTRIBUTE(x1);						\
CHAOS_SYS_ATTRIBUTE(x2);						\
CHAOS_SYS_ATTRIBUTE(a);							\
CHAOS_SYS_ATTRIBUTE(b);


--- NEW FILE: duffing_map_dsp.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "duffing_map.hpp"
#include "chaos_dsp.hpp"

CHAOS_DSP_CLASS(duffing_map,DUFFING_MAP);

--- NEW FILE: latoomutalpha_dsp.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "latoomutalpha.hpp"
#include "chaos_dsp.hpp"

CHAOS_DSP_CLASS(latoomutalpha,LATOOMUTALPHA);

--- NEW FILE: duffing_map.hpp ---
// 
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "map_base.hpp"

//  duffing map: x1[n+1] = x2[n]
//               x2[n+1] = -b*x1[n] + a*x2[n] - pow(x2,3)
//  
//  taken from Viktor Avrutin: AnT-Demos-4.669

class duffing_map:
	public map_base
{
public:
	duffing_map()
	{
		m_num_eq = 2;
		m_data = new data_t[m_num_eq];
		CHAOS_SYS_INIT(x1, 0.5);
		CHAOS_SYS_INIT(x2, 0.5);
		CHAOS_SYS_INIT(a, 0.5);
		CHAOS_SYS_INIT(b, 0.5);
	}

	~duffing_map()
	{
		delete m_data;
	}

	virtual void m_step()
	{
		data_t x1 = m_data[0], x2 = m_data[1];

		m_data[0] = x2;
		m_data[1] = - CHAOS_PARAMETER(b)*x1 + CHAOS_PARAMETER(a)*x2
			- x2*x2*x2;
	}

	CHAOS_SYSVAR_FUNCS(x1,0);
	CHAOS_SYSVAR_FUNCS(x2,1);

	CHAOS_SYSPAR_FUNCS(a);
	CHAOS_SYSPAR_FUNCS(b);
};

#define DUFFING_MAP_CALLBACKS					\
MAP_CALLBACKS;									\
CHAOS_SYS_CALLBACKS(x1);						\
CHAOS_SYS_CALLBACKS(x2);						\
CHAOS_SYS_CALLBACKS(a);							\
CHAOS_SYS_CALLBACKS(b);

#define DUFFING_MAP_ATTRIBUTES					\
MAP_ATTRIBUTES;									\
CHAOS_SYS_ATTRIBUTE(x1);						\
CHAOS_SYS_ATTRIBUTE(x2);						\
CHAOS_SYS_ATTRIBUTE(a);							\
CHAOS_SYS_ATTRIBUTE(b);


--- NEW FILE: latoomutbeta_dsp.cpp ---
//
//  
//  chaos~
//  Copyright (C) 2004  Tim Blechmann
//  
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; see the file COPYING.  If not, write to
//  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
//  Boston, MA 02111-1307, USA.

#include "latoomutbeta.hpp"
#include "chaos_dsp.hpp"

CHAOS_DSP_CLASS(latoomutbeta,LATOOMUTBETA);





More information about the Pd-cvs mailing list