aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Blechmann <timblech@users.sourceforge.net>2004-12-25 12:50:41 +0000
committerIOhannes m zmölnig <zmoelnig@iem.at>2015-10-14 15:11:57 +0200
commiteced45909ba691a454fec179360ec1c2663f773a (patch)
treed67d33d3fde0ac583ad01795e3e3736874fb13f4
parent5c3670b6322b60b8bc5f60e22d891fe39b854e3e (diff)
getting stable
svn path=/trunk/externals/tb/; revision=2429
-rw-r--r--chaos/src/Makefile.am3
-rw-r--r--chaos/src/chaos_dsp.hpp9
-rw-r--r--chaos/src/lorenz.hpp8
-rw-r--r--chaos/src/main.cpp3
4 files changed, 13 insertions, 10 deletions
diff --git a/chaos/src/Makefile.am b/chaos/src/Makefile.am
index efbb7f1..e1018bd 100644
--- a/chaos/src/Makefile.am
+++ b/chaos/src/Makefile.am
@@ -1,7 +1,8 @@
NAME = chaos
BUILT_SOURCES = main.cpp ode_base.cpp chaos_base.cpp chaos_dsp.cpp \
- lorenz_dsp.cpp logistic_dsp.cpp
+ lorenz_dsp.cpp lorenz_msg.cpp \
+ logistic_dsp.cpp logistic_msg.cpp
CXXFLAGS = @CXXFLAGS@ \
diff --git a/chaos/src/chaos_dsp.hpp b/chaos/src/chaos_dsp.hpp
index c340b88..f03f7c9 100644
--- a/chaos/src/chaos_dsp.hpp
+++ b/chaos/src/chaos_dsp.hpp
@@ -185,8 +185,7 @@ void chaos_dsp<system>::m_signal_n(int n, t_sample *const *insigs,
}
-/* linear and cubic interpolation adapted from supercollider by James McCartney */
-
+/* linear interpolation adapted from supercollider by James McCartney */
template <class system>
void chaos_dsp<system>::m_signal_l(int n, t_sample *const *insigs,
t_sample *const *outsigs)
@@ -226,6 +225,7 @@ void chaos_dsp<system>::m_signal_l(int n, t_sample *const *insigs,
}
+/* linear interpolation adapted from Numerical Recipes In C */
template <class system>
void chaos_dsp<system>::m_signal_c(int n, t_sample *const *insigs,
t_sample *const *outsigs)
@@ -253,10 +253,9 @@ void chaos_dsp<system>::m_signal_c(int n, t_sample *const *insigs,
m_nextmidpts[j] = (m_values[j] + value) * 0.5f;
float fseglen = (float)phase;
- m_curves[j] = 2.f * (m_nextmidpts[j] - m_values[j] - fseglen * m_slopes[j])
+ m_curves[j] = 2.f * (m_nextmidpts[j] - m_values[j] -
+ fseglen * m_slopes[j])
/ (fseglen * fseglen + fseglen);
-
- m_values[j] = value;
}
}
diff --git a/chaos/src/lorenz.hpp b/chaos/src/lorenz.hpp
index fdae428..a31c151 100644
--- a/chaos/src/lorenz.hpp
+++ b/chaos/src/lorenz.hpp
@@ -35,10 +35,10 @@ public:
m_data = new data_t[m_num_eq];
CHAOS_SYS_INIT(method,0);
- CHAOS_SYS_INIT(dt,1);
+ CHAOS_SYS_INIT(dt,0.01);
CHAOS_SYS_INIT(x1,0.8);
- CHAOS_SYS_INIT(x2,0.8);
- CHAOS_SYS_INIT(x3,0.8);
+ CHAOS_SYS_INIT(x2,0.7);
+ CHAOS_SYS_INIT(x3,0.6);
CHAOS_SYS_INIT(sigma,16);
CHAOS_SYS_INIT(b,4);
CHAOS_SYS_INIT(r,40);
@@ -60,7 +60,7 @@ public:
deriv[0] = CHAOS_PARAMETER(sigma) * (x2 - x1);
deriv[1] = - x1 * x3 + CHAOS_PARAMETER(r) * x1 - x2;
- deriv[3] = x1 * x2 - CHAOS_PARAMETER(b) * x3;
+ deriv[2] = x1 * x2 - CHAOS_PARAMETER(b) * x3;
}
CHAOS_SYSVAR_FUNCS(x1, 0);
diff --git a/chaos/src/main.cpp b/chaos/src/main.cpp
index 3a322f0..42dc16d 100644
--- a/chaos/src/main.cpp
+++ b/chaos/src/main.cpp
@@ -25,7 +25,10 @@ void chaos_library_setup()
post("chaos~ version "PACKAGE_VERSION"\n");
FLEXT_DSP_SETUP(lorenz_dsp);
+ FLEXT_SETUP(lorenz_msg);
+
FLEXT_DSP_SETUP(logistic_dsp);
+ FLEXT_SETUP(logistic_msg);
}
FLEXT_LIB_SETUP(chaos, chaos_library_setup);