7
7
typedef struct _prevl
13
13
int m_buffer_index;
14
float *m_buffer; // circular buffer
14
t_float *m_buffer; // circular buffer
17
static void prevl_set(t_prevl *x, t_float lo, t_float hi, t_float size);
18
19
static void prevl_perform_float(t_prevl *x, t_float f)
97
post("prevl: size is minimum 1...");
99
logpost(x, 2, "[prevl] size is minimum 1");
101
post("prevl: higher bound cannot be higher than the buffer size...");
103
logpost(x, 2, "[prevl] higher bound (%g) cannot be greater than the buffer size (%g)",
106
post("prevl: lower bound cannot be negative...");
109
logpost(x, 2, "[prevl] lower bound cannot be negative");
111
post("prevl: higher bound cannot be smaller than one...");
114
logpost(x, 2, "[prevl] higher bound (%g) cannot be smaller than 1", hi);
116
post("prevl: higher bound must be higher than lower bound...");
119
logpost(x, 2, "[prevl] higher bound (%g) must be greater than lower bound (%g)",
120
freebytes(x->m_buffer, x->m_buffer_size);
122
x->m_hi=(float)((int)hi);
123
x->m_lo=(float)((int)lo);
124
x->m_buffer_size=(int)size;
125
x->m_buffer = (float*)getbytes(sizeof(float)*x->m_buffer_size);
125
x->m_hi=(t_float)((int)hi);
126
x->m_lo=(t_float)((int)lo);
128
if (x->m_buffer_size != size)
130
x->m_buffer_size=(int)size;
131
freebytes(x->m_buffer, x->m_buffer_size);
132
x->m_buffer = (t_float*)getbytes(sizeof(t_float)*x->m_buffer_size);
130
138
static void *prevl_new(t_float lo, t_float hi, t_float size)