*** empty log message ***
[chuck-blob.git] / exile / v1 / src / ugen_filter.cpp
blob04fa84a6bf4302918a45238384d7f35bc9ea184a
1 /*----------------------------------------------------------------------------
2 ChucK Concurrent, On-the-fly Audio Programming Language
3 Compiler and Virtual Machine
5 Copyright (c) 2004 Ge Wang and Perry R. Cook. All rights reserved.
6 http://chuck.cs.princeton.edu/
7 http://soundlab.cs.princeton.edu/
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 U.S.A.
23 -----------------------------------------------------------------------------*/
25 //-----------------------------------------------------------------------------
26 // file: ugen_filter.cpp
27 // desc: ...
29 // author: Ge Wang (gewang@cs.princeton.edu)
30 // Perry R. Cook (prc@cs.princeton.edu)
31 // date: Spring 2004
32 //-----------------------------------------------------------------------------
33 #include "ugen_filter.h"
34 #include <math.h>
35 #include <stdlib.h>
38 static t_CKUINT g_srate = 0;
41 //-----------------------------------------------------------------------------
42 // name: filter_query()
43 // desc: ...
44 //-----------------------------------------------------------------------------
45 DLL_QUERY filter_query( Chuck_DL_Query * QUERY )
47 // set srate
48 g_srate = QUERY->srate;
50 // add filter
51 QUERY->ugen_add( QUERY, "filter", NULL );
52 // set funcs
53 QUERY->ugen_func( QUERY, filter_ctor, filter_dtor, filter_tick, filter_pmsg );
54 // ctrl func
55 // QUERY->ugen_ctrl( QUERY, filter_ctrl_top, "float", "value" );
56 // QUERY->ugen_ctrl( QUERY, filter_ctrl_bottom, "float", "value" );
58 // add biquad
59 QUERY->ugen_add( QUERY, "biquad", NULL );
60 // set funcs
61 QUERY->ugen_func( QUERY, biquad_ctor, biquad_dtor, biquad_tick, NULL );
62 // ctrl func
63 QUERY->ugen_ctrl( QUERY, biquad_ctrl_pfreq, NULL, "float", "pfreq" );
64 QUERY->ugen_ctrl( QUERY, biquad_ctrl_prad, NULL, "float", "prad" );
65 QUERY->ugen_ctrl( QUERY, biquad_ctrl_zfreq, NULL, "float", "zfreq" );
66 QUERY->ugen_ctrl( QUERY, biquad_ctrl_zrad, NULL, "float", "zrad" );
67 QUERY->ugen_ctrl( QUERY, biquad_ctrl_norm, NULL, "int", "norm" );
68 QUERY->ugen_ctrl( QUERY, biquad_ctrl_pregain, NULL, "float", "pregain" );
69 QUERY->ugen_ctrl( QUERY, biquad_ctrl_eqzs, NULL, "int", "eqzs" );
70 QUERY->ugen_ctrl( QUERY, biquad_ctrl_b0, NULL, "float", "b0" );
71 QUERY->ugen_ctrl( QUERY, biquad_ctrl_b1, NULL, "float", "b1" );
72 QUERY->ugen_ctrl( QUERY, biquad_ctrl_b2, NULL, "float", "b2" );
73 QUERY->ugen_ctrl( QUERY, biquad_ctrl_a0, NULL, "float", "a0" );
74 QUERY->ugen_ctrl( QUERY, biquad_ctrl_a1, NULL, "float", "a1" );
75 QUERY->ugen_ctrl( QUERY, biquad_ctrl_a2, NULL, "float", "a2" );
77 // add onepole
78 QUERY->ugen_add( QUERY, "onepole", NULL );
79 // set funcs
80 QUERY->ugen_func( QUERY, onepole_ctor, onepole_dtor, onepole_tick, NULL );
81 // ctrl func
82 QUERY->ugen_ctrl( QUERY, onepole_ctrl_pole, NULL, "float", "pole" );
84 // add onezero
85 QUERY->ugen_add( QUERY, "onezero", NULL );
86 // set funcs
87 QUERY->ugen_func( QUERY, onezero_ctor, onezero_dtor, onezero_tick, NULL );
88 // ctrl func
89 QUERY->ugen_ctrl( QUERY, onezero_ctrl_zero, NULL,"float", "zero" );
91 // add twopole
92 QUERY->ugen_add( QUERY, "twopole", NULL );
93 // set funcs
94 QUERY->ugen_func( QUERY, twopole_ctor, twopole_dtor, twopole_tick, NULL );
95 // ctrl func
96 QUERY->ugen_ctrl( QUERY, twopole_ctrl_freq, NULL, "float", "freq" );
97 QUERY->ugen_ctrl( QUERY, twopole_ctrl_rad, NULL, "float", "rad" );
98 QUERY->ugen_ctrl( QUERY, twopole_ctrl_norm, NULL, "int", "norm" );
100 // add twozero
101 QUERY->ugen_add( QUERY, "twozero", NULL );
102 // set funcs
103 QUERY->ugen_func( QUERY, twozero_ctor, twozero_dtor, twozero_tick, NULL );
104 // ctrl func
105 QUERY->ugen_ctrl( QUERY, twozero_ctrl_freq, NULL, "float", "freq" );
106 QUERY->ugen_ctrl( QUERY, twozero_ctrl_rad, NULL, "float", "rad" );
108 // add gQ
109 // QUERY->ugen_add( QUERY, "gQ", NULL );
110 // set funcs
111 // QUERY->ugen_func( QUERY, gQ_ctor, gQ_dtor, gQ_tick, NULL );
112 // ctrl func
113 // QUERY->ugen_ctrl( QUERY, gQ_ctrl_freq, NULL, "float", "freq" );
114 // QUERY->ugen_ctrl( QUERY, gQ_ctrl_rad, NULL, "float", "rad" );
115 // QUERY->ugen_ctrl( QUERY, gQ_ctrl_norm, NULL, "int", "norm" );
117 // add allpass
118 // QUERY->ugen_add( QUERY, "allpass", NULL );
119 // set funcs
120 // QUERY->ugen_func( QUERY, allpass_ctor, allpass_dtor, allpass_tick, allpass_pmsg );
122 // add delay
123 QUERY->ugen_add( QUERY, "delay", NULL );
124 // set funcs
125 QUERY->ugen_func( QUERY, delay_ctor, delay_dtor, delay_tick, NULL );
126 // ctrl func
127 QUERY->ugen_ctrl( QUERY, delay_ctrl_delay, NULL, "float", "delay" );
128 QUERY->ugen_ctrl( QUERY, delay_ctrl_max, NULL, "float", "max" );
129 // QUERY->ugen_ctrl( QUERY, delay_ctrl_energy, NULL,"int", "energy" );
130 // QUERY->ugen_ctrl( QUERY, delay_ctrl_tap, NULL, "int", "tap" );
131 // QUERY->ugen_ctrl( QUERY, delay_ctrl_ftap, NULL, "float", "ftap" );
133 // add delayA
134 QUERY->ugen_add( QUERY, "delayA", NULL );
135 // set funcs
136 QUERY->ugen_func( QUERY, delayA_ctor, delayA_dtor, delayA_tick, NULL );
137 // ctrl func
138 QUERY->ugen_ctrl( QUERY, delayA_ctrl_delay, NULL, "float", "delay" );
139 QUERY->ugen_ctrl( QUERY, delayA_ctrl_max, NULL, "float", "max" );
141 // add one
142 QUERY->ugen_add( QUERY, "delayL", NULL );
143 // set funcs
144 QUERY->ugen_func( QUERY, delayL_ctor, delayL_dtor, delayL_tick, NULL );
145 // ctrl func
146 QUERY->ugen_ctrl( QUERY, delayL_ctrl_delay, NULL, "float", "delay" );
147 QUERY->ugen_ctrl( QUERY, delayL_ctrl_max, NULL, "float", "max" );
150 return TRUE;
156 //-----------------------------------------------------------------------------
157 // name: filter
158 // desc: ...
159 //-----------------------------------------------------------------------------
160 struct filter_data
162 t_CKUINT nB;
163 t_CKUINT nA;
164 SAMPLE * b;
165 SAMPLE * a;
166 SAMPLE * input;
167 SAMPLE * output;
169 filter_data()
171 a = b = NULL;
172 alloc( 1, 1 );
173 a[0] = b[0] = 1.0f;
176 void alloc( t_CKUINT _b, t_CKUINT _a )
178 nB = _b; nA = _a;
179 if( b ) delete b;
180 if( a ) delete a;
181 if( input ) delete input;
182 if( output ) delete output;
183 b = new SAMPLE[nB];
184 a = new SAMPLE[nA];
185 input = new SAMPLE[nB];
186 output = new SAMPLE[nA];
189 SAMPLE tick( SAMPLE in )
191 int i;
193 output[0] = 0.0;
194 input[0] = in;
195 for( i = nB-1; i > 0; i-- )
197 output[0] += b[i] * input[i];
198 input[i] = input[i-1];
200 output[0] += b[0] * input[0];
202 for (i=nA-1; i>0; i--)
204 output[0] += -a[i] * output[i];
205 output[i] = output[i-1];
208 return output[0];
212 UGEN_CTOR filter_ctor( t_CKTIME now )
214 return new filter_data;
217 UGEN_DTOR filter_dtor( t_CKTIME now, void * data )
219 delete (filter_data *)data;
222 UGEN_TICK filter_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
224 filter_data * d = (filter_data *)data;
225 *out = d->tick( in );
226 return TRUE;
229 UGEN_CTRL filter_ctrl_coefs( t_CKTIME now, void * data, void * value )
233 UGEN_PMSG filter_pmsg( t_CKTIME now, void * data, const char * msg, void * value )
235 return FALSE;
241 //-----------------------------------------------------------------------------
242 // name: biquad
243 // desc: biquad filter
244 //-----------------------------------------------------------------------------
245 struct biquad_data
247 SAMPLE m_a0, m_a1, m_a2;
248 SAMPLE m_b0, m_b1, m_b2;
250 SAMPLE m_input0, m_input1, m_input2;
251 SAMPLE m_output0, m_output1, m_output2;
253 float pfreq, zfreq;
254 float prad, zrad;
255 t_CKBOOL norm;
256 t_CKUINT srate;
258 biquad_data()
260 m_a0 = m_b0 = 1.0f;
261 m_a1 = m_a2 = 0.0f;
262 m_b1 = 0.0f; m_b2 = 0.0f;
264 m_input0 = m_input1 = m_input2 = 0.0f;
265 m_output0 = m_output1 = m_output2 = 0.0f;
267 pfreq = zfreq = 0.0f;
268 prad = zrad = 0.0f;
269 norm = FALSE;
270 srate = g_srate;
274 UGEN_CTOR biquad_ctor( t_CKTIME now )
276 return new biquad_data;
279 UGEN_DTOR biquad_dtor( t_CKTIME now, void * data )
281 delete (biquad_data *)data;
284 UGEN_TICK biquad_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
286 biquad_data * d = (biquad_data *)data;
288 d->m_input0 = d->m_a0 * in;
289 d->m_output0 = d->m_b0 * d->m_input0 + d->m_b1 * d->m_input1 + d->m_b2 * d->m_input2;
290 d->m_output0 -= d->m_a2 * d->m_output2 + d->m_a1 * d->m_output1;
291 d->m_input2 = d->m_input1;
292 d->m_input1 = d->m_input0;
293 d->m_output2 = d->m_output1;
294 d->m_output1 = d->m_output0;
296 *out = d->m_output0;
298 return TRUE;
301 void biquad_set_reson( biquad_data * d )
303 d->m_a2 = d->prad * d->prad;
304 d->m_a1 = -2.0f * d->prad * (float)cos(2.0 * 3.141592653590 * (double)d->pfreq / (double)d->srate);
306 if ( d->norm ) {
307 // Use zeros at +- 1 and normalize the filter peak gain.
308 d->m_b0= 0.5f - 0.5f * d->m_a2;
309 d->m_b1 = -1.0f;
310 d->m_b2 = -d->m_b0;
314 UGEN_CTRL biquad_ctrl_pfreq( t_CKTIME now, void * data, void * value )
316 biquad_data * d = (biquad_data *)data;
317 d->pfreq = (float)GET_CK_FLOAT(value);
318 biquad_set_reson( d );
321 UGEN_CTRL biquad_ctrl_prad( t_CKTIME now, void * data, void * value )
323 biquad_data * d = (biquad_data *)data;
324 d->prad = (float)GET_CK_FLOAT(value);
325 biquad_set_reson( d );
328 void biquad_set_notch( biquad_data * d )
330 d->m_b2 = d->zrad * d->zrad;
331 d->m_b1 = -2.0f * d->zrad * (float)cos(2.0 * 3.141592653590 * (double)d->zfreq / (double)d->srate);
334 UGEN_CTRL biquad_ctrl_zfreq( t_CKTIME now, void * data, void * value )
336 biquad_data * d = (biquad_data *)data;
337 d->zfreq = (float)GET_CK_FLOAT(value);
338 biquad_set_notch( d );
341 UGEN_CTRL biquad_ctrl_zrad( t_CKTIME now, void * data, void * value )
343 biquad_data * d = (biquad_data *)data;
344 d->zrad = (float)GET_CK_FLOAT(value);
345 biquad_set_notch( d );
348 UGEN_CTRL biquad_ctrl_norm( t_CKTIME now, void * data, void * value )
350 biquad_data * d = (biquad_data *)data;
351 d->norm = *(t_CKBOOL *)value;
352 biquad_set_reson( d );
355 UGEN_CTRL biquad_ctrl_pregain( t_CKTIME now, void * data, void * value )
357 biquad_data * d = (biquad_data *)data;
358 d->m_a0 = (float)GET_CK_FLOAT(value);
361 UGEN_CTRL biquad_ctrl_eqzs( t_CKTIME now, void * data, void * value )
363 if( *(t_CKUINT *)value )
365 biquad_data * d = (biquad_data *)data;
366 d->m_b0 = 1.0f;
367 d->m_b1 = 0.0f;
368 d->m_b2 = -1.0f;
372 UGEN_CTRL biquad_ctrl_b0( t_CKTIME now, void * data, void * value )
374 biquad_data * d = (biquad_data *)data;
375 d->m_b0 = (float)GET_CK_FLOAT(value);
378 UGEN_CTRL biquad_ctrl_b1( t_CKTIME now, void * data, void * value )
380 biquad_data * d = (biquad_data *)data;
381 d->m_b1 = (float)GET_CK_FLOAT(value);
384 UGEN_CTRL biquad_ctrl_b2( t_CKTIME now, void * data, void * value )
386 biquad_data * d = (biquad_data *)data;
387 d->m_b2 = (float)GET_CK_FLOAT(value);
390 UGEN_CTRL biquad_ctrl_a0( t_CKTIME now, void * data, void * value )
392 biquad_data * d = (biquad_data *)data;
393 d->m_a0 = (float)GET_CK_FLOAT(value);
396 UGEN_CTRL biquad_ctrl_a1( t_CKTIME now, void * data, void * value )
398 biquad_data * d = (biquad_data *)data;
399 d->m_a1 = (float)GET_CK_FLOAT(value);
402 UGEN_CTRL biquad_ctrl_a2( t_CKTIME now, void * data, void * value )
404 biquad_data * d = (biquad_data *)data;
405 d->m_a2 = (float)GET_CK_FLOAT(value);
411 //-----------------------------------------------------------------------------
412 // name: onepole
413 // desc: onepole filter
414 //-----------------------------------------------------------------------------
415 UGEN_CTOR onepole_ctor( t_CKTIME now )
417 return new biquad_data;
420 UGEN_DTOR onepole_dtor( t_CKTIME now, void * data )
422 delete (biquad_data *)data;
425 UGEN_TICK onepole_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
427 biquad_data * d = (biquad_data *)data;
429 d->m_input0 = in;
430 d->m_output0 = d->m_b0 * d->m_input0 - d->m_a1 * d->m_output1;
431 d->m_output1 = d->m_output0;
433 *out = d->m_output0;
435 return TRUE;
438 UGEN_CTRL onepole_ctrl_pole( t_CKTIME now, void * data, void * value )
440 float f = (float)GET_CK_FLOAT(value);
441 biquad_data * d = (biquad_data *)data;
443 if( f > 0.0f )
444 d->m_b0 = 1.0f - f;
445 else
446 d->m_b0 = 1.0f + f;
448 d->m_a0 = -f;
454 //-----------------------------------------------------------------------------
455 // name: onezero
456 // desc: onezero filter
457 //-----------------------------------------------------------------------------
458 UGEN_CTOR onezero_ctor( t_CKTIME now )
460 return new biquad_data;
463 UGEN_DTOR onezero_dtor( t_CKTIME now, void * data )
465 delete (biquad_data *)data;
468 UGEN_TICK onezero_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
470 biquad_data * d = (biquad_data *)data;
472 d->m_input0 = in;
473 d->m_output0 = d->m_b1 * d->m_input1 + d->m_b0 * d->m_input0;
474 d->m_input1 = d->m_input0;
476 *out = d->m_output0;
478 return TRUE;
481 UGEN_CTRL onezero_ctrl_zero( t_CKTIME now, void * data, void * value )
483 float f = (float)GET_CK_FLOAT(value);
484 biquad_data * d = (biquad_data *)data;
486 if( f > 0.0f )
487 d->m_b0 = 1.0f / ( 1.0f + f );
488 else
489 d->m_b0 = 1.0f / ( 1.0f - f );
491 d->m_b1 = -f * d->m_b0;
497 //-----------------------------------------------------------------------------
498 // name: twopole
499 // desc: twopole filter
500 //-----------------------------------------------------------------------------
501 UGEN_CTOR twopole_ctor( t_CKTIME now )
503 return new biquad_data;
506 UGEN_DTOR twopole_dtor( t_CKTIME now, void * data )
508 delete (biquad_data *)data;
511 UGEN_TICK twopole_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
513 biquad_data * d = (biquad_data *)data;
515 d->m_input0 = in;
516 d->m_output0 = d->m_b0 * d->m_input0 - d->m_a2 * d->m_output2 - d->m_a1 * d->m_output1;
517 d->m_output2 = d->m_output1;
518 d->m_output1 = d->m_output0;
520 *out = d->m_output0;
522 return TRUE;
525 UGEN_CTRL twopole_ctrl_freq( t_CKTIME now, void * data, void * value )
527 biquad_data * d = (biquad_data *)data;
528 d->pfreq = (float)GET_CK_FLOAT(value);
529 biquad_set_reson( d );
531 if( d->norm )
533 // Normalize the filter gain ... not terribly efficient.
534 double real = 1.0 - d->prad + (d->m_a2 - d->prad) * cos( 2.0 * 3.14159265358979323846 * d->pfreq / d->srate );
535 double imag = (d->m_a2 - d->prad) * sin( 2.0 * 3.14159265358979323846 * d->pfreq / d->srate );
536 d->m_b0 = sqrt( real*real + imag*imag );
540 UGEN_CTRL twopole_ctrl_rad( t_CKTIME now, void * data, void * value )
542 biquad_data * d = (biquad_data *)data;
543 d->prad = (float)GET_CK_FLOAT(value);
544 biquad_set_reson( d );
546 if( d->norm )
548 // Normalize the filter gain ... not terrbly efficient
549 double real = 1.0 - d->prad + (d->m_a2 - d->prad) * cos( 2.0 * 3.14159265358979323846 * d->pfreq / d->srate );
550 double imag = (d->m_a2 - d->prad) * sin( 2.0 * 3.14159265358979323846 * d->pfreq / d->srate );
551 d->m_b0 = sqrt( real*real + imag*imag );
555 UGEN_CTRL twopole_ctrl_norm( t_CKTIME now, void * data, void * value )
557 biquad_data * d = (biquad_data *)data;
558 d->norm = *(t_CKBOOL *)value;
560 if( d->norm )
562 // Normalize the filter gain ... not terribly efficient
563 double real = 1.0 - d->prad + (d->m_a2 - d->prad) * cos( 2.0 * 3.14159265358979323846 * d->pfreq / d->srate );
564 double imag = (d->m_a2 - d->prad) * sin( 2.0 * 3.14159265358979323846 * d->pfreq / d->srate );
565 d->m_b0 = sqrt( real*real + imag*imag );
572 //-----------------------------------------------------------------------------
573 // name: twozero
574 // desc: twozero filter
575 //-----------------------------------------------------------------------------
576 UGEN_CTOR twozero_ctor( t_CKTIME now )
578 return new biquad_data;
581 UGEN_DTOR twozero_dtor( t_CKTIME now, void * data )
583 delete (biquad_data *)data;
586 UGEN_TICK twozero_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
588 biquad_data * d = (biquad_data *)data;
590 d->m_input0 = in;
591 d->m_output0 = d->m_b0 * d->m_input0 + d->m_b1 * d->m_input1 + d->m_b2 * d->m_input2;
592 d->m_input2 = d->m_input1;
593 d->m_input1 = d->m_input0;
595 *out = d->m_output0;
597 return TRUE;
600 UGEN_CTRL twozero_ctrl_freq( t_CKTIME now, void * data, void * value )
602 biquad_data * d = (biquad_data *)data;
603 d->zfreq = (float)GET_CK_FLOAT(value);
604 biquad_set_notch( d );
606 // normalize the filter gain
607 if( d->m_b1 > 0.0f )
608 d->m_b0 = 1.0f / (1.0f+d->m_b1+d->m_b2);
609 else
610 d->m_b0 = 1.0f / (1.0f-d->m_b1+d->m_b2);
611 d->m_b1 *= d->m_b0;
612 d->m_b2 *= d->m_b0;
615 UGEN_CTRL twozero_ctrl_rad( t_CKTIME now, void * data, void * value )
617 biquad_data * d = (biquad_data *)data;
618 d->zrad = (float)GET_CK_FLOAT(value);
619 biquad_set_notch( d );
621 // normalize the filter gain
622 if( d->m_b1 > 0.0f )
623 d->m_b0 = 1.0f / (1.0f+d->m_b1+d->m_b2);
624 else
625 d->m_b0 = 1.0f / (1.0f-d->m_b1+d->m_b2);
626 d->m_b1 *= d->m_b0;
627 d->m_b2 *= d->m_b0;
633 //-----------------------------------------------------------------------------
634 // name: gQ
635 // desc: gQ filter - a la Dan Trueman
636 //-----------------------------------------------------------------------------
637 UGEN_CTOR gQ_ctor( t_CKTIME now )
639 return NULL;
642 UGEN_DTOR gQ_dtor( t_CKTIME now, void * data )
646 UGEN_TICK gQ_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
648 return TRUE;
651 UGEN_CTRL gQ_ctrl_freq( t_CKTIME now, void * data, void * value )
655 UGEN_CTRL gQ_ctrl_rad( t_CKTIME now, void * data, void * value )
662 //-----------------------------------------------------------------------------
663 // name: allpass
664 // desc: allpass filter
665 //-----------------------------------------------------------------------------
666 UGEN_CTOR allpass_ctor( t_CKTIME now )
668 return NULL;
671 UGEN_DTOR allpass_dtor( t_CKTIME now, void * data )
675 UGEN_TICK allpass_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
677 return TRUE;
680 UGEN_PMSG allpass_pmsg( t_CKTIME now, void * data, const char * msg, void * value )
682 return TRUE;
688 //-----------------------------------------------------------------------------
689 // name: delay
690 // desc: ...
691 //-----------------------------------------------------------------------------
692 UGEN_CTOR delay_ctor( t_CKTIME now )
694 return NULL;
697 UGEN_DTOR delay_dtor( t_CKTIME now, void * data )
701 UGEN_TICK delay_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
703 return TRUE;
706 UGEN_CTRL delay_ctrl_delay( t_CKTIME now, void * data, void * value )
710 UGEN_CTRL delay_ctrl_max( t_CKTIME now, void * data, void * value )
714 UGEN_CTRL delay_ctrl_tap( t_CKTIME now, void * data, void * value )
718 UGEN_CTRL delay_ctrl_energy( t_CKTIME now, void * data, void * value )
725 //-----------------------------------------------------------------------------
726 // name: delayA
727 // desc: delay - allpass interpolation
728 //-----------------------------------------------------------------------------
729 UGEN_CTOR delayA_ctor( t_CKTIME now )
731 return NULL;
734 UGEN_DTOR delayA_dtor( t_CKTIME now, void * data )
738 UGEN_TICK delayA_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
740 return TRUE;
743 UGEN_CTRL delayA_ctrl_delay( t_CKTIME now, void * data, void * value )
747 UGEN_CTRL delayA_ctrl_max( t_CKTIME now, void * data, void * value )
754 //-----------------------------------------------------------------------------
755 // name: delayL
756 // desc: delay - linear interpolation
757 //-----------------------------------------------------------------------------
758 UGEN_CTOR delayL_ctor( t_CKTIME now )
760 return NULL;
763 UGEN_DTOR delayL_dtor( t_CKTIME now, void * data )
767 UGEN_TICK delayL_tick( t_CKTIME now, void * data, SAMPLE in, SAMPLE * out )
769 return TRUE;
772 UGEN_CTRL delayL_ctrl_delay( t_CKTIME now, void * data, void * value )
776 UGEN_CTRL delayL_ctrl_max( t_CKTIME now, void * data, void * value )