diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-10-09 16:36:37 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-10-09 16:36:37 +0000 |
commit | 21c068f1916330e90f814bed461fe0821d1665ec (patch) | |
tree | 949b73696fff09a44b8d3eb01b70bae7174cbd14 /pd/extra/loop~ | |
parent | bf8ced1efe1a032342e864edc635fa4e2676670d (diff) |
checked in pd-0.43-0.src.tar.gz
svn path=/trunk/; revision=15557
Diffstat (limited to 'pd/extra/loop~')
-rw-r--r-- | pd/extra/loop~/GNUmakefile.am | 28 | ||||
-rw-r--r-- | pd/extra/loop~/loop~-help.pd | 22 | ||||
-rw-r--r-- | pd/extra/loop~/loop~.c | 26 | ||||
-rw-r--r-- | pd/extra/loop~/makefile | 2 |
4 files changed, 55 insertions, 23 deletions
diff --git a/pd/extra/loop~/GNUmakefile.am b/pd/extra/loop~/GNUmakefile.am new file mode 100644 index 00000000..fce3b2fc --- /dev/null +++ b/pd/extra/loop~/GNUmakefile.am @@ -0,0 +1,28 @@ +## Makefile.am -- Process this file with automake to produce Makefile.in + +NAME=loop~ + +external_LTLIBRARIES = loop~.la +SOURCES = loop~.c +PATCHES = loop~-help.pd test-loop~.pd +OTHERDATA = + +############################### +# you shouldn't need to add anything below here +dist_external_DATA = $(PATCHES) $(OTHERDATA) + +AUTOMAKE_OPTIONS = foreign +AM_CPPFLAGS = -I$(top_srcdir)/src -DPD +AM_CFLAGS = @ARCH_CFLAGS@ +AM_LIBS = $(LIBM) +AM_LDFLAGS = -module -avoid-version -shared @ARCH_LDFLAGS@ -shrext .@EXTERNAL_EXTENSION@ -L$(top_srcdir)/src + +externaldir = $(pkglibdir)/extra/$(NAME) + + +if MINGW +AM_LIBS += -lpd +endif + +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck diff --git a/pd/extra/loop~/loop~-help.pd b/pd/extra/loop~/loop~-help.pd index a445b805..ff3d3a63 100644 --- a/pd/extra/loop~/loop~-help.pd +++ b/pd/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/pd/extra/loop~/loop~.c b/pd/extra/loop~/loop~.c index 2f440030..2fc3193e 100644 --- a/pd/extra/loop~/loop~.c +++ b/pd/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); diff --git a/pd/extra/loop~/makefile b/pd/extra/loop~/makefile index fd21f2b4..dc367b20 100644 --- a/pd/extra/loop~/makefile +++ b/pd/extra/loop~/makefile @@ -1,4 +1,4 @@ NAME=loop~ CSYM=loop_tilde -include ../makefile +include ../makefile.subdir |