From 5c3670b6322b60b8bc5f60e22d891fe39b854e3e Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Fri, 24 Dec 2004 23:20:22 +0000 Subject: more changes ... getting stable ... svn path=/trunk/externals/tb/; revision=2428 --- chaos/src/chaos_dsp.hpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'chaos/src/chaos_dsp.hpp') diff --git a/chaos/src/chaos_dsp.hpp b/chaos/src/chaos_dsp.hpp index 65e6203..c340b88 100644 --- a/chaos/src/chaos_dsp.hpp +++ b/chaos/src/chaos_dsp.hpp @@ -60,12 +60,12 @@ public: int m_phase; /* phase counter */ float m_sr; /* sample rate */ - char m_method; /* interpolation method */ + int m_method; /* interpolation method */ }; -/* create constructor / destructor */ \ +/* create constructor / destructor */ #define CHAOS_DSP_INIT(SYSTEM, ATTRIBUTES) \ FLEXT_HEADER(SYSTEM##_dsp, chaos_dsp) \ \ @@ -87,7 +87,10 @@ SYSTEM##_dsp(int argc, t_atom* argv ) \ 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; \ } \ \ @@ -99,21 +102,23 @@ SYSTEM##_dsp(int argc, t_atom* argv ) \ delete m_nextvalues; \ delete m_nextmidpts; \ delete m_curves; \ -} - +} \ + \ +FLEXT_ATTRVAR_F(m_freq); \ +FLEXT_ATTRVAR_I(m_method); template void chaos_dsp::m_signal(int n, t_sample *const *insigs, - t_sample *const *outsigs) + t_sample *const *outsigs) { if (m_freq >= m_sr * 0.5) { m_signal_(n, insigs, outsigs); return; } - + switch (m_method) { case 0: @@ -157,7 +162,7 @@ void chaos_dsp::m_signal_n(int n, t_sample *const *insigs, while (n) { - if (m_phase == 0) + if (phase == 0) { m_system->m_step(); phase = int (m_sr / m_freq); @@ -194,7 +199,7 @@ void chaos_dsp::m_signal_l(int n, t_sample *const *insigs, while (n) { - if (m_phase == 0) + if (phase == 0) { m_system->m_step(); phase = int (m_sr / m_freq); @@ -233,7 +238,7 @@ void chaos_dsp::m_signal_c(int n, t_sample *const *insigs, while (n) { - if (m_phase == 0) + if (phase == 0) { m_system->m_step(); phase = int (m_sr / m_freq); -- cgit v1.2.1