diff options
-rw-r--r-- | nusmuk-audio/tabosc4c~.c | 36 | ||||
-rw-r--r-- | nusmuk-audio/tabosci~.c | 48 |
2 files changed, 42 insertions, 42 deletions
diff --git a/nusmuk-audio/tabosc4c~.c b/nusmuk-audio/tabosc4c~.c index ad4e7a2..c299708 100644 --- a/nusmuk-audio/tabosc4c~.c +++ b/nusmuk-audio/tabosc4c~.c @@ -2,7 +2,7 @@ // can replace with tabosc4~ // most of this code comes from pd. just the interpolation shematic is diferent. -/* +/* This software is copyrighted by Miller Puckette and others. The following terms (the "Standard Improved BSD License") apply to all files associated with the software unless explicitly disclaimed in individual files: @@ -13,12 +13,12 @@ met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote - products derived from this software without specific prior + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY @@ -27,7 +27,7 @@ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING @@ -54,7 +54,7 @@ THE POSSIBILITY OF SUCH DAMAGE. #define int32 long /* a data type that has 32 bits */ #endif /* IRIX */ -#ifdef MSW +#ifdef _WIN32 /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1 #define LOWOFFSET 0 @@ -70,17 +70,17 @@ THE POSSIBILITY OF SUCH DAMAGE. #endif #if defined(__unix__) || defined(__APPLE__) -#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) -#error No byte order defined -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN -#define HIOFFSET 1 -#define LOWOFFSET 0 -#else -#define HIOFFSET 0 /* word offset to find MSB */ -#define LOWOFFSET 1 /* word offset to find LSB */ -#endif /* __BYTE_ORDER */ +#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) +#error No byte order defined +#endif + +#if BYTE_ORDER == LITTLE_ENDIAN +#define HIOFFSET 1 +#define LOWOFFSET 0 +#else +#define HIOFFSET 0 /* word offset to find MSB */ +#define LOWOFFSET 1 /* word offset to find LSB */ +#endif /* __BYTE_ORDER */ #include <sys/types.h> #define int32 int32_t #endif /* __unix__ or __APPLE__*/ @@ -153,7 +153,7 @@ static t_int *tabosc4c_tilde_perform(t_int *w) d = addr[3].w_float; // cminusb = c-b; // *out++ = b + frac * ( -// cminusb - 0.1666667f * (1.-frac) * ( +// cminusb - 0.1666667f * (1.-frac) * ( // (d - a - 3.0f * cminusb) * frac + (d + 2.0f*a - 3.0f*b) ) ); // CH // a0 = d - c - a + b; diff --git a/nusmuk-audio/tabosci~.c b/nusmuk-audio/tabosci~.c index 9936c77..a17d289 100644 --- a/nusmuk-audio/tabosci~.c +++ b/nusmuk-audio/tabosci~.c @@ -3,7 +3,7 @@ // can replace tabosc4~ // most of this code comes from pd. but with somes modifications -/* +/* This software is copyrighted by Miller Puckette and others. The following terms (the "Standard Improved BSD License") apply to all files associated with the software unless explicitly disclaimed in individual files: @@ -14,12 +14,12 @@ met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote - products derived from this software without specific prior + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY @@ -28,7 +28,7 @@ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING @@ -42,8 +42,8 @@ THE POSSIBILITY OF SUCH DAMAGE. #include "m_pd.h" #include <math.h> -#define max(a,b) ( ((a) > (b)) ? (a) : (b) ) -#define min(a,b) ( ((a) < (b)) ? (a) : (b) ) +#define max(a,b) ( ((a) > (b)) ? (a) : (b) ) +#define min(a,b) ( ((a) < (b)) ? (a) : (b) ) /******************** tabosci~ ***********************/ @@ -59,7 +59,7 @@ THE POSSIBILITY OF SUCH DAMAGE. #define int32 long /* a data type that has 32 bits */ #endif /* IRIX */ -#ifdef MSW +#ifdef _WIN32 /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1 #define LOWOFFSET 0 @@ -75,17 +75,17 @@ THE POSSIBILITY OF SUCH DAMAGE. #endif #if defined(__unix__) || defined(__APPLE__) -#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) -#error No byte order defined -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN -#define HIOFFSET 1 -#define LOWOFFSET 0 -#else -#define HIOFFSET 0 /* word offset to find MSB */ -#define LOWOFFSET 1 /* word offset to find LSB */ -#endif /* __BYTE_ORDER */ +#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) +#error No byte order defined +#endif + +#if BYTE_ORDER == LITTLE_ENDIAN +#define HIOFFSET 1 +#define LOWOFFSET 0 +#else +#define HIOFFSET 0 /* word offset to find MSB */ +#define LOWOFFSET 1 /* word offset to find LSB */ +#endif /* __BYTE_ORDER */ #include <sys/types.h> #define int32 int32_t #endif /* __unix__ or __APPLE__*/ @@ -109,7 +109,7 @@ typedef struct _tabosci_tilde double x_phase; t_float x_conv; t_sample x_prev_in, x_last_in, x_prev_out, x_last_out; - t_float x_fa1, x_fa2, x_fb1, x_fb2, x_fb3; + t_float x_fa1, x_fa2, x_fb1, x_fb2, x_fb3; t_float cutoff; t_int upsample; t_float x_sr; @@ -150,7 +150,7 @@ void tabosci_tilde_cutoff(t_tabosci_tilde *x, t_float cut) x->x_fb3 = (1-tmp2 ) /2; x->x_fa1 = -2 * tmp2; x->x_fa2 = 1 - tmp1; - + tmp1 +=1; x->x_fb1 /= tmp1; @@ -201,7 +201,7 @@ static t_int *tabosci_tilde_perform(t_int *w) while (n--) { - t_sample frac, a, b, c, d, cminusb, temp, filter_out; + t_sample frac, a, b, c, d, cminusb, temp, filter_out; for (i=0;i<x->upsample;i++) { @@ -225,8 +225,8 @@ static t_int *tabosci_tilde_perform(t_int *w) temp = ((a3 * frac + a2) * frac + a1) * frac + b; - filter_out = x->x_fb1* temp + x->x_fb2 * x->x_last_in + x->x_fb3 * x->x_prev_in - x->x_fa1 * x->x_last_out - x->x_fa2 * x->x_prev_out; - // low pass + filter_out = x->x_fb1* temp + x->x_fb2 * x->x_last_in + x->x_fb3 * x->x_prev_in - x->x_fa1 * x->x_last_out - x->x_fa2 * x->x_prev_out; + // low pass x->x_prev_in = x->x_last_in; x->x_last_in = temp; |