Update of /cvsroot/pure-data/externals/creb/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19726/modules
Modified Files: Makefile bdiag~.c bfft~.c bitsplit~.c blocknorm~.c cheby~.c diag~.c dist~.c dynwav~.c eadsr~.c ead~.c ear~.c eblosc~.c extlib_util.h fdn~.c ffpoly.c filters.h lattice~.c permut~.c qmult~.c qnorm~.c resofilt~.c sbosc~.c scrollgrid1D~.c statwav~.c tabreadmix~.c Log Message: creb 0.9.2 import
Index: ear~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/ear~.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ear~.c 25 May 2006 17:01:41 -0000 1.3 --- ear~.c 15 Aug 2006 15:11:52 -0000 1.4 *************** *** 18,23 **** */
- #include <m_pd.h> - #include <math.h> #include "extlib_util.h"
--- 18,21 ---- *************** *** 143,177 **** }
- /* - * Utility functions for exponential decay - * Copyright (c) 2000-2003 by Tom Schouten - * - * 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; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - - //#include "extlib_util.h" - - float milliseconds_2_one_minus_realpole(float time) - { - float r; - - if (time < 0.0f) time = 0.0f; - r = -expm1(1000.0f * log(ENVELOPE_RANGE) / (sys_getsr() * time)); - if (!(r < 1.0f)) r = 1.0f; - - //post("%f",r); - return r; - } --- 141,142 ----
Index: eadsr~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/eadsr~.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eadsr~.c 25 May 2006 17:01:41 -0000 1.3 --- eadsr~.c 15 Aug 2006 15:11:52 -0000 1.4 *************** *** 18,23 **** */
- #include <m_pd.h> - #include <math.h> #include "extlib_util.h"
--- 18,21 ---- *************** *** 135,144 **** t_class *eadsr_class;
! void *eadsr_new(t_floatarg attack, t_floatarg decay, t_floatarg sustain, t_floatarg release) { t_eadsr *x = (t_eadsr *)pd_new(eadsr_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("attack")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("decay")); ! inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("sustain")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("release")); outlet_new(&x->x_obj, gensym("signal")); --- 133,143 ---- t_class *eadsr_class;
! void *eadsr_new(t_floatarg attack, t_floatarg decay, ! t_floatarg sustain, t_floatarg release) { t_eadsr *x = (t_eadsr *)pd_new(eadsr_class); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("attack")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("decay")); ! inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("sustain")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("release")); outlet_new(&x->x_obj, gensym("signal")); *************** *** 159,207 **** //post("eadsr~ v0.1"); eadsr_class = class_new(gensym("eadsr~"), (t_newmethod)eadsr_new, ! (t_method)eadsr_free, sizeof(t_eadsr), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_float, gensym("float"), A_FLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_start, gensym("start"), 0); class_addmethod(eadsr_class, (t_method)eadsr_start, gensym("bang"), 0); class_addmethod(eadsr_class, (t_method)eadsr_stop, gensym("stop"), 0); class_addmethod(eadsr_class, (t_method)eadsr_dsp, gensym("dsp"), 0); ! class_addmethod(eadsr_class, (t_method)eadsr_attack, gensym("attack"), A_FLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_decay, gensym("decay"), A_FLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_sustain, gensym("sustain"), A_FLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_release, gensym("release"), A_FLOAT, 0);
}
- /* - * Utility functions for exponential decay - * Copyright (c) 2000-2003 by Tom Schouten - * - * 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; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - - //#include "extlib_util.h" - - float milliseconds_2_one_minus_realpole(float time) - { - float r; - - if (time < 0.0f) time = 0.0f; - r = -expm1(1000.0f * log(ENVELOPE_RANGE) / (sys_getsr() * time)); - if (!(r < 1.0f)) r = 1.0f; - - //post("%f",r); - return r; - } --- 158,180 ---- //post("eadsr~ v0.1"); eadsr_class = class_new(gensym("eadsr~"), (t_newmethod)eadsr_new, ! (t_method)eadsr_free, sizeof(t_eadsr), 0, A_DEFFLOAT, ! A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_float, ! gensym("float"), A_FLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_start, ! gensym("start"), 0); class_addmethod(eadsr_class, (t_method)eadsr_start, gensym("bang"), 0); class_addmethod(eadsr_class, (t_method)eadsr_stop, gensym("stop"), 0); class_addmethod(eadsr_class, (t_method)eadsr_dsp, gensym("dsp"), 0); ! class_addmethod(eadsr_class, (t_method)eadsr_attack, ! gensym("attack"), A_FLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_decay, ! gensym("decay"), A_FLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_sustain, ! gensym("sustain"), A_FLOAT, 0); ! class_addmethod(eadsr_class, (t_method)eadsr_release, ! gensym("release"), A_FLOAT, 0);
}
Index: Makefile =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 12 Sep 2003 22:22:31 -0000 1.4 --- Makefile 15 Aug 2006 15:11:51 -0000 1.5 *************** *** 1,9 **** include ../Makefile.config
! current: ead.o ear.o eadsr.o dist.o tabreadmix.o xfm.o qmult.o qnorm.o \ ! cheby.o abs.o ramp.o dwt.o bfft.o dynwav.o statwav.o bdiag.o \ ! diag.o matrix.o permut.o lattice.o ratio.o ffpoly.o fwarp.o \ ! junction.o fdn.o window.o cmath.o eblosc.o bitsplit.o sbosc.o \ ! blocknorm.o resofilt.o scrollgrid1D.o
--- 1,15 ---- include ../Makefile.config
! current: ead~.o ear~.o eadsr~.o dist~.o \ ! tabreadmix~.o xfm~.o qmult~.o qnorm~.o \ ! cheby~.o abs~.o ramp~.o \ ! bfft~.o dynwav~.o statwav~.o bdiag~.o \ ! diag~.o matrix~.o permut~.o lattice~.o ratio.o ffpoly.o fwarp.o \ ! junction~.o fdn~.o bwin~.o eblosc~.o bitsplit~.o sbosc~.o \ ! blocknorm~.o resofilt~.o scrollgrid1D~.o \ ! \ ! dwt.o cmath.o \ ! \ ! envelope_util.o setup.o
Index: resofilt~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/resofilt~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** resofilt~.c 25 May 2006 16:40:19 -0000 1.1 --- resofilt~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 87,99 **** t_float r_prev = ctl->c_r_prev;
! /* use rms of input to drive freq and reso ! this is such that connecting a dsp signal to the inlets has a reasonable result, ! even if the inputs are oscillatory. the rms values will be interpolated linearly ! (that is, linearly in the "analog" domain, so exponentially in the z-domain) */
reso_rms = freq_rms = 0.0f; for (i=0; i<n; i++){ ! t_float _freq = *freq++; /* first input is the reso frequency (absolute) */ ! t_float _reso = *reso++; /* second input is the resonnance (0->1), >1 == self osc */ freq_rms += _freq * _freq; reso_rms += _reso * _reso; --- 87,103 ---- t_float r_prev = ctl->c_r_prev;
! /* use rms of input to drive freq and reso. this is such that ! connecting a dsp signal to the inlets has a reasonable result, ! even if the inputs are oscillatory. the rms values will be ! interpolated linearly (that is, linearly in the "analog" domain, ! so exponentially in the z-domain) */
reso_rms = freq_rms = 0.0f; for (i=0; i<n; i++){ ! /* first input is the reso frequency (absolute) */ ! t_float _freq = *freq++; ! /* second input is the resonnance (0->1), >1 == self osc */ ! t_float _reso = *reso++; ! freq_rms += _freq * _freq; reso_rms += _reso * _reso; *************** *** 105,114 ****
! /* calculate the new pole locations ! we use an impulse invariant transform: the moog vcf poles are located at s_p = (-1 +- r \sqrt{+- j}, with r = (k/4)^(1/4) \in [0,1]
! the poles are always complex, so we can use an orthogonal implementation ! both conj pole pairs have the same angle, so we can use one phasor and 2 radii */
--- 109,120 ----
! /* calculate the new pole locations. we use an impulse invariant ! transform: the moog vcf poles are located at ! s_p = (-1 +- r \sqrt{+- j}, with r = (k/4)^(1/4) \in [0,1]
! the poles are always complex, so we can use an orthogonal ! implementation both conj pole pairs have the same angle, so we ! can use one phasor and 2 radii */
*************** *** 180,184 **** *out++ = x;
! /* saturate (normalize if pow > 1) state to prevent explosion and to allow self-osc */ _sat_state(stateA); _sat_state(stateB); --- 186,191 ---- *out++ = x;
! /* saturate (normalize if pow > 1) state to prevent explosion ! * and to allow self-osc */ _sat_state(stateA); _sat_state(stateB); *************** *** 223,233 **** t_float r_prev = ctl->c_r_prev;
! t_float sqrt5 = sqrtf(5.0f);
/* use rms of input to drive freq and reso */ reso_rms = freq_rms = 0.0f; for (i=0; i<n; i++){ ! t_float _freq = *freq++; /* first input is the reso frequency (absolute) */ ! t_float _reso = *reso++; /* second input is the resonnance (0->1), >1 == self osc */ freq_rms += _freq * _freq; reso_rms += _reso * _reso; --- 230,242 ---- t_float r_prev = ctl->c_r_prev;
! t_float sqrt5 = sqrt(5.0);
/* use rms of input to drive freq and reso */ reso_rms = freq_rms = 0.0f; for (i=0; i<n; i++){ ! /* first input is the reso frequency (absolute) */ ! t_float _freq = *freq++; ! /* second input is the resonnance (0->1), >1 == self osc */ ! t_float _reso = *reso++; freq_rms += _freq * _freq; reso_rms += _reso * _reso; *************** *** 239,244 ****
! /* calculate the new pole locations ! we use an impulse invariant transform: the 303 vcf poles are located at s_p = omega(-1 + r sqrt(5) e^{pi/3(1+2p)})
--- 248,254 ----
! /* calculate the new pole locations. we use an impulse invariant ! transform: the 303 vcf poles are located at ! s_p = omega(-1 + r sqrt(5) e^{pi/3(1+2p)})
*************** *** 249,259 ****
! this is a strange beast. legend goes it was "invented" by taking the moog vcf ! and moving one cap up, such that the not-so controllable 3-pole that emerged ! would avoid the moog patent..
! so, the sound is not so much the locations of the poles, but how the filter ! reacts to time varying controls. i.e. the pole movement with constant reso, ! used in the tb-303.
*/ --- 259,269 ----
! this is a strange beast. legend goes it was "invented" by taking ! the moog vcf and moving one cap up, such that the not-so ! controllable 3-pole that emerged would avoid the moog patent..
! so, the sound is not so much the locations of the poles, but how ! the filter reacts to time varying controls. i.e. the pole ! movement with constant reso, used in the tb-303.
*/ *************** *** 321,325 **** *out++ = x;
! /* saturate (normalize if pow > 1) state to prevent explosion and to allow self-osc */ _sat_state(stateA); _sat_state(stateB); --- 331,336 ---- *out++ = x;
! /* saturate (normalize if pow > 1) state to prevent explosion ! * and to allow self-osc */ _sat_state(stateA); _sat_state(stateB);
Index: dynwav~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/dynwav~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dynwav~.c 25 May 2006 16:40:19 -0000 1.1 --- dynwav~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 1,6 **** /* ! * blosc.c - bandlimited oscillators ! * data organization is in (real, imag) pairs ! * the first 2 components are (DC, NY) * Copyright (c) 2000-2003 by Tom Schouten * --- 1,5 ---- /* ! * dynwav~.c - dynamic wavetable oscillators ! * * Copyright (c) 2000-2003 by Tom Schouten * *************** *** 110,114 **** }
! static t_int *dynwav_perform_8point(t_int *w) /* werkt nog nie tegoei */ {
--- 109,114 ---- }
! static t_int *dynwav_perform_8point(t_int *w) ! /* FIXME: i thought this was broken. */ {
*************** *** 135,143 **** {
! /* const float N1 = 1 / ( 2 * (1-(1/9)) * (1-(1/25)) * (1-(1/49)) ); ! ** const float N2 = 1 / ( (1-(9)) * 2 * (1-(9/25)) * (1-(9/49)) ); ! ** const float N3 = 1 / ( (1-(25)) * (1-(25/9)) * 2 * (1-(25/49)) ); ! ** const float N4 = 1 / ( (1-(49)) * (1-(49/9)) * (1-(49/25)) * 2 ); ! */
const float N1 = 0.59814453125; --- 135,143 ---- {
! /* const float N1 = 1 / ( 2 * (1-(1/9)) * (1-(1/25)) * (1-(1/49)) ); ! ** const float N2 = 1 / ( (1-(9)) * 2 * (1-(9/25)) * (1-(9/49)) ); ! ** const float N3 = 1 / ( (1-(25)) * (1-(25/9)) * 2 * (1-(25/49)) ); ! ** const float N4 = 1 / ( (1-(49)) * (1-(49/9)) * (1-(49/25)) * 2 ); ! */
const float N1 = 0.59814453125; *************** *** 263,267 ****
! dsp_add(dynwav_perform_8point, 5, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec);
--- 263,268 ----
! dsp_add(dynwav_perform_8point, 5, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec);
Index: qmult~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/qmult~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** qmult~.c 25 May 2006 16:40:19 -0000 1.1 --- qmult~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 148,152 **** t_qmult *x = (t_qmult *)pd_new(qmult_class);
! for (i=1;i<8;i++) inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); for (i=0;i<4;i++) outlet_new(&x->x_obj, gensym("signal"));
--- 148,153 ---- t_qmult *x = (t_qmult *)pd_new(qmult_class);
! for (i=1;i<8;i++) inlet_new(&x->x_obj, &x->x_obj.ob_pd, ! gensym("signal"), gensym("signal")); for (i=0;i<4;i++) outlet_new(&x->x_obj, gensym("signal"));
Index: dist~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/dist~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dist~.c 25 May 2006 16:40:19 -0000 1.1 --- dist~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 18,23 **** */
! #include <m_pd.h> ! #include <math.h>
#define CLIP 0 --- 18,23 ---- */
! #include "extlib_util.h" !
#define CLIP 0 *************** *** 238,242 **** static void dist_dsp(t_dist *x, t_signal **sp) { ! dsp_add(dist_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
} --- 238,243 ---- static void dist_dsp(t_dist *x, t_signal **sp) { ! dsp_add(dist_perform, 4, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec);
}
Index: statwav~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/statwav~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** statwav~.c 25 May 2006 16:40:19 -0000 1.1 --- statwav~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 1,6 **** /* ! * dynwav.c - static wavetable oscillator (scale + tabread) ! * data organization is in (real, imag) pairs ! * the first 2 components are (DC, NY) * Copyright (c) 2000-2003 by Tom Schouten * --- 1,5 ---- /* ! * statwav.c - static wavetable oscillator (scale + tabread) ! * * Copyright (c) 2000-2003 by Tom Schouten *
Index: bitsplit~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/bitsplit~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bitsplit~.c 25 May 2006 16:40:19 -0000 1.1 --- bitsplit~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 1,4 **** /* ! * bitsplit.c - convert a signal to a binary vector * Copyright (c) 2000-2003 by Tom Schouten * --- 1,4 ---- /* ! * bitsplit.c - Convert a signal to a binary vector. * Copyright (c) 2000-2003 by Tom Schouten *
Index: bdiag~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/bdiag~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bdiag~.c 25 May 2006 16:40:19 -0000 1.1 --- bdiag~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 23,33 **** */
! #include <m_pd.h> ! #include <math.h> #include <stdio.h> #include <stdlib.h> - #ifndef IS_DENORMAL - #include "extlib_util.h" - #endif
#define MAXORDER 64 --- 23,29 ---- */
! #include "extlib_util.h" #include <stdio.h> #include <stdlib.h>
#define MAXORDER 64 *************** *** 84,88 ****
! static void bdiag_eigen(t_bdiag *x, t_floatarg index, t_floatarg aval, t_floatarg bval) { int i = (int)index; --- 80,85 ----
! static void bdiag_eigen(t_bdiag *x, t_floatarg index, ! t_floatarg aval, t_floatarg bval) { int i = (int)index; *************** *** 95,99 ****
/* set decay time and frequency of pole at index */ ! static void bdiag_timefreq(t_bdiag *x, t_floatarg index, t_floatarg time, t_floatarg freq) { float r,a,b,n; --- 92,97 ----
/* set decay time and frequency of pole at index */ ! static void bdiag_timefreq(t_bdiag *x, t_floatarg index, ! t_floatarg time, t_floatarg freq) { float r,a,b,n; *************** *** 218,222 ****
! dsp_add(bdiag_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); }
--- 216,221 ----
! dsp_add(bdiag_perform, 4, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec); }
*************** *** 271,277 **** class_addmethod(bdiag_class, (t_method)bdiag_dsp, gensym("dsp"), 0);
! class_addmethod(bdiag_class, (t_method)bdiag_eigen, gensym("eigen"), A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); ! class_addmethod(bdiag_class, (t_method)bdiag_timefreq, gensym("timefreq"), A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); ! class_addmethod(bdiag_class, (t_method)bdiag_preset, gensym("preset"), A_DEFFLOAT, 0); }
--- 270,279 ---- class_addmethod(bdiag_class, (t_method)bdiag_dsp, gensym("dsp"), 0);
! class_addmethod(bdiag_class, (t_method)bdiag_eigen, gensym("eigen"), ! A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); ! class_addmethod(bdiag_class, (t_method)bdiag_timefreq, gensym("timefreq"), ! A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); ! class_addmethod(bdiag_class, (t_method)bdiag_preset, gensym("preset"), ! A_DEFFLOAT, 0); }
Index: filters.h =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/filters.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** filters.h 25 May 2006 16:03:20 -0000 1.1 --- filters.h 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 3,9 **** /* defined as inline functions with call by reference to enable compiler ref/deref optim */
- #ifndef CREB_FILTERS_H - #define CREB_FILTERS_H - /* the typedef */ #ifndef T --- 3,6 ---- *************** *** 228,232 ****
*/ - - #endif /* CREB_FILTERS_H */ - --- 225,226 ----
Index: extlib_util.h =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/extlib_util.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** extlib_util.h 25 May 2006 16:03:20 -0000 1.1 --- extlib_util.h 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 18,24 **** */
- #ifndef CREB_EXTLIB_UTIL_H - #define CREB_EXTLIB_UTIL_H - #include <math.h> #include "m_pd.h" --- 18,21 ---- *************** *** 46,50 ****
#define IS_DENORMAL(f) (((((t_flint)(f)).i) & 0x7f800000) == 0) - - #endif /* CREB_EXTLIB_UTIL_H */ - --- 43,44 ----
Index: tabreadmix~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/tabreadmix~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tabreadmix~.c 25 May 2006 16:40:19 -0000 1.1 --- tabreadmix~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 18,23 **** */
- #include <m_pd.h> - #include <math.h> #include "extlib_util.h"
--- 18,21 ---- *************** *** 106,114 **** /* mix and write */ newpos = (int)(*pos++); ! *out++ = currgain * buf[x->x_currpos++] + prevgain * buf[x->x_prevpos++]; /* advance oscillator */ ! c = x->x_xfade_state_c * x->x_xfade_cos - x->x_xfade_state_s * x->x_xfade_sin; ! s = x->x_xfade_state_c * x->x_xfade_sin + x->x_xfade_state_s * x->x_xfade_cos; x->x_xfade_state_c = c; x->x_xfade_state_s = s; --- 104,115 ---- /* mix and write */ newpos = (int)(*pos++); ! *out++ = currgain * buf[x->x_currpos++] ! + prevgain * buf[x->x_prevpos++]; /* advance oscillator */ ! c = x->x_xfade_state_c * x->x_xfade_cos ! - x->x_xfade_state_s * x->x_xfade_sin; ! s = x->x_xfade_state_c * x->x_xfade_sin ! + x->x_xfade_state_s * x->x_xfade_cos; x->x_xfade_state_c = c; x->x_xfade_state_s = s;
Index: lattice~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/lattice~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lattice~.c 25 May 2006 16:40:19 -0000 1.1 --- lattice~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 86,90 **** static void lattice_dsp(t_lattice *x, t_signal **sp) { ! dsp_add(lattice_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
} --- 86,91 ---- static void lattice_dsp(t_lattice *x, t_signal **sp) { ! dsp_add(lattice_perform, 4, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec);
} *************** *** 139,143 **** class_addmethod(lattice_class, (t_method)lattice_dsp, gensym("dsp"), 0); class_addmethod(lattice_class, (t_method)lattice_reset, gensym("reset"), 0); ! class_addmethod(lattice_class, (t_method)lattice_rc, gensym("rc"), A_FLOAT, A_FLOAT, 0);
} --- 140,145 ---- class_addmethod(lattice_class, (t_method)lattice_dsp, gensym("dsp"), 0); class_addmethod(lattice_class, (t_method)lattice_reset, gensym("reset"), 0); ! class_addmethod(lattice_class, (t_method)lattice_rc, ! gensym("rc"), A_FLOAT, A_FLOAT, 0);
}
Index: qnorm~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/qnorm~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** qnorm~.c 25 May 2006 16:40:19 -0000 1.1 --- qnorm~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 120,124 **** t_qnorm *x = (t_qnorm *)pd_new(qnorm_class);
! for (i=1;i<4;i++) inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); for (i=0;i<4;i++) outlet_new(&x->x_obj, gensym("signal"));
--- 120,125 ---- t_qnorm *x = (t_qnorm *)pd_new(qnorm_class);
! for (i=1;i<4;i++) inlet_new(&x->x_obj, &x->x_obj.ob_pd, ! gensym("signal"), gensym("signal")); for (i=0;i<4;i++) outlet_new(&x->x_obj, gensym("signal"));
Index: sbosc~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/sbosc~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sbosc~.c 25 May 2006 16:40:19 -0000 1.1 --- sbosc~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 1,6 **** /* ! * sbosc.c - smallband oscillator. periodic, linear interpolated frequency center. ! * data organization is in (real, imag) pairs ! * the first 2 components are (DC, NY) * Copyright (c) 2000-2003 by Tom Schouten * --- 1,6 ---- /* ! * sbosc.c - smallband oscillator. periodic, linear interpolated ! * frequency center. ! * * Copyright (c) 2000-2003 by Tom Schouten *
Index: ead~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/ead~.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ead~.c 25 May 2006 17:01:41 -0000 1.3 --- ead~.c 15 Aug 2006 15:11:52 -0000 1.4 *************** *** 18,23 **** */
- #include <m_pd.h> - #include <math.h> #include "extlib_util.h"
--- 18,21 ---- *************** *** 122,126 ****
/* constructor */ ! static void *ead_new(t_floatarg attack, t_floatarg decay, t_floatarg sustain, t_floatarg release) { /* create instance */ --- 120,125 ----
/* constructor */ ! static void *ead_new(t_floatarg attack, t_floatarg decay, ! t_floatarg sustain, t_floatarg release) { /* create instance */ *************** *** 153,191 **** class_addmethod(ead_class, (t_method)ead_start, gensym("bang"), 0); class_addmethod(ead_class, (t_method)ead_dsp, gensym("dsp"), 0); ! class_addmethod(ead_class, (t_method)ead_attack, gensym("attack"), A_FLOAT, 0); ! class_addmethod(ead_class, (t_method)ead_decay, gensym("decay"), A_FLOAT, 0); }
- /* - * Utility functions for exponential decay - * Copyright (c) 2000-2003 by Tom Schouten - * - * 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; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - - //#include "extlib_util.h" - - float milliseconds_2_one_minus_realpole(float time) - { - float r; - - if (time < 0.0f) time = 0.0f; - r = -expm1(1000.0f * log(ENVELOPE_RANGE) / (sys_getsr() * time)); - if (!(r < 1.0f)) r = 1.0f; - - //post("%f",r); - return r; - } --- 152,159 ---- class_addmethod(ead_class, (t_method)ead_start, gensym("bang"), 0); class_addmethod(ead_class, (t_method)ead_dsp, gensym("dsp"), 0); ! class_addmethod(ead_class, (t_method)ead_attack, ! gensym("attack"), A_FLOAT, 0); ! class_addmethod(ead_class, (t_method)ead_decay, ! gensym("decay"), A_FLOAT, 0); }
Index: bfft~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/bfft~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bfft~.c 25 May 2006 16:40:19 -0000 1.1 --- bfft~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 1,6 **** /* ! * bfft.c - code for some fourrier transform variants and utility functions ! * data organization is in (real, imag) pairs ! * the first 2 components are (DC, NY) * Copyright (c) 2000-2003 by Tom Schouten * --- 1,7 ---- /* ! * bfft.c - Code for some fourrier transform variants and utility ! * functions. Data organization is in (real, imag) pairs the first 2 ! * components are (DC, NY) ! * * Copyright (c) 2000-2003 by Tom Schouten *
Index: eblosc~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/eblosc~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** eblosc~.c 25 May 2006 16:40:19 -0000 1.1 --- eblosc~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 65,70 ****
/* phase converters */ ! static inline float _phase_to_float(u32 p){return ((float)p) * (1.0f / 4294967296.0f);} ! static inline u32 _float_to_phase(float f){return (u32)(f * 4294967296.0f);}
--- 65,74 ----
/* phase converters */ ! static inline float _phase_to_float(u32 p){ ! return ((float)p) * (1.0f / 4294967296.0f); ! } ! static inline u32 _float_to_phase(float f){ ! return (u32)(f * 4294967296.0f); ! }
*************** *** 145,150 **** int voice;
! /* determine the location of the discontinuity (in oversampled coordiates ! using linear interpolation */
float f = (float)S * curr / (curr - prev); --- 149,154 ---- int voice;
! /* determine the location of the discontinuity (in oversampled ! coordiates using linear interpolation */
float f = (float)S * curr / (curr - prev); *************** *** 209,214 **** ctl->c_next_voice &= VOICES-1; ! /* determine the location of the discontinuity (in oversampled coordinates) ! which is S * (new phase) / (increment) */ table_index = phase / phase_inc_decimated; --- 213,218 ---- ctl->c_next_voice &= VOICES-1; ! /* determine the location of the discontinuity (in oversampled ! coordinates) which is S * (new phase) / (increment) */ table_index = phase / phase_inc_decimated; *************** *** 219,223 **** table_phase = phase - (table_index * phase_inc_decimated); ! /* use it to initialize the new voice index and interpolation fraction */ ctl->c_index[voice] = table_index; --- 223,228 ---- table_phase = phase - (table_index * phase_inc_decimated); ! /* use it to initialize the new voice index and interpolation ! * fraction */ ctl->c_index[voice] = table_index; *************** *** 234,240 ****
! /* the 2 oscillator version: ! the second osc can reset the first osc's phase (hence it determines the pitch) ! the first osc determines the waveform */
static void _bang_hardsync_phasor(t_ebloscctl *ctl, float freq, float freq2) --- 239,245 ----
! /* the 2 oscillator version: the second osc can reset the first osc's ! phase (hence it determines the pitch) the first osc determines the ! waveform */
static void _bang_hardsync_phasor(t_ebloscctl *ctl, float freq, float freq2) *************** *** 298,303 **** ctl->c_next_voice &= VOICES-1; ! /* determine the location of the discontinuity (in oversampled coordinates) ! which is S * (new phase) / (increment) */
table_index = phase / phase_inc_decimated; --- 303,308 ---- ctl->c_next_voice &= VOICES-1; ! /* determine the location of the discontinuity (in oversampled ! coordinates) which is S * (new phase) / (increment) */
table_index = phase / phase_inc_decimated; *************** *** 308,316 **** table_phase = phase - (table_index * phase_inc_decimated);
! /* determine the step size ! as opposed to saw/impulse waveforms, the step is not always equal to one. it is: ! oldphase - phase + phase_inc ! but for the unit step this will overflow to zero, so we ! reduce the bit depth to prevent overflow */
stepsize = _phase_to_float(((oldphase-phase) >> LOVERSAMPLE) --- 313,321 ---- table_phase = phase - (table_index * phase_inc_decimated);
! /* determine the step size. as opposed to saw/impulse ! waveforms, the step is not always equal to one. it is: ! oldphase - phase + phase_inc but for the unit step this ! will overflow to zero, so we reduce the bit depth to ! prevent overflow */
stepsize = _phase_to_float(((oldphase-phase) >> LOVERSAMPLE) *************** *** 355,359 **** sample += _phase_to_float(ctl->c_phase) - 0.5f;
! /* highpass filter output to remove DC offset and low frequency aliasing */ ctl->c_butter->BangSmooth(sample, sample, 0.05f);
--- 360,365 ---- sample += _phase_to_float(ctl->c_phase) - 0.5f;
! /* highpass filter output to remove DC offset and low ! * frequency aliasing */ ctl->c_butter->BangSmooth(sample, sample, 0.05f);
*************** *** 417,421 **** float sample = _get_bandlimited_discontinuity(ctl, bli);
! /* highpass filter output to remove DC offset and low frequency aliasing */ ctl->c_butter->BangSmooth(sample, sample, 0.05f);
--- 423,428 ---- float sample = _get_bandlimited_discontinuity(ctl, bli);
! /* highpass filter output to remove DC offset and low ! * frequency aliasing */ ctl->c_butter->BangSmooth(sample, sample, 0.05f);
*************** *** 497,501 **** x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; ! dsp_add(eblosc_perform_hardsync_saw, 5, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec); }
--- 504,509 ---- x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; ! dsp_add(eblosc_perform_hardsync_saw, 5, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec); }
*************** *** 504,508 **** x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; ! dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else if (x->x_ctl.c_waveform == gensym("pulse2")){ --- 512,517 ---- x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; ! dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec); } else if (x->x_ctl.c_waveform == gensym("pulse2")){ *************** *** 510,524 **** x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = -1.0f; ! dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else if (x->x_ctl.c_waveform == gensym("comparator")){ x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; ! dsp_add(eblosc_perform_comparator, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else{ x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; ! dsp_add(eblosc_perform_saw, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); }
--- 519,536 ---- x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = -1.0f; ! dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec); } else if (x->x_ctl.c_waveform == gensym("comparator")){ x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; ! dsp_add(eblosc_perform_comparator, 4, &x->x_ctl, ! sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec); } else{ x->x_ctl.c_scale = 1.0f; x->x_ctl.c_scale_update = 1.0f; ! dsp_add(eblosc_perform_saw, 4, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec); }
*************** *** 543,552 **** /* optional signal inlets */ if (s == gensym("syncsaw")){ ! inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); }
/* optional phase inlet */ if (s != gensym("comparator")){ ! inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("phase")); }
--- 555,566 ---- /* optional signal inlets */ if (s == gensym("syncsaw")){ ! inlet_new(&x->x_obj, &x->x_obj.ob_pd, ! gensym("signal"), gensym("signal")); }
/* optional phase inlet */ if (s != gensym("comparator")){ ! inlet_new(&x->x_obj, &x->x_obj.ob_pd, ! gensym("float"), gensym("phase")); }
*************** *** 586,598 **** eblosc_class = class_new(gensym("eblosc~"), (t_newmethod)eblosc_new, ! (t_method)eblosc_free, sizeof(t_eblosc), 0, A_DEFSYMBOL, A_NULL); CLASS_MAINSIGNALIN(eblosc_class, t_eblosc, x_f); ! class_addmethod(eblosc_class, (t_method)eblosc_dsp, gensym("dsp"), A_NULL); ! class_addmethod(eblosc_class, (t_method)eblosc_phase, gensym("phase"), A_FLOAT, A_NULL); ! class_addmethod(eblosc_class, (t_method)eblosc_phase2, gensym("phase2"), A_FLOAT, A_NULL); ! ! } - }
--- 600,613 ---- eblosc_class = class_new(gensym("eblosc~"), (t_newmethod)eblosc_new, ! (t_method)eblosc_free, sizeof(t_eblosc), ! 0, A_DEFSYMBOL, A_NULL); CLASS_MAINSIGNALIN(eblosc_class, t_eblosc, x_f); ! class_addmethod(eblosc_class, (t_method)eblosc_dsp, ! gensym("dsp"), A_NULL); ! class_addmethod(eblosc_class, (t_method)eblosc_phase, ! gensym("phase"), A_FLOAT, A_NULL); ! class_addmethod(eblosc_class, (t_method)eblosc_phase2, ! gensym("phase2"), A_FLOAT, A_NULL); } }
Index: scrollgrid1D~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/scrollgrid1D~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** scrollgrid1D~.c 25 May 2006 16:40:19 -0000 1.1 --- scrollgrid1D~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 22,33 **** for more information see:
! Yalcin M., Ozoguz S., Suykens J.A.K., Vandewalle J., ! ``Families of Scroll Grid Attractors'', ! International Journal of Bifurcation and Chaos, vol. 12, no. 1, Jan. 2002, pp. 23-41.
! this file implements a digital variant of the method introduced in the paper, ! so that it can be used as a parametrizable, bounded chatotic oscillator. ! in short it is a switched linear system, with some added hard limiting to ! convert unstable oscillations into stable ones.
*/ --- 22,34 ---- for more information see:
! Yalcin M., Ozoguz S., Suykens J.A.K., Vandewalle J., ``Families of ! Scroll Grid Attractors'', International Journal of Bifurcation and ! Chaos, vol. 12, no. 1, Jan. 2002, pp. 23-41.
! this file implements a digital variant of the method introduced in ! the paper, so that it can be used as a parametrizable, bounded ! chatotic oscillator. in short it is a switched linear system, ! with some added hard limiting to convert unstable oscillations ! into stable ones.
*/ *************** *** 109,115 ****
/* base transform + clipping to prevent blowup */ ! x = _sat(0.5f * (state[0] - state[2]), (float)o); /* projection onto axis containing fixed */ ! y = _sat(0.5f * state[1], 1.0f); /* the "pure" oscillation axis */ ! z = _sat(0.5f * (state[0] + state[2]), 1.0f); /* orthogonal complement of x */
/* output */ --- 110,119 ----
/* base transform + clipping to prevent blowup */ ! /* projection onto axis containing fixed */ ! x = _sat(0.5f * (state[0] - state[2]), (float)o); ! /* the "pure" oscillation axis */ ! y = _sat(0.5f * state[1], 1.0f); ! /* orthogonal complement of x */ ! z = _sat(0.5f * (state[0] + state[2]), 1.0f);
/* output */ *************** *** 210,219 **** { //post("scrollgrid1D~ v0.1"); ! scrollgrid1D_class = class_new(gensym("scrollgrid1D~"), (t_newmethod)scrollgrid1D_new, (t_method)scrollgrid1D_free, sizeof(t_scrollgrid1D), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(scrollgrid1D_class, t_scrollgrid1D, x_f); ! class_addmethod(scrollgrid1D_class, (t_method)scrollgrid1D_dsp, gensym("dsp"), 0); ! class_addmethod(scrollgrid1D_class, (t_method)scrollgrid1D_reset, gensym("reset"), 0); !
} --- 214,225 ---- { //post("scrollgrid1D~ v0.1"); ! scrollgrid1D_class = class_new(gensym("scrollgrid1D~"), ! (t_newmethod)scrollgrid1D_new, (t_method)scrollgrid1D_free, sizeof(t_scrollgrid1D), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(scrollgrid1D_class, t_scrollgrid1D, x_f); ! class_addmethod(scrollgrid1D_class, (t_method)scrollgrid1D_dsp, ! gensym("dsp"), 0); ! class_addmethod(scrollgrid1D_class, (t_method)scrollgrid1D_reset, ! gensym("reset"), 0);
}
Index: blocknorm~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/blocknorm~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** blocknorm~.c 25 May 2006 16:40:19 -0000 1.1 --- blocknorm~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 1,4 **** /* ! * blocknorm.c - normalize an array of dsp blocks (for spectral processing) * Copyright (c) 2000-2003 by Tom Schouten * --- 1,6 ---- /* ! * blocknorm.c - Normalize an array of dsp blocks. (spectral ! * processing primitive) ! * * Copyright (c) 2000-2003 by Tom Schouten * *************** *** 69,73 **** for (j=0;j<c;j++){ for (i=0;i<n;i++){ ! out[j][i] *= s; } } --- 71,75 ---- for (j=0;j<c;j++){ for (i=0;i<n;i++){ ! out[j][i] *= s; // FIXME: clockwize addressing problem } } *************** *** 114,118 ****
j = i; ! while (--j) inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); while (i--) outlet_new(&x->x_obj, gensym("signal"));
--- 116,121 ----
j = i; ! while (--j) inlet_new(&x->x_obj, &x->x_obj.ob_pd, ! gensym("signal"), gensym("signal")); while (i--) outlet_new(&x->x_obj, gensym("signal"));
Index: fdn~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/fdn~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fdn~.c 25 May 2006 16:40:19 -0000 1.1 --- fdn~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 27,34 ****
*/ - #include <m_pd.h> - #include <math.h> - #include "extlib_util.h"
#include <stdlib.h> #include <stdio.h> --- 27,32 ----
*/
+ #include "extlib_util.h" #include <stdlib.h> #include <stdio.h> *************** *** 107,111 **** static void fdn_order(t_fdn *x, t_int order){ if (order > x->x_ctl.c_maxorder) { ! post("fdn: this should not happen (panic!) order %d is larger than maxorder %d:", order, x->x_ctl.c_maxorder ); exit(1); --- 105,110 ---- static void fdn_order(t_fdn *x, t_int order){ if (order > x->x_ctl.c_maxorder) { ! post("fdn: this should not happen (panic!) order %d " ! "is larger than maxorder %d:", order, x->x_ctl.c_maxorder ); exit(1); *************** *** 132,137 **** { int i; ! if (x->x_ctl.c_buf) memset(x->x_ctl.c_buf, 0, x->x_ctl.c_bufsize * sizeof(float)); ! if (x->x_ctl.c_vectorbuffer) memset(x->x_ctl.c_vectorbuffer, 0, x->x_ctl.c_maxorder * 2 * sizeof(float)); }
--- 131,140 ---- { int i; ! if (x->x_ctl.c_buf) ! memset(x->x_ctl.c_buf, 0, x->x_ctl.c_bufsize ! * sizeof(float)); ! if (x->x_ctl.c_vectorbuffer) ! memset(x->x_ctl.c_vectorbuffer, ! 0, x->x_ctl.c_maxorder * 2 * sizeof(float)); }
*************** *** 327,331 **** int mask = x->x_ctl.c_bufsize - 1; int start = x->x_ctl.c_tap[0]; ! t_int *tap = x->x_ctl.c_tap; float *length = x->x_ctl.c_length; float scale = sys_getsr() * .001f; --- 330,334 ---- int mask = x->x_ctl.c_bufsize - 1; int start = x->x_ctl.c_tap[0]; ! int *tap = x->x_ctl.c_tap; float *length = x->x_ctl.c_length; float scale = sys_getsr() * .001f; *************** *** 339,343 ****
if (sum > mask){ ! post("fdn: warning: not enough delay memory, behaviour is undefined (this could lead to instability...)"); }
--- 342,347 ----
if (sum > mask){ ! post("fdn: warning: not enough delay memory, behaviour " ! "is undefined (this could lead to instability...)"); }
*************** *** 443,447 ****
! post("fdn: maximum nb of delay lines %d, total buffer size %d samples (%f seconds)", order, bufsize, ((float)bufsize) / sys_getsr());
--- 447,452 ----
! post("fdn: maximum nb of delay lines %d, total buffer " ! "size %d samples (%f seconds)", order, bufsize, ((float)bufsize) / sys_getsr());
*************** *** 490,499 **** class_addmethod(fdn_class, (t_method)fdn_print, gensym("print"), 0); class_addmethod(fdn_class, (t_method)fdn_reset, gensym("reset"), 0); ! class_addmethod(fdn_class, (t_method)fdn_timehigh, gensym("timehigh"), A_DEFFLOAT, 0); ! class_addmethod(fdn_class, (t_method)fdn_timelow, gensym("timelow"), A_DEFFLOAT, 0); class_addmethod(fdn_class, (t_method)fdn_list, gensym("lines"), A_GIMME, 0); class_addmethod(fdn_class, (t_method)fdn_dsp, gensym("dsp"), 0); ! class_addmethod(fdn_class, (t_method)fdn_linear, gensym("linear"), A_FLOAT, A_FLOAT, A_FLOAT, 0); ! class_addmethod(fdn_class, (t_method)fdn_exponential, gensym("exponential"), A_FLOAT, A_FLOAT, A_FLOAT, 0);
} --- 495,508 ---- class_addmethod(fdn_class, (t_method)fdn_print, gensym("print"), 0); class_addmethod(fdn_class, (t_method)fdn_reset, gensym("reset"), 0); ! class_addmethod(fdn_class, (t_method)fdn_timehigh, ! gensym("timehigh"), A_DEFFLOAT, 0); ! class_addmethod(fdn_class, (t_method)fdn_timelow, ! gensym("timelow"), A_DEFFLOAT, 0); class_addmethod(fdn_class, (t_method)fdn_list, gensym("lines"), A_GIMME, 0); class_addmethod(fdn_class, (t_method)fdn_dsp, gensym("dsp"), 0); ! class_addmethod(fdn_class, (t_method)fdn_linear, ! gensym("linear"), A_FLOAT, A_FLOAT, A_FLOAT, 0); ! class_addmethod(fdn_class, (t_method)fdn_exponential, ! gensym("exponential"), A_FLOAT, A_FLOAT, A_FLOAT, 0);
}
Index: cheby~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/cheby~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cheby~.c 25 May 2006 16:40:19 -0000 1.1 --- cheby~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 92,96 **** static void cheby_dsp(t_cheby *x, t_signal **sp) { ! dsp_add(cheby_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
} --- 92,97 ---- static void cheby_dsp(t_cheby *x, t_signal **sp) { ! dsp_add(cheby_perform, 4, &x->x_ctl, sp[0]->s_n, ! sp[0]->s_vec, sp[1]->s_vec);
} *************** *** 133,137 **** class_addmethod(cheby_class, (t_method)cheby_bang, gensym("bang"), 0); class_addmethod(cheby_class, (t_method)cheby_dsp, gensym("dsp"), 0); ! class_addmethod(cheby_class, (t_method)cheby_coef, gensym("coef"), A_DEFFLOAT, A_DEFFLOAT, 0);
} --- 134,139 ---- class_addmethod(cheby_class, (t_method)cheby_bang, gensym("bang"), 0); class_addmethod(cheby_class, (t_method)cheby_dsp, gensym("dsp"), 0); ! class_addmethod(cheby_class, (t_method)cheby_coef, gensym("coef"), ! A_DEFFLOAT, A_DEFFLOAT, 0);
}
Index: diag~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/diag~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** diag~.c 25 May 2006 16:40:19 -0000 1.1 --- diag~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 23,33 **** */
! #include <m_pd.h> ! #include <math.h> #include <stdio.h> #include <stdlib.h> - #ifndef IS_DENORMAL - #include "extlib_util.h" - #endif
#define MAXORDER 64 --- 23,29 ---- */
! #include "extlib_util.h" #include <stdio.h> #include <stdlib.h>
#define MAXORDER 64
Index: permut~.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/permut~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** permut~.c 25 May 2006 16:40:19 -0000 1.1 --- permut~.c 15 Aug 2006 15:11:52 -0000 1.2 *************** *** 20,32 **** */
! #include <m_pd.h> #include <math.h> - #include "extlib_util.h" #include <stdlib.h>
typedef struct permutctl { char c_type; ! t_int *c_permutationtable; int c_blocksize; } t_permutctl; --- 20,35 ---- */
! #include <math.h> #include <stdlib.h> + //#include "m_pd.h" + #include "extlib_util.h" + +
typedef struct permutctl { char c_type; ! int *c_permutationtable; int c_blocksize; } t_permutctl; *************** *** 60,64 **** int N = x->x_ctl.c_blocksize; int mask = N-1; ! t_int *p = x->x_ctl.c_permutationtable; int r, last = 0;
--- 63,67 ---- int N = x->x_ctl.c_blocksize; int mask = N-1; ! int *p = x->x_ctl.c_permutationtable; int r, last = 0;
*************** *** 101,105 **** if (x->x_ctl.c_permutationtable) free(x->x_ctl.c_permutationtable); ! x->x_ctl.c_permutationtable = (t_int *)malloc(sizeof(int)*size); x->x_ctl.c_blocksize = size;
--- 104,108 ---- if (x->x_ctl.c_permutationtable) free(x->x_ctl.c_permutationtable); ! x->x_ctl.c_permutationtable = (int *)malloc(sizeof(int)*size); x->x_ctl.c_blocksize = size;
Index: ffpoly.c =================================================================== RCS file: /cvsroot/pure-data/externals/creb/modules/ffpoly.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ffpoly.c 31 Dec 2005 19:31:09 -0000 1.2 --- ffpoly.c 15 Aug 2006 15:11:52 -0000 1.3 *************** *** 50,54 **** int fo = x->x_field_order; int po = x->x_poly_order; ! t_int* c = x->x_coef; int i, out;
--- 50,54 ---- int fo = x->x_field_order; int po = x->x_poly_order; ! int* c = x->x_coef; int i, out;
*************** *** 136,140 **** x->x_field_order = fieldorder;
! x->x_coef = (t_int *)malloc((x->x_poly_order + 1) * sizeof(int));
/* set poly to f(x) = x */ --- 136,140 ---- x->x_field_order = fieldorder;
! x->x_coef = (int *)malloc((x->x_poly_order + 1) * sizeof(int));
/* set poly to f(x) = x */