From 596b6228f2cdc6022fc961fba17ca9c46000a558 Mon Sep 17 00:00:00 2001 From: Antoine Villeret Date: Fri, 6 Sep 2013 17:14:33 +0000 Subject: fix mingw build svn path=/trunk/externals/nusmuk/; revision=17203 --- nusmuk-audio/tabosci~.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'nusmuk-audio/tabosci~.c') 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 -#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 #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;iupsample;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; -- cgit v1.2.1