/* --------------- signals ----------------------------------- */ #define MAXLOGSIG 13 #define MAXSIGSIZE (1 << MAXLOGSIG) #ifndef SAMPLE_TYPEDEF typedef int t_int; typedef float t_sample, t_float; #define SAMPLE_TYPEDEF #endif typedef struct _signal { long s_n; t_sample *s_vec; float s_sr; struct _signal *s_next; struct _signal *s_nextused; short s_refcount; short s_size; // element size (* s_n == memory) #ifdef ALTIVEC_ATTEMPT char *s_ptr; // what to free #endif } t_signal; typedef struct _dspchain { t_object c_ob; t_int *c_chain; long c_chainsize; long c_callcount; long c_usedcount; long c_reusedcount; long c_freedcount; long c_sr; long c_bs; t_signal *c_usedlist; t_signal *c_freelist; t_signal *c_zero; struct _ugenbox *c_ugenlist; // temporary variable, allows reentrant compiling struct _dspchain *c_prev; void *c_patcher; // top-level parent or 0 if global void *c_inlets; // collection of inlets void *c_outlets; // collection of outlets t_signal *c_inputs; // signal input list (zero before first exec) t_signal *c_outputs; // signal output list // have to determine whether freelist is global or local long c_broken; // object being freed, don't run it } t_dspchain; typedef t_int *(*t_perfroutine)(t_int *args); t_int *plus_perform(t_int *args); t_int *sig_perform(t_int *args); t_int *copy_perform(t_int *args); t_int *plus2_perform(t_int *w); int sys_getblksize(void); float sys_getsr(void); int sys_getch(void); void dsp_add(t_perfroutine f, int n, ...); t_dspchain *dspchain_start(long bs, long sr); t_dspchain *dspchain_get(void); t_dspchain *dspchain_compile(struct patcher *p, long bs, long sr); void dspchain_tick(t_dspchain *c);