aboutsummaryrefslogtreecommitdiff
path: root/src/iemlib2/m2f~.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iemlib2/m2f~.c')
-rw-r--r--src/iemlib2/m2f~.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/iemlib2/m2f~.c b/src/iemlib2/m2f~.c
index 7139d87..8774fe4 100644
--- a/src/iemlib2/m2f~.c
+++ b/src/iemlib2/m2f~.c
@@ -11,7 +11,7 @@ iemlib2 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005
/* ----------- m2f~ ----------- */
/* --------- obsolete --------- */
-#define M2FTABSIZE 2048
+#define M2FTILDETABSIZE 2048
t_float *iem_m2f_tilde_table=(t_float *)0L;
@@ -23,7 +23,7 @@ typedef struct _m2f
t_float x_msi;
} t_m2f_tilde;
-static void *m2f_new(void)
+static void *m2f_tilde_new(void)
{
t_m2f_tilde *x = (t_m2f_tilde *)pd_new(m2f_tilde_class);
outlet_new(&x->x_obj, gensym("signal"));
@@ -31,7 +31,7 @@ static void *m2f_new(void)
return (x);
}
-static t_int *m2f_perform(t_int *w)
+static t_int *m2f_tilde_perform(t_int *w)
{
t_float *in = (t_float *)(w[1]);
t_float *out = (t_float *)(w[2]);
@@ -51,7 +51,7 @@ static t_int *m2f_perform(t_int *w)
iinn = (*in++)*10.0+670.0;
dphase = (double)iinn + UNITBIT32;
tf.tf_d = dphase;
- addr = tab + (tf.tf_i[HIOFFSET] & (M2FTABSIZE-1));
+ addr = tab + (tf.tf_i[HIOFFSET] & (M2FTILDETABSIZE-1));
tf.tf_i[HIOFFSET] = normhipart;
frac = tf.tf_d - UNITBIT32;
f1 = addr[0];
@@ -63,7 +63,7 @@ static t_int *m2f_perform(t_int *w)
iinn = (*in++)*10.0+670.0;
dphase = (double)iinn + UNITBIT32;
tf.tf_d = dphase;
- addr = tab + (tf.tf_i[HIOFFSET] & (M2FTABSIZE-1));
+ addr = tab + (tf.tf_i[HIOFFSET] & (M2FTILDETABSIZE-1));
tf.tf_i[HIOFFSET] = normhipart;
while (--n)
{
@@ -73,7 +73,7 @@ static t_int *m2f_perform(t_int *w)
tf.tf_d = dphase;
f1 = addr[0];
f2 = addr[1];
- addr = tab + (tf.tf_i[HIOFFSET] & (M2FTABSIZE-1));
+ addr = tab + (tf.tf_i[HIOFFSET] & (M2FTILDETABSIZE-1));
*out++ = f1 + frac * (f2 - f1);
tf.tf_i[HIOFFSET] = normhipart;
}
@@ -85,12 +85,12 @@ static t_int *m2f_perform(t_int *w)
return (w+5);
}
-static void m2f_dsp(t_m2f_tilde *x, t_signal **sp)
+static void m2f_tilde_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);
+ dsp_add(m2f_tilde_perform, 4, sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n);
}
-static void m2f_maketable(void)
+static void m2f_tilde_maketable(void)
{
union tabfudge tf;
@@ -99,8 +99,8 @@ static void m2f_maketable(void)
int i;
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)
+ 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);
}
tf.tf_d = UNITBIT32 + 0.5;
@@ -110,10 +110,10 @@ static void m2f_maketable(void)
void m2f_tilde_setup(void)
{
- m2f_tilde_class = class_new(gensym("m2f~"), (t_newmethod)m2f_new, 0,
+ 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_dsp, gensym("dsp"), 0);
- m2f_maketable();
+ 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~"));
}