diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-01-18 16:43:02 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-01-18 16:43:02 +0000 |
commit | 0a700207f56f18a7bd95f9e2928cd08ee3d8e50a (patch) | |
tree | 5f9c829f7611dc24ffe656c21aa794889dba78d8 /externals/extra/loop~ | |
parent | dc452a6766a4127a3b20fef44f3b1de5fe5a660a (diff) |
copied update from 0.43.0test4
svn path=/trunk/; revision=14751
Diffstat (limited to 'externals/extra/loop~')
-rw-r--r-- | externals/extra/loop~/loop~-help.pd | 22 | ||||
-rw-r--r-- | externals/extra/loop~/loop~.c | 26 |
2 files changed, 26 insertions, 22 deletions
diff --git a/externals/extra/loop~/loop~-help.pd b/externals/extra/loop~/loop~-help.pd index a445b805..ff3d3a63 100644 --- a/externals/extra/loop~/loop~-help.pd +++ b/externals/extra/loop~/loop~-help.pd @@ -1,4 +1,4 @@ -#N canvas 33 0 647 662 12; +#N canvas 234 90 647 662 12; #X floatatom 41 204 0 0 0 0 - - -; #X obj 254 382 print~; #X msg 254 347 bang; @@ -7,7 +7,7 @@ #X msg 55 252 bang; #X obj 183 382 print~; #X msg 183 347 bang; -#N canvas 0 0 450 300 graph1 0; +#N canvas 0 0 450 300 (subpatch) 0; #X array array2 150000 float 0; #X coords 0 1 150000 -1 200 150 1; #X restore 393 464 graph; @@ -22,7 +22,6 @@ #X floatatom 96 303 0 0 0 0 - - -; #X obj 96 326 *~ 1000; #X msg 43 568 read ../doc/sound/bell.aiff array2; -#X msg 43 591 read ../doc/sound/vocal.aiff array2; #X msg 47 229 set 0.5; #X text 95 196 left signal input is transposition (1 is normal \, 2 is up an octave \, etc); @@ -46,6 +45,7 @@ that changing window size doesn't change the transposition.; to zero--you should mute the output before doing so. This may be desirable if you've set a large window size but then want to decrease it without waiting for the next phase crossing.; +#X msg 43 591 read ../doc/sound/voice.wav array2; #X connect 0 0 3 0; #X connect 2 0 1 0; #X connect 3 0 6 0; @@ -56,7 +56,7 @@ waiting for the next phase crossing.; #X connect 4 0 3 1; #X connect 5 0 3 0; #X connect 7 0 6 0; -#X connect 11 0 28 0; +#X connect 11 0 27 0; #X connect 12 0 16 0; #X connect 14 0 13 0; #X connect 14 0 13 1; @@ -65,10 +65,10 @@ waiting for the next phase crossing.; #X connect 17 0 18 0; #X connect 18 0 15 0; #X connect 19 0 10 0; -#X connect 20 0 10 0; -#X connect 21 0 3 0; -#X connect 28 0 14 0; -#X connect 29 0 31 0; -#X connect 30 0 28 1; -#X connect 31 0 32 0; -#X connect 32 0 30 0; +#X connect 20 0 3 0; +#X connect 27 0 14 0; +#X connect 28 0 30 0; +#X connect 29 0 27 1; +#X connect 30 0 31 0; +#X connect 31 0 29 0; +#X connect 36 0 10 0; diff --git a/externals/extra/loop~/loop~.c b/externals/extra/loop~/loop~.c index 2f440030..2fc3193e 100644 --- a/externals/extra/loop~/loop~.c +++ b/externals/extra/loop~/loop~.c @@ -13,20 +13,24 @@ This file is downloadable from http://www.crca.ucsd.edu/~msp . #ifdef PD #include "m_pd.h" +#else +#define t_sample float #endif + + typedef struct _loopctl { double l_phase; - float l_invwindow; - float l_window; + t_sample l_invwindow; + t_sample l_window; int l_resync; } t_loopctl; -static void loopctl_run(t_loopctl *x, float *transposein, - float *windowin, float *rawout, float *windowout, int n) +static void loopctl_run(t_loopctl *x, t_sample *transposein, + t_sample *windowin, t_sample *rawout, t_sample *windowout, int n) { - float window, invwindow; + t_sample window, invwindow; double phase = x->l_phase; if (x->l_resync) { @@ -55,7 +59,7 @@ static void loopctl_run(t_loopctl *x, float *transposein, { double phaseinc = invwindow * *transposein++; double newphase; - float nwind = *windowin++; + t_sample nwind = *windowin++; if (phaseinc >= 1 || phaseinc < 0) phaseinc = 0; newphase = phase + phaseinc; @@ -77,7 +81,7 @@ static void loopctl_run(t_loopctl *x, float *transposein, newphase -= 1.; } phase = newphase; - *rawout++ = (float)phase; + *rawout++ = (t_sample)phase; *windowout++ = window; } x->l_invwindow = invwindow; @@ -124,10 +128,10 @@ static void *loop_new(void) static t_int *loop_perform(t_int *w) { t_loopctl *ctl = (t_loopctl *)(w[1]); - t_float *in1 = (t_float *)(w[2]); - t_float *in2 = (t_float *)(w[3]); - t_float *out1 = (t_float *)(w[4]); - t_float *out2 = (t_float *)(w[5]); + t_sample *in1 = (t_sample *)(w[2]); + t_sample *in2 = (t_sample *)(w[3]); + t_sample *out1 = (t_sample *)(w[4]); + t_sample *out2 = (t_sample *)(w[5]); int n = (int)(w[6]); loopctl_run(ctl, in1, in2, out1, out2, n); return (w+7); |