Update of /cvsroot/pure-data/externals/iemlib/src/iemlib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22090/iemlib/src/iemlib2
Modified Files: LFO_noise~.c fade~.c iem_blocksize~.c iem_samplerate~.c m2f~.c Log Message: made all functions to _tilde
Index: iem_samplerate~.c =================================================================== RCS file: /cvsroot/pure-data/externals/iemlib/src/iemlib2/iem_samplerate~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** iem_samplerate~.c 8 Nov 2006 10:48:53 -0000 1.1 --- iem_samplerate~.c 8 Nov 2006 14:19:30 -0000 1.2 *************** *** 13,17 **** static t_class *iem_samplerate_tilde_class;
! typedef struct _iem_samplerate { t_object x_obj; --- 13,17 ---- static t_class *iem_samplerate_tilde_class;
! typedef struct _iem_samplerate_tilde { t_object x_obj; *************** *** 21,38 **** } t_iem_samplerate_tilde;
! static void iem_samplerate_out(t_iem_samplerate_tilde *x) { outlet_float(x->x_obj.ob_outlet, x->x_samplerate); }
! static void iem_samplerate_free(t_iem_samplerate_tilde *x) { clock_free(x->x_clock); }
! static void *iem_samplerate_new(t_symbol *s) { t_iem_samplerate_tilde *x = (t_iem_samplerate_tilde *)pd_new(iem_samplerate_tilde_class); ! x->x_clock = clock_new(x, (t_method)iem_samplerate_out); outlet_new(&x->x_obj, &s_float); x->x_samplerate = 44100.0f; --- 21,38 ---- } t_iem_samplerate_tilde;
! static void iem_samplerate_tilde_out(t_iem_samplerate_tilde *x) { outlet_float(x->x_obj.ob_outlet, x->x_samplerate); }
! static void iem_samplerate_tilde_free(t_iem_samplerate_tilde *x) { clock_free(x->x_clock); }
! static void *iem_samplerate_tilde_new(t_symbol *s) { t_iem_samplerate_tilde *x = (t_iem_samplerate_tilde *)pd_new(iem_samplerate_tilde_class); ! x->x_clock = clock_new(x, (t_method)iem_samplerate_tilde_out); outlet_new(&x->x_obj, &s_float); x->x_samplerate = 44100.0f; *************** *** 41,45 **** }
! static void iem_samplerate_dsp(t_iem_samplerate_tilde *x, t_signal **sp) { x->x_samplerate = (t_float)(sp[0]->s_sr); --- 41,45 ---- }
! static void iem_samplerate_tilde_dsp(t_iem_samplerate_tilde *x, t_signal **sp) { x->x_samplerate = (t_float)(sp[0]->s_sr); *************** *** 49,55 **** void iem_samplerate_tilde_setup(void) { ! iem_samplerate_tilde_class = class_new(gensym("iem_samplerate~"), (t_newmethod)iem_samplerate_new, ! (t_method)iem_samplerate_free, sizeof(t_iem_samplerate_tilde), 0, 0); CLASS_MAINSIGNALIN(iem_samplerate_tilde_class, t_iem_samplerate_tilde, x_f); ! class_addmethod(iem_samplerate_tilde_class, (t_method)iem_samplerate_dsp, gensym("dsp"), 0); } --- 49,55 ---- void iem_samplerate_tilde_setup(void) { ! iem_samplerate_tilde_class = class_new(gensym("iem_samplerate~"), (t_newmethod)iem_samplerate_tilde_new, ! (t_method)iem_samplerate_tilde_free, sizeof(t_iem_samplerate_tilde), 0, 0); CLASS_MAINSIGNALIN(iem_samplerate_tilde_class, t_iem_samplerate_tilde, x_f); ! class_addmethod(iem_samplerate_tilde_class, (t_method)iem_samplerate_tilde_dsp, gensym("dsp"), 0); }
Index: LFO_noise~.c =================================================================== RCS file: /cvsroot/pure-data/externals/iemlib/src/iemlib2/LFO_noise~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LFO_noise~.c 8 Nov 2006 10:48:53 -0000 1.1 --- LFO_noise~.c 8 Nov 2006 14:19:30 -0000 1.2 *************** *** 28,40 **** } t_LFO_noise_tilde;
! static int LFO_noise_makeseed(void) { ! static unsigned int LFO_noise_nextseed = 1489853723;
! LFO_noise_nextseed = LFO_noise_nextseed * 435898247 + 938284287; ! return(LFO_noise_nextseed & 0x7fffffff); }
! static float LFO_noise_new_rand(t_LFO_noise_tilde *x) { unsigned int state = x->x_state; --- 28,40 ---- } t_LFO_noise_tilde;
! static int LFO_noise_tilde_makeseed(void) { ! static unsigned int LFO_noise_tilde_nextseed = 1489853723;
! LFO_noise_tilde_nextseed = LFO_noise_tilde_nextseed * 435898247 + 938284287; ! return(LFO_noise_tilde_nextseed & 0x7fffffff); }
! static float LFO_noise_tilde_new_rand(t_LFO_noise_tilde *x) { unsigned int state = x->x_state; *************** *** 49,53 **** }
! static void *LFO_noise_new(t_float freq) { t_LFO_noise_tilde *x = (t_LFO_noise_tilde *)pd_new(LFO_noise_tilde_class); --- 49,53 ---- }
! static void *LFO_noise_tilde_new(t_float freq) { t_LFO_noise_tilde *x = (t_LFO_noise_tilde *)pd_new(LFO_noise_tilde_class); *************** *** 55,59 **** x->x_range = 65535.0; x->x_rcp_range = (double)x->x_range * (1.0/4294967296.0); ! x->x_state = LFO_noise_makeseed(); x->x_fact = 2.0f / 44100.0f; x->x_incr = freq * x->x_fact; --- 55,59 ---- x->x_range = 65535.0; x->x_rcp_range = (double)x->x_range * (1.0/4294967296.0); ! x->x_state = LFO_noise_tilde_makeseed(); x->x_fact = 2.0f / 44100.0f; x->x_incr = freq * x->x_fact; *************** *** 62,67 **** else if(x->x_incr > 0.1f) x->x_incr = 0.1f; ! x->x_y1 = LFO_noise_new_rand(x); ! x->x_y2 = LFO_noise_new_rand(x); x->x_phase = 0.0f; outlet_new(&x->x_obj, gensym("signal")); --- 62,67 ---- else if(x->x_incr > 0.1f) x->x_incr = 0.1f; ! x->x_y1 = LFO_noise_tilde_new_rand(x); ! x->x_y2 = LFO_noise_tilde_new_rand(x); x->x_phase = 0.0f; outlet_new(&x->x_obj, gensym("signal")); *************** *** 69,73 **** }
! static t_int *LFO_noise_perform(t_int *w) { t_float *out = (t_float *)(w[1]); --- 69,73 ---- }
! static t_int *LFO_noise_tilde_perform(t_int *w) { t_float *out = (t_float *)(w[1]); *************** *** 84,88 **** { x_y1 = x_y2; ! x_y2 = LFO_noise_new_rand(x); phase -= 1.0; } --- 84,88 ---- { x_y1 = x_y2; ! x_y2 = LFO_noise_tilde_new_rand(x); phase -= 1.0; } *************** *** 96,100 **** }
! static void LFO_noise_float(t_LFO_noise_tilde *x, t_floatarg freq) { x->x_incr = freq * x->x_fact; --- 96,100 ---- }
! static void LFO_noise_tilde_float(t_LFO_noise_tilde *x, t_floatarg freq) { x->x_incr = freq * x->x_fact; *************** *** 105,112 **** }
! static void LFO_noise_dsp(t_LFO_noise_tilde *x, t_signal **sp) { x->x_fact = 2.0f / sp[0]->s_sr; ! dsp_add(LFO_noise_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); }
--- 105,112 ---- }
! static void LFO_noise_tilde_dsp(t_LFO_noise_tilde *x, t_signal **sp) { x->x_fact = 2.0f / sp[0]->s_sr; ! dsp_add(LFO_noise_tilde_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); }
*************** *** 114,122 **** { LFO_noise_tilde_class = class_new(gensym("LFO_noise~"), ! (t_newmethod)LFO_noise_new, 0, sizeof(t_LFO_noise_tilde), 0, A_DEFFLOAT, 0); ! class_addmethod(LFO_noise_tilde_class, (t_method)LFO_noise_dsp, gensym("dsp"), 0); ! class_addfloat(LFO_noise_tilde_class, (t_method)LFO_noise_float); class_sethelpsymbol(LFO_noise_tilde_class, gensym("iemhelp/help-LFO_noise~")); } --- 114,122 ---- { LFO_noise_tilde_class = class_new(gensym("LFO_noise~"), ! (t_newmethod)LFO_noise_tilde_new, 0, sizeof(t_LFO_noise_tilde), 0, A_DEFFLOAT, 0); ! class_addmethod(LFO_noise_tilde_class, (t_method)LFO_noise_tilde_dsp, gensym("dsp"), 0); ! class_addfloat(LFO_noise_tilde_class, (t_method)LFO_noise_tilde_float); class_sethelpsymbol(LFO_noise_tilde_class, gensym("iemhelp/help-LFO_noise~")); }
Index: iem_blocksize~.c =================================================================== RCS file: /cvsroot/pure-data/externals/iemlib/src/iemlib2/iem_blocksize~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** iem_blocksize~.c 8 Nov 2006 10:48:53 -0000 1.1 --- iem_blocksize~.c 8 Nov 2006 14:19:30 -0000 1.2 *************** *** 13,17 **** static t_class *iem_blocksize_tilde_class;
! typedef struct _iem_blocksize { t_object x_obj; --- 13,17 ---- static t_class *iem_blocksize_tilde_class;
! typedef struct _iem_blocksize_tilde { t_object x_obj; *************** *** 21,38 **** } t_iem_blocksize_tilde;
! static void iem_blocksize_out(t_iem_blocksize_tilde *x) { outlet_float(x->x_obj.ob_outlet, x->x_blocksize); }
! static void iem_blocksize_free(t_iem_blocksize_tilde *x) { clock_free(x->x_clock); }
! static void *iem_blocksize_new(t_symbol *s) { t_iem_blocksize_tilde *x = (t_iem_blocksize_tilde *)pd_new(iem_blocksize_tilde_class); ! x->x_clock = clock_new(x, (t_method)iem_blocksize_out); outlet_new(&x->x_obj, &s_float); x->x_blocksize = 64.0f; --- 21,38 ---- } t_iem_blocksize_tilde;
! static void iem_blocksize_tilde_out(t_iem_blocksize_tilde *x) { outlet_float(x->x_obj.ob_outlet, x->x_blocksize); }
! static void iem_blocksize_tilde_free(t_iem_blocksize_tilde *x) { clock_free(x->x_clock); }
! static void *iem_blocksize_tilde_new(t_symbol *s) { t_iem_blocksize_tilde *x = (t_iem_blocksize_tilde *)pd_new(iem_blocksize_tilde_class); ! x->x_clock = clock_new(x, (t_method)iem_blocksize_tilde_out); outlet_new(&x->x_obj, &s_float); x->x_blocksize = 64.0f; *************** *** 41,45 **** }
! static void iem_blocksize_dsp(t_iem_blocksize_tilde *x, t_signal **sp) { x->x_blocksize = (t_float)(sp[0]->s_n); --- 41,45 ---- }
! static void iem_blocksize_tilde_dsp(t_iem_blocksize_tilde *x, t_signal **sp) { x->x_blocksize = (t_float)(sp[0]->s_n); *************** *** 49,55 **** void iem_blocksize_tilde_setup(void) { ! iem_blocksize_tilde_class = class_new(gensym("iem_blocksize~"), (t_newmethod)iem_blocksize_new, ! (t_method)iem_blocksize_free, sizeof(t_iem_blocksize_tilde), 0, 0); CLASS_MAINSIGNALIN(iem_blocksize_tilde_class, t_iem_blocksize_tilde, x_f); ! class_addmethod(iem_blocksize_tilde_class, (t_method)iem_blocksize_dsp, gensym("dsp"), 0); } --- 49,55 ---- void iem_blocksize_tilde_setup(void) { ! iem_blocksize_tilde_class = class_new(gensym("iem_blocksize~"), (t_newmethod)iem_blocksize_tilde_new, ! (t_method)iem_blocksize_tilde_free, sizeof(t_iem_blocksize_tilde), 0, 0); CLASS_MAINSIGNALIN(iem_blocksize_tilde_class, t_iem_blocksize_tilde, x_f); ! class_addmethod(iem_blocksize_tilde_class, (t_method)iem_blocksize_tilde_dsp, gensym("dsp"), 0); }
Index: m2f~.c =================================================================== RCS file: /cvsroot/pure-data/externals/iemlib/src/iemlib2/m2f~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** m2f~.c 8 Nov 2006 10:48:53 -0000 1.1 --- m2f~.c 8 Nov 2006 14:19:30 -0000 1.2 *************** *** 12,16 **** /* --------- obsolete --------- */
! #define M2FTABSIZE 2048
t_float *iem_m2f_tilde_table=(t_float *)0L; --- 12,16 ---- /* --------- obsolete --------- */
! #define M2FTILDETABSIZE 2048
t_float *iem_m2f_tilde_table=(t_float *)0L; *************** *** 24,28 **** } t_m2f_tilde;
! static void *m2f_new(void) { t_m2f_tilde *x = (t_m2f_tilde *)pd_new(m2f_tilde_class); --- 24,28 ---- } t_m2f_tilde;
! static void *m2f_tilde_new(void) { t_m2f_tilde *x = (t_m2f_tilde *)pd_new(m2f_tilde_class); *************** *** 32,36 **** }
! static t_int *m2f_perform(t_int *w) { t_float *in = (t_float *)(w[1]); --- 32,36 ---- }
! static t_int *m2f_tilde_perform(t_int *w) { t_float *in = (t_float *)(w[1]); *************** *** 52,56 **** dphase = (double)iinn + UNITBIT32; tf.tf_d = dphase; ! addr = tab + (tf.tf_i[HIOFFSET] & (M2FTABSIZE-1)); tf.tf_i[HIOFFSET] = normhipart; frac = tf.tf_d - UNITBIT32; --- 52,56 ---- dphase = (double)iinn + UNITBIT32; tf.tf_d = dphase; ! addr = tab + (tf.tf_i[HIOFFSET] & (M2FTILDETABSIZE-1)); tf.tf_i[HIOFFSET] = normhipart; frac = tf.tf_d - UNITBIT32; *************** *** 64,68 **** dphase = (double)iinn + UNITBIT32; tf.tf_d = dphase; ! addr = tab + (tf.tf_i[HIOFFSET] & (M2FTABSIZE-1)); tf.tf_i[HIOFFSET] = normhipart; while (--n) --- 64,68 ---- dphase = (double)iinn + UNITBIT32; tf.tf_d = dphase; ! addr = tab + (tf.tf_i[HIOFFSET] & (M2FTILDETABSIZE-1)); tf.tf_i[HIOFFSET] = normhipart; while (--n) *************** *** 74,78 **** f1 = addr[0]; f2 = addr[1]; ! addr = tab + (tf.tf_i[HIOFFSET] & (M2FTABSIZE-1)); *out++ = f1 + frac * (f2 - f1); tf.tf_i[HIOFFSET] = normhipart; --- 74,78 ---- f1 = addr[0]; f2 = addr[1]; ! addr = tab + (tf.tf_i[HIOFFSET] & (M2FTILDETABSIZE-1)); *out++ = f1 + frac * (f2 - f1); tf.tf_i[HIOFFSET] = normhipart; *************** *** 86,95 **** }
! static void m2f_dsp(t_m2f_tilde *x, t_signal **sp) { ! dsp_add(m2f_perform, 4, sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); }
! static void m2f_maketable(void) { union tabfudge tf; --- 86,95 ---- }
! static void m2f_tilde_dsp(t_m2f_tilde *x, t_signal **sp) { ! dsp_add(m2f_tilde_perform, 4, sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); }
! static void m2f_tilde_maketable(void) { union tabfudge tf; *************** *** 100,105 **** t_float *fp, midi, refexp=440.0*exp(-5.75*log(2.0));
! iem_m2f_tilde_table = (t_float *)getbytes(sizeof(t_float) * (M2FTABSIZE+1)); ! for(i=0, fp=iem_m2f_tilde_table, midi=-67.0; i<=M2FTABSIZE; i++, fp++, midi+=0.1) *fp = refexp * exp(0.057762265047 * midi); } --- 100,105 ---- t_float *fp, midi, refexp=440.0*exp(-5.75*log(2.0));
! iem_m2f_tilde_table = (t_float *)getbytes(sizeof(t_float) * (M2FTILDETABSIZE+1)); ! for(i=0, fp=iem_m2f_tilde_table, midi=-67.0; i<=M2FTILDETABSIZE; i++, fp++, midi+=0.1) *fp = refexp * exp(0.057762265047 * midi); } *************** *** 111,119 **** void m2f_tilde_setup(void) { ! m2f_tilde_class = class_new(gensym("m2f~"), (t_newmethod)m2f_new, 0, sizeof(t_m2f_tilde), 0, 0); CLASS_MAINSIGNALIN(m2f_tilde_class, t_m2f_tilde, x_msi); ! class_addmethod(m2f_tilde_class, (t_method)m2f_dsp, gensym("dsp"), 0); ! m2f_maketable(); class_sethelpsymbol(m2f_tilde_class, gensym("iemhelp/help-m2f~")); } --- 111,119 ---- void m2f_tilde_setup(void) { ! m2f_tilde_class = class_new(gensym("m2f~"), (t_newmethod)m2f_tilde_new, 0, sizeof(t_m2f_tilde), 0, 0); CLASS_MAINSIGNALIN(m2f_tilde_class, t_m2f_tilde, x_msi); ! class_addmethod(m2f_tilde_class, (t_method)m2f_tilde_dsp, gensym("dsp"), 0); ! m2f_tilde_maketable(); class_sethelpsymbol(m2f_tilde_class, gensym("iemhelp/help-m2f~")); }
Index: fade~.c =================================================================== RCS file: /cvsroot/pure-data/externals/iemlib/src/iemlib2/fade~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fade~.c 8 Nov 2006 10:48:53 -0000 1.1 --- fade~.c 8 Nov 2006 14:19:30 -0000 1.2 *************** *** 22,26 **** static t_class *fade_tilde_class;
! typedef struct _fade { t_object x_obj; --- 22,26 ---- static t_class *fade_tilde_class;
! typedef struct _fade_tilde { t_object x_obj; *************** *** 29,33 **** } t_fade_tilde;
! static void fade_set(t_fade_tilde *x, t_symbol *s) { if(s == gensym("_lin")) --- 29,33 ---- } t_fade_tilde;
! static void fade_tilde_set(t_fade_tilde *x, t_symbol *s) { if(s == gensym("_lin")) *************** *** 45,49 **** }
! static void *fade_new(t_symbol *s) { t_fade_tilde *x = (t_fade_tilde *)pd_new(fade_tilde_class); --- 45,49 ---- }
! static void *fade_tilde_new(t_symbol *s) { t_fade_tilde *x = (t_fade_tilde *)pd_new(fade_tilde_class); *************** *** 51,59 **** x->x_f = 0; x->x_table = iem_fade_tilde_table_lin; ! fade_set(x, s); return (x); }
! static t_int *fade_perform(t_int *w) { t_float *in = (t_float *)(w[1]); --- 51,59 ---- x->x_f = 0; x->x_table = iem_fade_tilde_table_lin; ! fade_tilde_set(x, s); return (x); }
! static t_int *fade_tilde_perform(t_int *w) { t_float *in = (t_float *)(w[1]); *************** *** 106,115 **** }
! static void fade_dsp(t_fade_tilde *x, t_signal **sp) { ! dsp_add(fade_perform, 4, sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); }
! static void fade_maketable(void) { int i; --- 106,115 ---- }
! static void fade_tilde_dsp(t_fade_tilde *x, t_signal **sp) { ! dsp_add(fade_tilde_perform, 4, sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); }
! static void fade_tilde_maketable(void) { int i; *************** *** 167,176 **** void fade_tilde_setup(void) { ! fade_tilde_class = class_new(gensym("fade~"), (t_newmethod)fade_new, 0, sizeof(t_fade_tilde), 0, A_DEFSYM, 0); CLASS_MAINSIGNALIN(fade_tilde_class, t_fade_tilde, x_f); ! class_addmethod(fade_tilde_class, (t_method)fade_dsp, gensym("dsp"), 0); ! class_addmethod(fade_tilde_class, (t_method)fade_set, gensym("set"), A_DEFSYM, 0); class_sethelpsymbol(fade_tilde_class, gensym("iemhelp/help-fade~")); ! fade_maketable(); } --- 167,176 ---- void fade_tilde_setup(void) { ! fade_tilde_class = class_new(gensym("fade~"), (t_newmethod)fade_tilde_new, 0, sizeof(t_fade_tilde), 0, A_DEFSYM, 0); CLASS_MAINSIGNALIN(fade_tilde_class, t_fade_tilde, x_f); ! class_addmethod(fade_tilde_class, (t_method)fade_tilde_dsp, gensym("dsp"), 0); ! class_addmethod(fade_tilde_class, (t_method)fade_tilde_set, gensym("set"), A_DEFSYM, 0); class_sethelpsymbol(fade_tilde_class, gensym("iemhelp/help-fade~")); ! fade_tilde_maketable(); }