diff --git a/externals/iem16/src/del16read~.c b/externals/iem16/src/del16read~.c index 99f71b8eb6ece89db856615bfcf42fcf59f24544..cc148a9d5452dde3be8465e7ba35e0c1ab180355 100644 --- a/externals/iem16/src/del16read~.c +++ b/externals/iem16/src/del16read~.c @@ -21,6 +21,19 @@ typedef struct _sigdel16read{ int x_zerodel; /* 0 or vecsize depending on read/write order */ } t_sigdel16read; +/* routine to check that all del16writes/del16reads/vds have same vecsize */ +/* copied from del16write~.c so that there's no dependency on del16write~ + existing before we instantiate an object from this class. (Also because + I don't feel like adding and bugfixing a shared library across platforms */ +static void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize){ + if (x->x_rsortno != ugen_getsortno()) { + x->x_vecsize = vecsize; + x->x_rsortno = ugen_getsortno(); + } + else if (vecsize != x->x_vecsize) + pd_error(x, "del16read/del16write/vd vector size mismatch"); +} + static void sigdel16read_16bit(t_sigdel16read *x, t_float f); static void *sigdel16read_new(t_symbol *s, t_floatarg f){ diff --git a/externals/iem16/src/del16write~.c b/externals/iem16/src/del16write~.c index f3b447ef27c216c876e6c2d6a62e1cc77d3abf1e..56f63237b635948838e574efee7f8323650cd12f 100644 --- a/externals/iem16/src/del16write~.c +++ b/externals/iem16/src/del16write~.c @@ -13,7 +13,7 @@ /* ----------------------------- del16write~ ----------------------------- */ /* routine to check that all del16writes/del16reads/vds have same vecsize */ -void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize){ +static void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize){ if (x->x_rsortno != ugen_getsortno()) { x->x_vecsize = vecsize; x->x_rsortno = ugen_getsortno(); diff --git a/externals/iem16/src/iem16_delay.h b/externals/iem16/src/iem16_delay.h new file mode 100644 index 0000000000000000000000000000000000000000..acb58b3e6da9ff28559ca4591ed4a62b8275bcbe --- /dev/null +++ b/externals/iem16/src/iem16_delay.h @@ -0,0 +1,51 @@ +/* copyleft (c) 2003 forum::für::umläute -- IOhannes m zmölnig @ IEM + * based on d_array.c from pd: + * Copyright (c) 1997-1999 Miller Puckette and others. + * For information on usage and redistribution, and for a DISCLAIMER OF ALL + * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ + +#ifndef INCLUDE_IEM16_DELAY_H__ +#define INCLUDE_IEM16_DELAY_H__ + +/* sampling */ + +#include "iem16.h" +#include <string.h> + + +#if defined __WIN32 || defined __WIN32__ +static int ugen_getsortno(void){return 0;} +#else +extern int ugen_getsortno(void); +#endif + + +t_class *sigdel16write_class; + +typedef struct del16writectl{ + int c_n; + t_iem16_16bit *c_vec; + int c_phase; +} t_del16writectl; + +typedef struct _sigdel16write{ + t_object x_obj; + t_symbol *x_sym; + t_del16writectl x_cspace; + int x_sortno; /* DSP sort number at which this was last put on chain */ + int x_rsortno; /* DSP sort # for first del16read or write in chain */ + int x_vecsize; /* vector size for del16read~ to use */ + float x_f; +} t_sigdel16write; + + +//void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize); + + +# define XTRASAMPS 4 +# define SAMPBLK 4 + + +#define DEFDELVS 64 /* LATER get this from canvas at DSP time */ + +#endif diff --git a/externals/iem16/src/iem16_table.h b/externals/iem16/src/iem16_table.h index 506fd8ae33b527d2df056cc22acc45a30e6dc8d3..fb3d179c3a31d30ea8300c7457b9cb07a45a1dbd 100644 --- a/externals/iem16/src/iem16_table.h +++ b/externals/iem16/src/iem16_table.h @@ -27,8 +27,8 @@ typedef struct _table16 { } t_table16; -EXTERN int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec); -EXTERN void table16_usedindsp(t_table16*x); +//EXTERN int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec); +//EXTERN void table16_usedindsp(t_table16*x); diff --git a/externals/iem16/src/tab16play~.c b/externals/iem16/src/tab16play~.c index 0fd1049bd5dac245144514358a410212d59b6a57..4af5df75df82d0b10c26c2c399e3d419c01ac07a 100644 --- a/externals/iem16/src/tab16play~.c +++ b/externals/iem16/src/tab16play~.c @@ -8,6 +8,17 @@ #include "iem16_table.h" +/* the following two functions are copied from table16.c so that each class can + be instantiated without a dependency on table16 already existing */ +static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){ + *size=x->x_size; + *vec =x->x_table; + return 1; +} + +static void table16_usedindsp(t_table16*x){ + x->x_usedindsp=1; +} /* ------------ tab16play~ - non-transposing sample playback --------------- */ diff --git a/externals/iem16/src/tab16read.c b/externals/iem16/src/tab16read.c index 17b6c5c84884105efc8d35b228d132160ed7aedc..20a2e865f393a62e354b1b835442351008a6df5a 100644 --- a/externals/iem16/src/tab16read.c +++ b/externals/iem16/src/tab16read.c @@ -8,6 +8,14 @@ #include "iem16_table.h" +/* the following function is copied from table16.c so that each class can + be instantiated without a dependency on table16 already existing */ +static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){ + *size=x->x_size; + *vec =x->x_table; + return 1; +} + /* ---------- tab16read: control, non-interpolating ------------------------ */ static t_class *tab16read_class; diff --git a/externals/iem16/src/tab16read4.c b/externals/iem16/src/tab16read4.c index 0d379791a41fed85a4a4828474fd1cf0694bd405..cebcf84134d8fb5cb249e14a5dce390680c86990 100644 --- a/externals/iem16/src/tab16read4.c +++ b/externals/iem16/src/tab16read4.c @@ -8,6 +8,14 @@ #include "iem16_table.h" +/* the following function is copied from table16.c so that each class can + be instantiated without a dependency on table16 already existing */ +static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){ + *size=x->x_size; + *vec =x->x_table; + return 1; +} + /* ---------- tab16read4: control, non-interpolating ------------------------ */ static t_class *tab16read4_class; diff --git a/externals/iem16/src/tab16read4~.c b/externals/iem16/src/tab16read4~.c index 7f2ed85f65a0400e032321e897affbc97b6110d7..c85ea0e55b2dfd0ad78d96984ced34b0134c8b59 100644 --- a/externals/iem16/src/tab16read4~.c +++ b/externals/iem16/src/tab16read4~.c @@ -8,6 +8,17 @@ #include "iem16_table.h" +/* the following two functions are copied from table16.c so that each class can + be instantiated without a dependency on table16 already existing */ +static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){ + *size=x->x_size; + *vec =x->x_table; + return 1; +} + +static void table16_usedindsp(t_table16*x){ + x->x_usedindsp=1; +} /******************** tab16read4~ ***********************/ diff --git a/externals/iem16/src/tab16read~.c b/externals/iem16/src/tab16read~.c index 9f5657587e6fcde31ba50a841420fd8dfb679c36..e384bb80619cb3a81ec42f172dfaf8a8da0ac5d7 100644 --- a/externals/iem16/src/tab16read~.c +++ b/externals/iem16/src/tab16read~.c @@ -8,6 +8,17 @@ #include "iem16_table.h" +/* the following two functions are copied from table16.c so that each class can + be instantiated without a dependency on table16 already existing */ +static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){ + *size=x->x_size; + *vec =x->x_table; + return 1; +} + +static void table16_usedindsp(t_table16*x){ + x->x_usedindsp=1; +} /******************** tab16read~ ***********************/ diff --git a/externals/iem16/src/tab16receive~.c b/externals/iem16/src/tab16receive~.c index 2aaf0a8ef1c6ce34acb0df27e4111bda90f174f0..6eaa8d6986c343658d4e1b1c105b70439fb875d3 100644 --- a/externals/iem16/src/tab16receive~.c +++ b/externals/iem16/src/tab16receive~.c @@ -8,6 +8,18 @@ #include "iem16_table.h" +/* the following two functions are copied from table16.c so that each class can + be instantiated without a dependency on table16 already existing */ +static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){ + *size=x->x_size; + *vec =x->x_table; + return 1; +} + +static void table16_usedindsp(t_table16*x){ + x->x_usedindsp=1; +} + /* ------------------------ tab16receive~ ------------------------- */ static t_class *tab16receive_class; diff --git a/externals/iem16/src/tab16send~.c b/externals/iem16/src/tab16send~.c index 50105a06f1148877db9d819c8c8364ae5695ed7b..9e8ede54257b07bd11ac016a62fefec804928b73 100644 --- a/externals/iem16/src/tab16send~.c +++ b/externals/iem16/src/tab16send~.c @@ -8,6 +8,17 @@ #include "iem16_table.h" +/* the following two functions are copied from table16.c so that each class can + be instantiated without a dependency on table16 already existing */ +static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){ + *size=x->x_size; + *vec =x->x_table; + return 1; +} + +static void table16_usedindsp(t_table16*x){ + x->x_usedindsp=1; +} /* ------------------------ tab16send~ ------------------------- */ diff --git a/externals/iem16/src/tab16write~.c b/externals/iem16/src/tab16write~.c index dc3f47018b57b42acf918c0cfc7d987725b4806c..f88574311a0f8b1c1123375a99e0a656fabeaafb 100644 --- a/externals/iem16/src/tab16write~.c +++ b/externals/iem16/src/tab16write~.c @@ -8,6 +8,19 @@ #include "iem16_table.h" +/* the following two functions are copied from table16.c so that each class can + be instantiated without a dependency on table16 already existing */ +static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){ + *size=x->x_size; + *vec =x->x_table; + return 1; +} + +static void table16_usedindsp(t_table16*x){ + x->x_usedindsp=1; +} + + /* ------------------------- tab16write~ -------------------------- */ static t_class *tab16write_tilde_class; diff --git a/externals/iem16/src/vd16~.c b/externals/iem16/src/vd16~.c index c3387fec598a394669860c6792868be10328418c..7a85eefb06d225faef3b734e635dbe60bac012e8 100644 --- a/externals/iem16/src/vd16~.c +++ b/externals/iem16/src/vd16~.c @@ -19,6 +19,20 @@ typedef struct _sig16vd{ float x_f; } t_sig16vd; + +/* routine to check that all del16writes/del16reads/vds have same vecsize */ +/* copied from del16write~.c so that there's no dependency on del16write~ + existing before we instantiate an object from this class. (Also because + I don't feel like adding and bugfixing a shared library across platforms */ +static void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize){ + if (x->x_rsortno != ugen_getsortno()) { + x->x_vecsize = vecsize; + x->x_rsortno = ugen_getsortno(); + } + else if (vecsize != x->x_vecsize) + pd_error(x, "del16read/del16write/vd vector size mismatch"); +} + static void *sig16vd_new(t_symbol *s){ t_sig16vd *x = (t_sig16vd *)pd_new(sig16vd_class); if (!*s->s_name) s = gensym("vd~");