diff options
Diffstat (limited to 'pd/extra')
-rw-r--r-- | pd/extra/README.txt | 37 | ||||
-rw-r--r-- | pd/extra/choice/README.txt | 12 | ||||
-rw-r--r-- | pd/extra/choice/choice.c | 128 | ||||
-rw-r--r-- | pd/extra/choice/makefile | 94 | ||||
-rw-r--r-- | pd/extra/complex-mod~.pd | 30 | ||||
-rw-r--r-- | pd/extra/help-bonk~.pd | 162 | ||||
-rw-r--r-- | pd/extra/help-choice.pd | 41 | ||||
-rw-r--r-- | pd/extra/help-complex-mod~.pd | 26 | ||||
-rw-r--r-- | pd/extra/help-fiddle~.pd | 107 | ||||
-rw-r--r-- | pd/extra/help-hilbert~.pd | 18 | ||||
-rw-r--r-- | pd/extra/help-loop~.pd | 66 | ||||
-rw-r--r-- | pd/extra/help-paf~.pd | 165 | ||||
-rw-r--r-- | pd/extra/help-pique.pd | 33 | ||||
-rw-r--r-- | pd/extra/help-rev1.pd | 119 | ||||
-rw-r--r-- | pd/extra/help-rlshift~.pd | 29 | ||||
-rw-r--r-- | pd/extra/hilbert~.pd | 15 | ||||
-rw-r--r-- | pd/extra/pique/makefile | 94 | ||||
-rw-r--r-- | pd/extra/pique/pique.c | 238 | ||||
-rw-r--r-- | pd/extra/rev1-final.pd | 106 | ||||
-rw-r--r-- | pd/extra/rev1-stage.pd | 99 | ||||
-rw-r--r-- | pd/extra/rev1~.pd | 64 |
21 files changed, 1683 insertions, 0 deletions
diff --git a/pd/extra/README.txt b/pd/extra/README.txt new file mode 100644 index 00000000..2ff84f68 --- /dev/null +++ b/pd/extra/README.txt @@ -0,0 +1,37 @@ +This is the README file for the "extras" library, consisting of Pd +objects which are too specialized or otherwise non-canonical for +inclusion into Pd proper. Except as noted otherwise, all +included materiels are Copyright 1999 Miller Puckette and others. +Permission is granted to use this software for any purpose, commercial +or noncommercial, as long as this notice is included with all copies. + +NEITHER THE AUTHORS NOR THEIR EMPLOYERS MAKE ANY WARRANTY, EXPRESS +OR IMPLIED, IN CONNECTION WITH THIS SOFTWARE! + +Note that "expr" is under the GPL, which is more restrictive than Pd's own +license agreement. + +This package should run under linux, NT, or IRIX, except for +"bilge" which is for NT only. You can additionally compile fiddle~. bonk~, +and paf~ for Max/MSP. + +contents: + +externs: +fiddle~ -- pitch tracker +bonk~ - percussion detector +choose - find the "best fit" of incoming vector with stored profiles +paf~ -- phase aligned formant generator +loop~ -- sample looper +expr -- arithmetic expression evaluation (Shahrokh Yadegari) +bilge (NT only) - play audio CDs through the regular PC sound system + +abstractions: +hilbert~ - Hilbert transform for SSB modulation +complex-mod~ - ring modulation for complex (real+imaginary) audio signals +rev1~ - reverberator + +These objects are part of the regular Pd distribution as of Pd version +0.30. Macintosh versions of fiddle~, bonk~, and paf~ are available +from http://www.crca.ucsd.edu/~tapel +- msp@ucsd.edu diff --git a/pd/extra/choice/README.txt b/pd/extra/choice/README.txt new file mode 100644 index 00000000..3c3ed132 --- /dev/null +++ b/pd/extra/choice/README.txt @@ -0,0 +1,12 @@ +Choice is copyright (C) 1999 Miller Puckette. +Permission is granted to use this software for any purpose, commercial +or noncommercial, as long as this notice is included with all copies. + +NEITHER THE AUTHORS NOR THEIR EMPLOYERS MAKE ANY WARRANTY, EXPRESS OR IMPLIED, +IN CONNECTION WITH THIS SOFTWARE! + +---------------------------------------------------------------------------- + +This is the README file for the "choice" object. This software +is available from http://www.crca.ucsd.edu/~msp as part of the "toys" +library. - msp@ucsd.edu diff --git a/pd/extra/choice/choice.c b/pd/extra/choice/choice.c new file mode 100644 index 00000000..002dac40 --- /dev/null +++ b/pd/extra/choice/choice.c @@ -0,0 +1,128 @@ +/* choice -- match incoming list against a collection of stored templates. */ + +/* Copyright 1999 Miller Puckette. +Permission is granted to use this software for any purpose provided you +keep this copyright notice intact. + +THE AUTHOR AND HIS EMPLOYERS MAKE NO WARRANTY, EXPRESS OR IMPLIED, +IN CONNECTION WITH THIS SOFTWARE. + +This file is downloadable from http://www.crca.ucsd.edu/~msp . +*/ + +#include "m_pd.h" +#include <math.h> +static t_class *choice_class; +#define DIMENSION 10 + +typedef struct _elem +{ + float e_age; + float e_weight[DIMENSION]; +} t_elem; + +typedef struct _choice +{ + t_object x_obj; + t_elem *x_vec; + int x_n; + int x_nonrepeat; +} t_choice; + +static void *choice_new(t_float fnonrepeat) +{ + t_choice *x = (t_choice *)pd_new(choice_class); + outlet_new(&x->x_obj, gensym("float")); + x->x_vec = (t_elem *)getbytes(0); + x->x_n = 0; + x->x_nonrepeat = (fnonrepeat != 0); + return (x); +} + +static void choice_clear(t_choice *x) +{ + x->x_vec = (t_elem *)resizebytes(x->x_vec, x->x_n * sizeof(t_elem), 0); + x->x_n = 0; +} + +static void choice_print(t_choice *x) +{ + int j; + for (j = 0; j < x->x_n; j++) + { + t_elem *e = x->x_vec + j; + t_float *w = e->e_weight; + post("%2d age %2d \ +w %5.2f %5.2f %5.2f %5.2f %5.2f %5.2f %5.2f %5.2f %5.2f %5.2f", + j, (int)(e->e_age), w[0], w[1], w[2], w[3], w[4], w[5], + w[6], w[7], w[8], w[9]); + } +} + +static void choice_add(t_choice *x, t_symbol *s, int argc, t_atom *argv) +{ + int oldn = x->x_n, newn = oldn + 1, i; + t_elem *e; + float sum, normal; + x->x_vec = (t_elem *)resizebytes(x->x_vec, oldn * sizeof(t_elem), + newn * sizeof(t_elem)); + x->x_n = newn; + e = x->x_vec + oldn; + e->e_age = 2; + + for (i = 0, sum = 0; i < DIMENSION; i++) + { + float f = atom_getfloatarg(i, argc, argv); + e->e_weight[i] = f; + sum += f*f; + } + normal = (float)(sum > 0 ? 1./sqrt(sum) : 1); + for (i = 0; i < DIMENSION; i++) + e->e_weight[i] *= normal; +} + +static void choice_list(t_choice *x, t_symbol *s, int argc, t_atom *argv) +{ + int i, j; + float bestsum = 0; + int bestindex = -1; + t_float invec[DIMENSION]; + for (i = 0; i < DIMENSION; i++) + invec[i] = atom_getfloatarg(i, argc, argv); + for (j = 0; j < x->x_n; j++) + { + t_elem *e = x->x_vec + j; + float sum; + for (i = 0, sum = 0; i < DIMENSION; i++) + sum += e->e_weight[i] * invec[i]; + if (x->x_nonrepeat) sum *= (float)(log(e->e_age)); + if (sum > bestsum) + { + bestsum = sum; + sum = 1; + bestindex = j; + } + } + if (bestindex >= 0) + { + for (j = 0; j < x->x_n; j++) + x->x_vec[j].e_age += 1.; + x->x_vec[bestindex].e_age = 1; + } + outlet_float(x->x_obj.ob_outlet, (float)bestindex); +} + +static void choice_free(t_choice *x) +{ + freebytes(x->x_vec, x->x_n * sizeof(t_elem)); +} + +void choice_setup(void) +{ + choice_class = class_new(gensym("choice"), (t_newmethod)choice_new, + (t_method)choice_free, sizeof(t_choice), 0, A_DEFFLOAT, 0); + class_addmethod(choice_class, (t_method)choice_add, gensym("add"), A_GIMME, 0); + class_addmethod(choice_class, (t_method)choice_clear, gensym("clear"), 0); + class_addmethod(choice_class, (t_method)choice_print, gensym("print"), 0); + class_addlist(choice_class, choice_list); +} diff --git a/pd/extra/choice/makefile b/pd/extra/choice/makefile new file mode 100644 index 00000000..61866ffc --- /dev/null +++ b/pd/extra/choice/makefile @@ -0,0 +1,94 @@ +NAME=choice +CSYM=choice + +current: pd_linux + +# ----------------------- NT ----------------------- + +pd_nt: $(NAME).dll + +.SUFFIXES: .dll + +PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo +VC="C:\Program Files\Microsoft Visual Studio\Vc98" + +PDNTINCLUDE = /I. /I\tcl\include /I\ftp\pd\src /I$(VC)\include + +PDNTLDIR = $(VC)\lib +PDNTLIB = $(PDNTLDIR)\libc.lib \ + $(PDNTLDIR)\oldnames.lib \ + $(PDNTLDIR)\kernel32.lib \ + \ftp\pd\bin\pd.lib + +.c.dll: + cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c + link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB) + +# ----------------------- IRIX 5.x ----------------------- + +pd_irix5: $(NAME).pd_irix5 + +.SUFFIXES: .pd_irix5 + +SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2 + +SGIINCLUDE = -I../../src + +.c.pd_irix5: + cc $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c + ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o + rm $*.o + +# ----------------------- IRIX 6.x ----------------------- + +pd_irix6: $(NAME).pd_irix6 + +.SUFFIXES: .pd_irix6 + +SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \ + -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \ + -Ofast=ip32 + +.c.pd_irix6: + cc $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c + ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o + rm $*.o + +# ----------------------- LINUX i386 ----------------------- + +pd_linux: $(NAME).pd_linux + +.SUFFIXES: .pd_linux + +LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \ + -Wall -W -Wshadow -Wstrict-prototypes -Werror \ + -Wno-unused -Wno-parentheses -Wno-switch + +LINUXINCLUDE = -I../../src + +.c.pd_linux: + cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c + ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm + strip --strip-unneeded $*.pd_linux + rm -f $*.o ../$*.pd_linux + ln -s $*/$*.pd_linux .. + +# ----------------------- Mac OSX ----------------------- + +pd_darwin: $(NAME).pd_darwin + +.SUFFIXES: .pd_darwin + +DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \ + -Wno-unused -Wno-parentheses -Wno-switch + +.c.pd_darwin: + cc $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c + cc -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o + rm -f $*.o ../$*.pd_darwin + ln -s $*/$*.pd_darwin .. + +# ---------------------------------------------------------- + +clean: + rm -f *.o *.pd_* so_locations diff --git a/pd/extra/complex-mod~.pd b/pd/extra/complex-mod~.pd new file mode 100644 index 00000000..14f9b955 --- /dev/null +++ b/pd/extra/complex-mod~.pd @@ -0,0 +1,30 @@ +#N canvas 206 108 428 341 12; +#X obj 142 87 inlet~; +#X obj 315 88 inlet; +#X obj 315 166 cos~; +#X obj 351 144 +~ -0.25; +#X obj 351 166 cos~; +#X obj 225 87 inlet~; +#X obj 142 215 *~; +#X obj 225 216 *~; +#X obj 142 251 -~; +#X obj 142 284 outlet~; +#X obj 212 285 outlet~; +#X obj 212 252 +~; +#X text 140 310 positive; +#X text 213 311 negative; +#X obj 315 114 phasor~; +#X connect 0 0 6 0; +#X connect 1 0 14 0; +#X connect 2 0 6 1; +#X connect 3 0 4 0; +#X connect 4 0 7 1; +#X connect 5 0 7 0; +#X connect 6 0 8 0; +#X connect 6 0 11 0; +#X connect 7 0 8 1; +#X connect 7 0 11 1; +#X connect 8 0 9 0; +#X connect 11 0 10 0; +#X connect 14 0 3 0; +#X connect 14 0 2 0; diff --git a/pd/extra/help-bonk~.pd b/pd/extra/help-bonk~.pd new file mode 100644 index 00000000..5102e860 --- /dev/null +++ b/pd/extra/help-bonk~.pd @@ -0,0 +1,162 @@ +#N canvas 107 94 958 626 10; +#X obj 320 579 print; +#X floatatom 314 501 0 0 0; +#X obj 320 549 spigot; +#X msg 314 471 0; +#X msg 351 471 1; +#X msg 442 427 bang; +#X obj 429 518 bonk~; +#X msg 442 244 learn 1; +#X msg 442 304 learn 0; +#X msg 437 486 print; +#X obj 390 467 adc~; +#X text 320 597 cooked; +#X msg 565 76 \; pd dsp 1; +#X obj 257 579 print; +#X floatatom 251 501 0 0 0; +#X obj 257 549 spigot; +#X msg 251 471 0; +#X msg 282 471 1; +#X text 257 597 raw; +#N canvas 366 126 600 400 synth 0; +#X obj 112 24 r bonk-cooked; +#X obj 112 49 unpack; +#X obj 112 99 * 12; +#X obj 112 124 div 7; +#X obj 112 74 + 1; +#X obj 112 174 mtof; +#X obj 112 224 osc~; +#X obj 112 249 cos~; +#X obj 112 149 + 47; +#X obj 209 247 line~; +#X obj 209 272 *~; +#X obj 209 297 lop~ 500; +#X obj 112 274 *~; +#X obj 103 361 dac~; +#X obj 253 165 dbtorms; +#X obj 253 115 * 0.5; +#X obj 253 140 + 50; +#X obj 211 189 f; +#X msg 173 159 bang; +#X obj 258 83 inlet; +#X obj 111 307 hip~ 5; +#X msg 34 24 0 60; +#X obj 112 199 sig~; +#X msg 209 222 \$1 \, 0 200; +#X connect 0 0 1 0; +#X connect 1 0 4 0; +#X connect 2 0 3 0; +#X connect 3 0 8 0; +#X connect 4 0 2 0; +#X connect 5 0 18 0; +#X connect 5 0 22 0; +#X connect 6 0 7 0; +#X connect 7 0 12 0; +#X connect 8 0 5 0; +#X connect 9 0 10 0; +#X connect 9 0 10 1; +#X connect 10 0 11 0; +#X connect 11 0 12 1; +#X connect 12 0 20 0; +#X connect 14 0 17 1; +#X connect 15 0 16 0; +#X connect 16 0 14 0; +#X connect 17 0 23 0; +#X connect 18 0 17 0; +#X connect 19 0 15 0; +#X connect 20 0 13 1; +#X connect 20 0 13 0; +#X connect 21 0 1 0; +#X connect 22 0 6 0; +#X connect 23 0 9 0; +#X restore 804 86 pd synth; +#X obj 454 549 s bonk-cooked; +#X floatatom 804 63 0 0 0; +#X msg 804 33 0; +#X msg 442 274 learn 10; +#X msg 442 334 forget; +#X msg 442 364 write templates.txt; +#X msg 442 394 read templates.txt; +#X msg 835 33 90; +#X msg 442 120 thresh 6 50; +#X text 8 70 The Bonk object takes an audio signal input and looks +for "attacks" defined as sharp changes in the spectral envelope of +the incoming sound. Optionally \, and less reliably \, you can have +Bonk check the attack against a collection of stored templates to try +to guess which of two or more instruments was hit. Bonk is described +theoretically in the 1998 ICMC proceedings \, reprinted on http://man104nfs.ucsd.edu/~mpuckett. +; +#X text 470 70 click here; +#X text 471 83 to start DSP; +#X text 8 191 Bonk's two outputs are the raw spectrum of the attack +(provided as a list of 11 numbers giving the signal "loudness" in the +11 frequency bands used) \, and the "cooked" output which gives only +an instrument number (counting up from zero) and a "velocity". The +instrumnent number is significant only if Bonk has a "template set" +in memory.; +#X text 8 368 In this patch \, after starting DSP \, you can print +out the raw or cooked output using the two "spigots" or listen to a +synthesizer output by raising its volume.; +#X text 259 448 enable printout; +#X text 705 32 output volume; +#X text 719 50 (0-100); +#X text 533 118 Set low and high thresholds. Signal growth must exceed +the high one and then fall to the low one to make an attack.; +#X text 533 151 Minimum velocity to output (quieter notes are ignored.) +; +#X msg 442 180 mask 4 0.7; +#X msg 442 214 debounce 0; +#X text 8 299 Bonk's analysis is carried out on a 256-point window +(6 msec at 44.1 kHz) and by default the analysis period is 128 samples. +The analysis period can be specified as Bonk's creation argument but +must be a multiple of 64; +#X text 532 219 Minimum time (msec) between attacks; +#X text 532 170 Describes how energy in each frequency band masks later +energy in the band. Here the masking is total for 4 analysis periods +and then drops by 0.7 each period.; +#X text 530 244 Forget all templates and start learning new ones. The +argument gives the number of times you will hit each instrument (10 +recommended.) Turn on the output volume above for audible feedback +as you train Bonk. "Learn 0" exits learn mode.; +#X text 530 328 Forget the last template. In Learn mode \, use "forget" +to erase and record over a template.; +#X text 595 368 Write templates to a file in text-editable format. +; +#X text 596 398 Read templates from a file.; +#X text 538 493 Print out all settings and templates.; +#X msg 442 150 minvel 10; +#X text 538 426 Poll the current spectrum via "raw" outlet \, You can +set a very high threshold if you don't want attacks mixed in.; +#X text 218 12 BONK - an attack detector for small percussion instruments +; +#X msg 634 517 print; +#X msg 437 456 debug 0; +#X text 538 466 turn debugging on or off.; +#X connect 1 0 2 1; +#X connect 2 0 0 0; +#X connect 3 0 1 0; +#X connect 4 0 1 0; +#X connect 5 0 6 0; +#X connect 6 0 15 0; +#X connect 6 1 2 0; +#X connect 6 1 20 0; +#X connect 7 0 6 0; +#X connect 8 0 6 0; +#X connect 9 0 6 0; +#X connect 10 0 6 0; +#X connect 14 0 15 1; +#X connect 15 0 13 0; +#X connect 16 0 14 0; +#X connect 17 0 14 0; +#X connect 21 0 19 0; +#X connect 22 0 21 0; +#X connect 23 0 6 0; +#X connect 24 0 6 0; +#X connect 25 0 6 0; +#X connect 26 0 6 0; +#X connect 27 0 21 0; +#X connect 28 0 6 0; +#X connect 39 0 6 0; +#X connect 40 0 6 0; +#X connect 49 0 6 0; +#X connect 53 0 6 0; diff --git a/pd/extra/help-choice.pd b/pd/extra/help-choice.pd new file mode 100644 index 00000000..df46ddc0 --- /dev/null +++ b/pd/extra/help-choice.pd @@ -0,0 +1,41 @@ +#N canvas 16 5 488 531 12; +#X obj 8 186 choice; +#X msg 41 86 print; +#X msg 29 63 clear; +#X msg 8 34 add 1 0 0 \, add 0 1 0 \, add 0 0 1 \, add 1 1 1 \, add 1 1 0; +#X obj 77 162 pack 0 0 0; +#X floatatom 182 120; +#X floatatom 148 120; +#X floatatom 115 120; +#X obj 77 142 f; +#X msg 77 120 bang; +#X floatatom 8 207; +#X obj 53 187 choice 1; +#X floatatom 53 208; +#X obj 76 4 choice; +#X text 122 5 - search for a best match to an incoming list; +#X text 19 234 The choice object holds a list of vectors \, each having up to ten elements. When sent a list of numbers \, it outputs the index of the known vector that matches most closely. The quality of the match is the dot product of the two vectors after normalizing them \, i.e. \, the vector whose direction is closest to that of the input wins.; +#X text 19 316 If given a nonzero creation argument \, choice tries to avoid repetitious outputs by weighting less recently output vectors preferentially.; +#X text 18 354 You can use this to choose interactively between a number of behaviors depending on their attributes. For example \, you might have stored a number of melodies \, of which some are syncopated \, some chromatic \, some are more than 100 years old \, some are bugle calls \, and some are Christmas carols. You could then ask to find a syncopated bugle call (1 \, 0 \, 0 \, 1 \, 0) and you'll get the thing most closely matching the request.; +#X text 17 461 You can use numbers other than 0 and 1 to indicate relative strengths of the attributes \, or even use negative numbers to indicate opposites \, either in the incoming lists or in the stored ones.; +#X text 273 513 updated for Pd version-0.30; +#X text 72 63 delete all stored vectors; +#X text 394 36 add vectors; +#X text 81 85 debugging printout; +#X text 69 104 tweak the numbers and hit "bang" to input a list; +#X text 115 187 creation argument to avoid repeated outout; +#X text 85 208 output is the index of best match \, counting from zero; +#X connect 0 0 10 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 2 0 11 0; +#X connect 3 0 0 0; +#X connect 3 0 11 0; +#X connect 4 0 0 0; +#X connect 4 0 11 0; +#X connect 5 0 4 2; +#X connect 6 0 4 1; +#X connect 7 0 8 1; +#X connect 8 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 12 0; diff --git a/pd/extra/help-complex-mod~.pd b/pd/extra/help-complex-mod~.pd new file mode 100644 index 00000000..9e14904d --- /dev/null +++ b/pd/extra/help-complex-mod~.pd @@ -0,0 +1,26 @@ +#N canvas 136 85 600 480 12; +#X graph graph1 0 -1 882 1 279 209 579 39; +#X array mod-output 882 float; +#X pop; +#X msg 84 256 bang \; pd dsp 1; +#X floatatom 67 56; +#X obj 67 186 complex-mod~; +#X obj 67 84 phasor~ 440; +#X obj 67 115 cos~; +#X obj 106 138 cos~; +#X obj 106 114 -~ 0.25; +#X floatatom 145 152; +#X text 93 351 The complex modulator takes two signals in which it considers to be the real and imaginary part of a complex-valued signal. It then does a complex multiplication by a sinusoud to shift all frequencies up or down by any frequency shift in Hz. See also hilbert~.; +#X obj 69 298 tabwrite~ mod-output; +#X text 149 204 right outlet; +#X text 151 220 gives the other; +#X text 149 236 sideband; +#X connect 1 0 10 0; +#X connect 2 0 4 0; +#X connect 3 0 10 0; +#X connect 4 0 5 0; +#X connect 4 0 7 0; +#X connect 5 0 3 0; +#X connect 6 0 3 1; +#X connect 7 0 6 0; +#X connect 8 0 3 2; diff --git a/pd/extra/help-fiddle~.pd b/pd/extra/help-fiddle~.pd new file mode 100644 index 00000000..a7feb4f7 --- /dev/null +++ b/pd/extra/help-fiddle~.pd @@ -0,0 +1,107 @@ +#N canvas 93 26 980 745 10; +#X obj 262 522 phasor~; +#X obj 531 616 unpack; +#X floatatom 531 666; +#X msg 437 449 print; +#X obj 262 500 sig~; +#X floatatom 262 478; +#X obj 262 456 mtof; +#X floatatom 262 434; +#X floatatom 545 643; +#X obj 531 576 route 1 2 3 4; +#X obj 614 616 unpack; +#X floatatom 614 666; +#X floatatom 628 643; +#X obj 698 616 unpack; +#X floatatom 698 666; +#X floatatom 712 643; +#X obj 389 616 unpack; +#X floatatom 389 666; +#X floatatom 403 643; +#X obj 334 545 *~; +#X obj 322 394 loadbang; +#X obj 353 522 sig~; +#X floatatom 353 500; +#X msg 322 478 1; +#X msg 353 478 0; +#X floatatom 466 666; +#X obj 281 666 print attack; +#X obj 190 666 print pitch; +#X msg 555 45 \; pd dsp 1; +#X text 460 39 click here; +#X text 460 61 to start DSP; +#X text 226 4 FIDDLE - pitch estimator and sinusoidal peak finder; +#X text 8 70 The Fiddle object estimates the pitch and amplitude of an incoming sound \, both continuously and as a stream of discrete "note" events. Fiddle optionally outputs a list of detected sinusoidal peaks used to make the pitch determination. Fiddle is described theoretically in the 1998 ICMC proceedings \, reprinted on http://man104nfs.ucsd.edu/~mpuckett.; +#X text 8 170 Fiddle's creation arguments specify an analysis window size \, the maximum polyphony (i.e. \, the number of simultaneous "pitches" to try to find) \, the number of peaks in the spectrum to consider \, and the number of peaks \, if any \, to output "raw." The outlets give discrete pitch (a number) \, detected attacks in the amplitude envelope (a bang) \, one or more voices of continuous pitch and amplitude \, overall amplitude \, and optionally a sequence of messages with the peaks.; +#X text 8 296 The analysis hop size is half the window size so in the example shown here \, one analysis is done every 512 samples (11.6 msec at 44K1) \, and the analysis uses the most recent 1024 samples (23.2 msec at 44K1). The minimum frequency that Fiddle will report is 2-1/2 cycles per analysis windows \, or about 108 Hz. (just below MIDI 45.); +#X text 669 535 number of pitch outlets (1-3 \, default 1); +#X text 669 557 number of peaks to find (1-100 \, default 20); +#X text 669 579 number of peaks to output (default 0.); +#X msg 441 107 amp-range 40 50; +#X msg 439 227 reattack 100 10; +#X msg 438 282 npartial 7; +#X msg 438 170 vibrato 50 0.5; +#X text 560 91 a low and high amplitude threshold: if signal amplitude is below the low threshold \, no pitches or peaks are output. The high threshold is a minimum at which "cooked" outputs may appear.; +#X text 560 152 A period in milliseconds (50) over which the raw pitch may not deviate more than an interval in half-tones (0.5) from the average pitch to report it as a note to the "cooked" pitch outlet.; +#X text 560 213 A period in milliseconds (100) over which a re-attack is reported if the amplitude rises more than (1) dB. The re-attack will result in a "bang" in the attack outlet and may give rise to repeated notes in the cooked pitch output.; +#X text 142 432 test input pitch; +#X text 330 444 test input; +#X text 330 457 amplitude; +#X obj 410 545 fiddle~ 1024 1 20 3; +#X text 538 690 individual sinusoidal components; +#X text 466 688 amplitude; +#X text 476 703 (dB); +#X text 389 688 raw pitch; +#X text 376 712 and amplitude; +#X text 364 729 (up to 3 outputs); +#X text 287 686 bang on; +#X text 287 708 attack; +#X text 185 686 cooked pitch; +#X text 202 703 output; +#X text 545 545 ------ arguments:; +#X msg 262 412 57; +#X msg 440 340 auto 1; +#X msg 440 362 auto 0; +#X msg 440 407 bang; +#X text 561 405 poll current values --- useful if not in auto mode \,; +#X text 560 274 Higher partials are weighed less strongly than lower ones in determining the pitch. This specifies the number of the partial (7) which will be weighted half as strongly as the fundamental.; +#X text 560 335 start and stop "auto" mode (on by default.) If off \, output only appears on "bang" (poll mode).; +#X text 561 448 print out all settings; +#X text 669 513 window size (128-2048 \, default 1024); +#X connect 0 0 19 0; +#X connect 1 0 2 0; +#X connect 1 1 8 0; +#X connect 3 0 48 0; +#X connect 4 0 0 0; +#X connect 5 0 4 0; +#X connect 6 0 5 0; +#X connect 7 0 6 0; +#X connect 9 0 1 0; +#X connect 9 1 10 0; +#X connect 9 2 13 0; +#X connect 10 0 11 0; +#X connect 10 1 12 0; +#X connect 13 0 14 0; +#X connect 13 1 15 0; +#X connect 16 0 17 0; +#X connect 16 1 18 0; +#X connect 19 0 48 0; +#X connect 20 0 60 0; +#X connect 20 0 23 0; +#X connect 21 0 19 1; +#X connect 22 0 21 0; +#X connect 23 0 22 0; +#X connect 24 0 22 0; +#X connect 38 0 48 0; +#X connect 39 0 48 0; +#X connect 40 0 48 0; +#X connect 41 0 48 0; +#X connect 48 0 27 0; +#X connect 48 1 26 0; +#X connect 48 2 16 0; +#X connect 48 3 25 0; +#X connect 48 4 9 0; +#X connect 60 0 7 0; +#X connect 61 0 48 0; +#X connect 62 0 48 0; +#X connect 63 0 48 0; diff --git a/pd/extra/help-hilbert~.pd b/pd/extra/help-hilbert~.pd new file mode 100644 index 00000000..130ec750 --- /dev/null +++ b/pd/extra/help-hilbert~.pd @@ -0,0 +1,18 @@ +#N canvas 156 234 600 488 12; +#X obj 67 124 hilbert~; +#X obj 66 85 osc~ 440; +#X graph graph1 0 -1 882 1 279 209 579 39; +#X array out-left 882 float; +#X array out-right 882 float; +#X pop; +#X obj 67 274 tabwrite~ out-left; +#X obj 118 248 tabwrite~ out-right; +#X msg 137 188 bang \; pd dsp 1; +#X floatatom 66 57; +#X text 71 319 The Hilbert transform (the name is abused here according to computer music tradition) puts out a phase quadrature version of the input signal suitable for signal sideband modulation via complex-mod~.; +#X connect 0 0 3 0; +#X connect 0 1 4 0; +#X connect 1 0 0 0; +#X connect 5 0 3 0; +#X connect 5 0 4 0; +#X connect 6 0 1 0; diff --git a/pd/extra/help-loop~.pd b/pd/extra/help-loop~.pd new file mode 100644 index 00000000..6acff93c --- /dev/null +++ b/pd/extra/help-loop~.pd @@ -0,0 +1,66 @@ +#N canvas 33 0 538 640 12; +#X floatatom 55 169; +#X obj 273 343 print~; +#X msg 273 305 bang; +#X obj 55 303 loop~; +#X floatatom 80 244; +#X msg 69 217 bang; +#X obj 172 350 print~; +#X msg 170 311 bang; +#X graph graph1 0 -1 150000 1 306 586 506 436; +#X array array2 150000 float; +#X pop; +#X msg 306 594 \; array2 resize 150000; +#X obj 29 578 soundfiler; +#X obj 55 419 tabread4~ array2; +#X obj 55 373 *~; +#X obj 55 488 dac~; +#X obj 55 465 hip~ 5; +#X obj 101 377 samphold~; +#X obj 55 396 +~; +#X floatatom 102 268; +#X obj 102 291 *~ 1000; +#X msg 47 533 read ../doc/sound/bell.aiff array2; +#X msg 47 556 read ../doc/sound/vocal.aiff array2; +#X msg 61 194 set 0.5; +#X text 100 164 left signal input is transposition (1 is normal \, 2 is up an octave \, etc); +#X text 37 6 loop~ - phase generator for looping samplers; +#X text 121 193 set phase (0 to 1); +#X text 121 213 reset phase to 0; +#X text 118 243 right signal input is window size in samples; +#X text 140 267 here's how to handle onsets; +#X obj 55 442 *~; +#X floatatom 171 397; +#X obj 171 466 line~; +#X obj 171 420 dbtorms; +#X obj 171 443 pack 0 50; +#X text 205 396 output level 0-100; +#X text 170 290 print outputs; +#X text 21 25 loop~ takes input signals to set a window size and transposition \, and outputs a phase and a sampled window size. The window size only changes at phase zero crossings and the phase output is adjusted so that changing window size doesn't change the transposition.; +#X text 22 95 You can send "bang" or "set" message to force the phase 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 connect 0 0 3 0; +#X connect 2 0 1 0; +#X connect 3 0 6 0; +#X connect 3 0 12 0; +#X connect 3 0 15 1; +#X connect 3 1 1 0; +#X connect 3 1 12 1; +#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 12 0 16 0; +#X connect 14 0 13 0; +#X connect 14 0 13 1; +#X connect 15 0 16 1; +#X connect 16 0 11 0; +#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; diff --git a/pd/extra/help-paf~.pd b/pd/extra/help-paf~.pd new file mode 100644 index 00000000..b36a7597 --- /dev/null +++ b/pd/extra/help-paf~.pd @@ -0,0 +1,165 @@ +#N canvas 19 4 745 493 12; +#X msg 37 311 freq \$1 100; +#X obj 37 286 mtof; +#X msg 127 311 amp \$1 100; +#X obj 127 261 r amp; +#X obj 212 262 r cf; +#X obj 212 287 mtof; +#X msg 212 312 cf \$1 100; +#X obj 37 261 r pit; +#X msg 149 426 bang; +#X obj 80 455 dac~; +#X obj 535 161 s vfr; +#X obj 535 86 r vfr; +#X obj 483 161 s vib; +#X obj 483 86 r vib; +#X msg 535 111 set \$1; +#X floatatom 535 136 0 0 0; +#X msg 483 111 set \$1; +#X floatatom 483 136 0 0 0; +#X obj 434 161 s bw; +#X obj 385 161 s cf; +#X obj 266 160 s amp; +#X obj 325 159 s pit; +#X obj 325 84 r pit; +#X msg 325 109 set \$1; +#X floatatom 325 134 0 0 0; +#X obj 266 85 r amp; +#X msg 266 110 set \$1; +#X floatatom 266 135 0 0 0; +#X msg 385 111 set \$1; +#X floatatom 385 136 0 0 0; +#X obj 385 86 r cf; +#X msg 434 111 set \$1; +#X floatatom 434 136 0 0 0; +#X obj 434 86 r bw; +#X msg 286 312 bw \$1 100; +#X obj 286 262 r bw; +#X obj 286 287 mtof; +#X obj 365 262 r vib; +#X msg 365 312 vib \$1 100; +#X msg 445 312 vfr \$1 100; +#X obj 445 287 / 8; +#X obj 445 262 r vfr; +#X obj 365 287 / 660; +#X msg 589 111 set \$1; +#X floatatom 589 136 0 0 0; +#X obj 589 86 r shift; +#X obj 589 161 s shift; +#X obj 530 262 r shift; +#X msg 530 312 shift \$1 100; +#X obj 127 286 dbtorms; +#X obj 94 400 paf~; +#X obj 30 432 s~ foo; +#X msg 627 313 phase 0 0 0; +#X obj 149 451 print~ output; +#N canvas 447 311 726 483 spectrum 0; +#X graph graph1 0 -1.02 882 1.02 405 401 605 271; +#X array pulse-output 882 float; +#X pop; +#X text 405 403 --------- 0.02 seconds ------; +#X graph graph1 0 0 128 500 391 208 647 78; +#X array spectrum 128 float; +#X pop; +#X obj 137 257 tabwrite~ pulse-output; +#X msg 106 174 bang; +#N canvas 204 17 358 238 fft 0; +#X obj 46 48 inlet~; +#X obj 159 181 tabwrite~ spectrum; +#X obj 159 145 inlet; +#X obj 46 78 rfft~; +#X obj 46 111 *~; +#X obj 77 111 *~; +#X obj 46 141 sqrt~; +#X obj 191 45 block~ 1024 1; +#X connect 0 0 3 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 3 0 4 1; +#X connect 3 1 5 0; +#X connect 3 1 5 1; +#X connect 4 0 6 0; +#X connect 5 0 6 0; +#X connect 6 0 1 0; +#X restore 46 228 pd fft; +#X text 33 8 PULSE SPECTRUM MEASUREMENT; +#X text 379 221 0; +#X text 627 218 5512; +#X obj 94 123 r~ foo; +#X obj 41 160 *~ 1; +#X floatatom 44 113 0 0 0; +#X obj 179 136 metro 1000; +#X floatatom 178 108 0 0 0; +#X obj 56 44 r graph; +#X obj 140 205 *~ 10; +#X connect 4 0 3 0; +#X connect 4 0 5 1; +#X connect 9 0 10 0; +#X connect 9 0 15 0; +#X connect 10 0 5 0; +#X connect 11 0 10 1; +#X connect 12 0 4 0; +#X connect 13 0 12 0; +#X connect 14 0 11 0; +#X connect 14 0 13 0; +#X connect 15 0 3 0; +#X restore 438 413 pd spectrum; +#X msg 42 133 \; pd dsp 1 \; pit 60 \; cf 60 \; graph 20; +#X text 48 10 The "PAF" generator \, described in a paper in JAES 43/1 pp. 40-47 \, reprinted on Miller Puckette's web page. Often used in Philippe Manoury's music. The important controls are center frequency ("cf") and bandwidth ("bw") here controlled as MIDI values.; +#X text 37 88 clich here to test; +#X text 34 106 (then set amplitude); +#X text 423 390 click here to see spectrum; +#X msg 343 383 bw 0; +#X msg 367 418 bw 0; +#X msg 295 418 bw 80 100; +#X msg 295 384 bw 700; +#X connect 0 0 50 0; +#X connect 1 0 0 0; +#X connect 2 0 50 0; +#X connect 3 0 49 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 6 0 50 0; +#X connect 7 0 1 0; +#X connect 8 0 53 0; +#X connect 11 0 14 0; +#X connect 13 0 16 0; +#X connect 14 0 15 0; +#X connect 15 0 10 0; +#X connect 16 0 17 0; +#X connect 17 0 12 0; +#X connect 22 0 23 0; +#X connect 23 0 24 0; +#X connect 24 0 21 0; +#X connect 25 0 26 0; +#X connect 26 0 27 0; +#X connect 27 0 20 0; +#X connect 28 0 29 0; +#X connect 29 0 19 0; +#X connect 30 0 28 0; +#X connect 31 0 32 0; +#X connect 32 0 18 0; +#X connect 33 0 31 0; +#X connect 34 0 50 0; +#X connect 35 0 36 0; +#X connect 36 0 34 0; +#X connect 37 0 42 0; +#X connect 38 0 50 0; +#X connect 39 0 50 0; +#X connect 40 0 39 0; +#X connect 41 0 40 0; +#X connect 42 0 38 0; +#X connect 43 0 44 0; +#X connect 44 0 46 0; +#X connect 45 0 43 0; +#X connect 47 0 48 0; +#X connect 48 0 50 0; +#X connect 49 0 2 0; +#X connect 50 0 9 0; +#X connect 50 0 51 0; +#X connect 50 0 9 1; +#X connect 50 0 53 0; +#X connect 52 0 50 0; +#X connect 60 0 50 0; +#X connect 62 0 50 0; +#X connect 63 0 50 0; diff --git a/pd/extra/help-pique.pd b/pd/extra/help-pique.pd new file mode 100644 index 00000000..1689c95b --- /dev/null +++ b/pd/extra/help-pique.pd @@ -0,0 +1,33 @@ +#N canvas 143 0 729 407 12; +#X obj 47 11 pique; +#X text 105 12 -- find peaks in an FFT spectrum; +#X obj 214 174 rfft~; +#X obj 131 129 osc~ 2000; +#X graph graph2 0 -64 63 64 519 179 719 39; +#X array fft-real 64 float; +#X pop; +#X graph graph3 0 -64 63 64 519 327 719 187; +#X array fft-imag 64 float; +#X pop; +#X obj 214 215 tabwrite~ fft-real; +#X obj 245 240 tabwrite~ fft-imag; +#X obj 315 158 metro 1000; +#X obj 315 116 loadbang; +#X msg 315 138 1; +#X obj 91 349 pique; +#X msg 91 322 64 fft-real fft-imag 10; +#X obj 91 376 print; +#X obj 205 132 osc~ 5000; +#X text 25 37 pique takes unwindowed FFT analyses as input (they should be stored in arrays) and outputs a list of peaks \, giving their peak number \, frequency \, amplitude \, and phase (as a cosine/sine pair.); +#X text 13 289 message argumnets: number of FFT points \, fft real part \, fft imaginary part \, maximum number of peaks to report.; +#X text 578 387 updated for Pd 0.31.; +#X connect 2 0 6 0; +#X connect 2 1 7 0; +#X connect 3 0 2 0; +#X connect 8 0 6 0; +#X connect 8 0 7 0; +#X connect 9 0 10 0; +#X connect 10 0 8 0; +#X connect 11 0 13 0; +#X connect 12 0 11 0; +#X connect 14 0 2 0; diff --git a/pd/extra/help-rev1.pd b/pd/extra/help-rev1.pd new file mode 100644 index 00000000..55580bd5 --- /dev/null +++ b/pd/extra/help-rev1.pd @@ -0,0 +1,119 @@ +#N canvas 55 21 1008 526 12; +#X obj 148 439 dac~; +#X obj 58 72 line~; +#X msg 58 49 0 \, 10000 5; +#X obj 58 118 cos~; +#X msg 146 70 1; +#X obj 146 47 loadbang; +#X obj 58 95 clip~ 0 0.25; +#X floatatom 173 264 0 0 0; +#X obj 251 134 line~; +#X obj 251 157 cos~; +#X msg 324 54 -0.25 \, 0.25 100; +#X obj 251 8 loadbang; +#X msg 251 31 -0.25; +#X obj 251 203 *~; +#X obj 58 140 hip~ 5; +#X floatatom 162 328 0 0 0; +#X obj 162 373 pack 0 100; +#X obj 162 396 line~; +#X obj 148 416 *~; +#X obj 162 350 dbtorms; +#X msg 324 77 -0.25 \, 0.25 400; +#X floatatom 324 145 0 0 0; +#X obj 324 191 osc~ 440; +#X obj 324 168 mtof; +#X msg 324 31 -0.25 \, 0.25 20; +#X obj 251 180 *~ 0.1; +#X msg 324 100 -0.25 \, 0.25 1000; +#X msg 324 122 -0.25 \, 0.25 2000; +#X obj 324 226 *~; +#X obj 342 252 *~; +#X obj 58 439 dac~; +#X floatatom 68 323 0 0 0; +#X obj 68 368 pack 0 100; +#X obj 68 391 line~; +#X obj 58 416 *~; +#X obj 68 346 dbtorms; +#X msg 324 8 0; +#X obj 308 257 *~; +#X obj 58 26 metro 2000; +#X floatatom 58 4 0 0 0; +#X msg 220 265 bang; +#X obj 284 322 env~ 32768; +#X floatatom 284 344 0 0 0; +#X text 166 244 1 sec; +#X text 143 226 dB after; +#X text 220 245 clear; +#X text 1 51 impulse; +#X text 362 7 tone; +#X text 484 31 beeps; +#X text 428 167 This is an experimental reverberator design composed +of a series of allpass filters with exponentially growing delay times. +Each allpass filter has a gain of 0.7. The reverb time is adjusted +by adjusting the input gains of the allpass filters. The last unit +is modified so that its first two "echos" mimic those of an allpass +but its loop gain depends on reverb time.; +#X text 430 299 Reverb time is controlled by specifying the dB gain +(100 normal) after one second \, so that 100 corresponds to infinite +reverb time \, 70 to two seconds \, 40 to one second \, and 0 to 0 +; +#X text 671 499 modified for Pd version 0.30.; +#X msg 560 34 \; pd dsp 1; +#X text 427 475 The rev1~ module eats about 18% of my 300mHz P2 machine. +; +#X obj 148 289 rev1~; +#X text 428 381 The "clear" button impolitely clears out all the delay +lines \, You may immediately resume pumping the reverberator \, but +the input signal should be cleanly enveloped. The output \, too \, +must be enveloped and may not be opened until 5 msec after the "clear" +message is sent.; +#X connect 1 0 6 0; +#X connect 2 0 1 0; +#X connect 3 0 14 0; +#X connect 4 0 1 0; +#X connect 5 0 4 0; +#X connect 6 0 3 0; +#X connect 7 0 54 1; +#X connect 8 0 9 0; +#X connect 9 0 25 0; +#X connect 10 0 8 0; +#X connect 11 0 12 0; +#X connect 12 0 8 0; +#X connect 13 0 14 0; +#X connect 14 0 34 0; +#X connect 14 0 54 0; +#X connect 15 0 19 0; +#X connect 16 0 17 0; +#X connect 17 0 18 1; +#X connect 18 0 0 0; +#X connect 19 0 16 0; +#X connect 20 0 8 0; +#X connect 21 0 23 0; +#X connect 22 0 13 1; +#X connect 22 0 28 0; +#X connect 22 0 28 1; +#X connect 22 0 29 0; +#X connect 23 0 22 0; +#X connect 24 0 8 0; +#X connect 25 0 13 0; +#X connect 26 0 8 0; +#X connect 27 0 8 0; +#X connect 28 0 29 1; +#X connect 28 0 13 1; +#X connect 28 0 37 0; +#X connect 28 0 37 1; +#X connect 29 0 13 1; +#X connect 31 0 35 0; +#X connect 32 0 33 0; +#X connect 33 0 34 1; +#X connect 34 0 30 0; +#X connect 35 0 32 0; +#X connect 36 0 8 0; +#X connect 37 0 13 1; +#X connect 38 0 2 0; +#X connect 39 0 38 0; +#X connect 40 0 54 2; +#X connect 41 0 42 0; +#X connect 54 0 18 0; +#X connect 54 0 41 0; diff --git a/pd/extra/help-rlshift~.pd b/pd/extra/help-rlshift~.pd new file mode 100644 index 00000000..cdfd8830 --- /dev/null +++ b/pd/extra/help-rlshift~.pd @@ -0,0 +1,29 @@ +#N canvas 143 0 673 325 12; +#X msg 268 277 bang; +#X obj 244 303 print~; +#X msg 185 278 bang; +#X obj 161 304 print~; +#X text 53 117 click here first; +#X msg 72 270 bang; +#X obj 48 296 print~; +#X text 162 222 shift left; +#X text 243 224 shift right; +#X obj 161 252 lrshift~ 1; +#X obj 244 251 lrshift~ -1; +#X text 39 37 Acting at whatever vector size the window is running at \, lrshift~ shifts samples to the left (toward the beginning sample) or to the right. The argument gives the direction and the amount of the shift. The rightmost (or leftmost) samples are set to zero.; +#X graph graph2 0 0 63 1 448 258 648 118; +#X array shiftin 64 float; +#X pop; +#X obj 47 11 rlshift~; +#X text 115 11 -- shift signal vector elements left or right; +#X msg 54 138 \; pd dsp 1 \; shiftin 1 1; +#X obj 48 204 tabreceive~ shiftin; +#X text 525 308 Updated for Pd 0.31.; +#X connect 0 0 1 0; +#X connect 2 0 3 0; +#X connect 5 0 6 0; +#X connect 9 0 3 0; +#X connect 10 0 1 0; +#X connect 16 0 6 0; +#X connect 16 0 9 0; +#X connect 16 0 10 0; diff --git a/pd/extra/hilbert~.pd b/pd/extra/hilbert~.pd new file mode 100644 index 00000000..5bc7a550 --- /dev/null +++ b/pd/extra/hilbert~.pd @@ -0,0 +1,15 @@ +#N canvas 451 128 556 360 12; +#X obj 117 129 biquad~ 0.83774 -0.06338 0.06338 -0.83774 1; +#X obj 117 103 biquad~ 1.94632 -0.94657 0.94657 -1.94632 1; +#X obj 98 186 biquad~ -0.02569 0.260502 -0.260502 0.02569 1; +#X obj 98 212 biquad~ 1.8685 -0.870686 0.870686 -1.8685 1; +#X obj 98 76 inlet~; +#X obj 117 158 outlet~; +#X obj 98 239 outlet~; +#X text 105 273 This is a pair of all-pass filters whose outputs somehow manage to be about 90 degrees out of phase from each other. I don't know what phase relation they have with the original signal. I adapted this from a 4X patch by Emmanuel Favreau \, circa 1982; +#X connect 0 0 5 0; +#X connect 1 0 0 0; +#X connect 2 0 3 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 0 2 0; diff --git a/pd/extra/pique/makefile b/pd/extra/pique/makefile new file mode 100644 index 00000000..2a565566 --- /dev/null +++ b/pd/extra/pique/makefile @@ -0,0 +1,94 @@ +NAME=pique +CSYM=pique + +current: pd_linux + +# ----------------------- NT ----------------------- + +pd_nt: $(NAME).dll + +.SUFFIXES: .dll + +PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo +VC="C:\Program Files\Microsoft Visual Studio\Vc98" + +PDNTINCLUDE = /I. /I\tcl\include /I\ftp\pd\src /I$(VC)\include + +PDNTLDIR = $(VC)\lib +PDNTLIB = $(PDNTLDIR)\libc.lib \ + $(PDNTLDIR)\oldnames.lib \ + $(PDNTLDIR)\kernel32.lib \ + \ftp\pd\bin\pd.lib + +.c.dll: + cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c + link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB) + +# ----------------------- IRIX 5.x ----------------------- + +pd_irix5: $(NAME).pd_irix5 + +.SUFFIXES: .pd_irix5 + +SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2 + +SGIINCLUDE = -I../../src + +.c.pd_irix5: + cc $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c + ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o + rm $*.o + +# ----------------------- IRIX 6.x ----------------------- + +pd_irix6: $(NAME).pd_irix6 + +.SUFFIXES: .pd_irix6 + +SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \ + -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \ + -Ofast=ip32 + +.c.pd_irix6: + cc $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c + ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o + rm $*.o + +# ----------------------- LINUX i386 ----------------------- + +pd_linux: $(NAME).pd_linux + +.SUFFIXES: .pd_linux + +LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \ + -Wall -W -Wshadow -Wstrict-prototypes -Werror \ + -Wno-unused -Wno-parentheses -Wno-switch + +LINUXINCLUDE = -I../../src + +.c.pd_linux: + cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c + ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm + strip --strip-unneeded $*.pd_linux + rm -f $*.o ../$*.pd_linux + ln -s $*/$*.pd_linux .. + +# ----------------------- Mac OSX ----------------------- + +pd_darwin: $(NAME).pd_darwin + +.SUFFIXES: .pd_darwin + +DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \ + -Wno-unused -Wno-parentheses -Wno-switch + +.c.pd_darwin: + cc $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c + cc -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o + rm -f $*.o ../$*.pd_darwin + ln -s $*/$*.pd_darwin .. + +# ---------------------------------------------------------- + +clean: + rm -f *.o *.pd_* so_locations diff --git a/pd/extra/pique/pique.c b/pd/extra/pique/pique.c new file mode 100644 index 00000000..aaf80350 --- /dev/null +++ b/pd/extra/pique/pique.c @@ -0,0 +1,238 @@ +/* Copyright (c) 1999 Miller Puckette. The +contents of this file are free for any use, but BOTH THE AUTHOR AND UCSD +DISCLAIM ALL WARRANTIES related to it. Although not written in Java, this +still should not be used to control any machinery containing a sharp blade or +combustible materiel, or as part of any life support system or weapon. */ + +#include "m_pd.h" +#include <math.h> +#include <stdio.h> +#ifdef NT +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#endif + +static t_class *pique_class; + +typedef struct _pique +{ + t_object x_obj; + int x_n; + float x_errthresh; + float *x_freq; + float *x_amp; + float *x_ampre; + float *x_ampim; +} t_pique; + +static void *pique_new(t_floatarg f) +{ + int n = f; + t_pique *x = (t_pique *)pd_new(pique_class); + if (n < 1) n = 100; + x->x_n = n; + x->x_errthresh = 0; + x->x_freq = t_getbytes(n * sizeof(*x->x_freq)); + x->x_amp = t_getbytes(n * sizeof(*x->x_amp)); + x->x_ampre = t_getbytes(n * sizeof(*x->x_ampre)); + x->x_ampim = t_getbytes(n * sizeof(*x->x_ampim)); + outlet_new(&x->x_obj, &s_list); + return (x); +} + +static float hanning(float pidetune, float sinpidetune) +{ + float pi = 3.14159; + if (pidetune < 0.01 && pidetune > -0.01) return (1); + else if (pidetune > 3.14 && pidetune < 3.143) return (0.5); + else if (pidetune < -3.14 && pidetune > -3.143) return (0.5); + else return (sinpidetune/pidetune - 0.5 * + (sinpidetune/(pidetune+pi) + sinpidetune/(pidetune-pi))); +} + +static float peakerror(float *fpreal, float *fpimag, float pidetune, + float norm, float peakreal, float peakimag) +{ + float sinpidetune = sin(pidetune); + float cospidetune = cos(pidetune); + float windowshould = hanning(pidetune, sinpidetune); + float realshould = windowshould * ( + peakreal * cospidetune + peakimag * sinpidetune); + float imagshould = windowshould * ( + peakimag * cospidetune - peakreal * sinpidetune); + float realgot = norm * (fpreal[0] - 0.5 * (fpreal[1] + fpreal[-1])); + float imaggot = norm * (fpimag[0] - 0.5 * (fpimag[1] + fpimag[-1])); + float realdev = realshould - realgot, imagdev = imagshould - imaggot; + + /* post("real %f->%f; imag %f->%f", realshould, realgot, + imagshould, imaggot); */ + return (realdev * realdev + imagdev * imagdev); +} + +static void pique_doit(int npts, t_float *fpreal, t_float *fpimag, + int npeak, int *nfound, t_float *fpfreq, t_float *fpamp, + t_float *fpampre, t_float *fpampim, float errthresh) +{ + float srate = sys_getsr(); /* not sure how to get this correctly */ + float oneovern = 1.0/ (float)npts; + float fperbin = srate * oneovern; + float pow1, pow2 = 0, pow3 = 0, pow4 = 0, pow5 = 0; + float re1, re2 = 0, re3 = *fpreal; + float im1, im2 = 0, im3 = 0, powthresh, relativeerror; + int count, peakcount = 0, n2 = (npts >> 1); + float *fp1, *fp2; + for (count = n2, fp1 = fpreal, fp2 = fpimag, powthresh = 0; + count--; fp1++, fp2++) + powthresh += (*fp1) * (*fp1) + (*fp2) * (*fp2) ; + powthresh *= 0.00001; + for (count = 1; count < n2; count++) + { + float windreal, windimag, pi = 3.14159; + float detune, pidetune, sinpidetune, cospidetune, + ampcorrect, freqout, ampout, ampoutreal, ampoutimag; + float rpeak, rpeaknext, rpeakprev; + float ipeak, ipeaknext, ipeakprev; + float errleft, errright; + fpreal++; + fpimag++; + re1 = re2; + re2 = re3; + re3 = *fpreal; + im1 = im2; + im2 = im3; + im3 = *fpimag; + if (count < 2) continue; + pow1 = pow2; + pow2 = pow3; + pow3 = pow4; + pow4 = pow5; + /* get Hanning-windowed spectrum by convolution */ + windreal = re2 - 0.5 * (re1 + re3); + windimag = im2 - 0.5 * (im1 + im3); + pow5 = windreal * windreal + windimag * windimag; + /* if (count < 30) post("power %f", pow5); */ + if (count < 5) continue; + /* check for a peak. The actual bin is count-3. */ + if (pow3 <= pow2 || pow3 <= pow4 || pow3 <= pow1 || pow3 <= pow5 + || pow3 < powthresh) + continue; + /* go back for the raw FFT values around the peak. */ + rpeak = fpreal[-3]; + rpeaknext = fpreal[-2]; + rpeakprev = fpreal[-4]; + ipeak = fpimag[-3]; + ipeaknext = fpimag[-2]; + ipeakprev = fpimag[-4]; + /* recalculate Hanning-windowed spectrum by convolution */ + windreal = rpeak - 0.5 * (rpeaknext + rpeakprev); + windimag = ipeak - 0.5 * (ipeaknext + ipeakprev); + + detune = ((rpeakprev - rpeaknext) * + (2.0 * rpeak - rpeakprev - rpeaknext) + + (ipeakprev - ipeaknext) * + (2.0 * ipeak - ipeakprev - ipeaknext)) / + (4.0 * pow3); + /* if (count < 30) post("detune %f", detune); */ + if (detune > 0.7 || detune < -0.7) continue; + /* the frequency is the sum of the bin frequency and detuning */ + freqout = fperbin * ((float)(count-3) + detune); + pidetune = pi * detune; + sinpidetune = sin(pidetune); + cospidetune = cos(pidetune); + ampcorrect = 1.0 / hanning(pidetune, sinpidetune); + /* Multiply by 2 to get real-sinusoid peak amplitude + and divide by N to normalize FFT */ + ampcorrect *= 2. * oneovern; + /* amplitude is peak height, corrected for Hanning window shape */ + + ampout = ampcorrect * sqrt(pow3); + ampoutreal = ampcorrect * + (windreal * cospidetune - windimag * sinpidetune); + ampoutimag = ampcorrect * + (windreal * sinpidetune + windimag * cospidetune); + if (errthresh > 0) + { + /* post("peak %f %f", freqout, ampout); */ + errleft = peakerror(fpreal-4, fpimag-4, pidetune+pi, + 2. * oneovern, ampoutreal, ampoutimag); + errright = peakerror(fpreal-2, fpimag-2, pidetune-pi, + 2. * oneovern, ampoutreal, ampoutimag); + relativeerror = (errleft + errright)/(ampout * ampout); + if (relativeerror > errthresh) continue; + } + /* post("power %f, error %f, relative %f", + pow3, errleft + errright, relativeerror); */ + *fpfreq++ = freqout; + *fpamp++ = ampout; + *fpampre++ = ampoutreal; + *fpampim++ = ampoutimag; + if (++peakcount == npeak) break; + } + *nfound = peakcount; +} + +static void pique_list(t_pique *x, t_symbol *s, int argc, t_atom *argv) +{ + int npts = atom_getintarg(0, argc, argv); + t_symbol *symreal = atom_getsymbolarg(1, argc, argv); + t_symbol *symimag = atom_getsymbolarg(2, argc, argv); + int npeak = atom_getintarg(3, argc, argv); + int n; + t_garray *a; + t_float *fpreal, *fpimag; + if (npts < 8 || npeak < 1) error("pique: bad npoints or npeak"); + if (npeak > x->x_n) npeak = x->x_n; + if (!(a = (t_garray *)pd_findbyclass(symreal, garray_class)) || + !garray_getfloatarray(a, &n, &fpreal) || + n < npts) + error("%s: missing or bad array", symreal->s_name); + else if (!(a = (t_garray *)pd_findbyclass(symimag, garray_class)) || + !garray_getfloatarray(a, &n, &fpimag) || + n < npts) + error("%s: missing or bad array", symimag->s_name); + else + { + int nfound, i; + float *fpfreq = x->x_freq; + float *fpamp = x->x_amp; + float *fpampre = x->x_ampre; + float *fpampim = x->x_ampim; + pique_doit(npts, fpreal, fpimag, npeak, + &nfound, fpfreq, fpamp, fpampre, fpampim, x->x_errthresh); + for (i = 0; i < nfound; i++, fpamp++, fpfreq++, fpampre++, fpampim++) + { + t_atom at[5]; + SETFLOAT(at, (float)i); + SETFLOAT(at+1, *fpfreq); + SETFLOAT(at+2, *fpamp); + SETFLOAT(at+3, *fpampre); + SETFLOAT(at+4, *fpampim); + outlet_list(x->x_obj.ob_outlet, &s_list, 5, at); + } + } +} + +static void pique_errthresh(t_pique *x, t_floatarg f) +{ + x->x_errthresh = f; +} + +static void pique_free(t_pique *x) +{ + int n = x->x_n; + t_freebytes(x->x_freq, n * sizeof(*x->x_freq)); + t_freebytes(x->x_amp, n * sizeof(*x->x_amp)); + t_freebytes(x->x_ampre, n * sizeof(*x->x_ampre)); + t_freebytes(x->x_ampim, n * sizeof(*x->x_ampim)); +} + +void pique_setup(void) +{ + pique_class = class_new(gensym("pique"), (t_newmethod)pique_new, + (t_method)pique_free, sizeof(t_pique),0, A_DEFFLOAT, 0); + class_addlist(pique_class, pique_list); + class_addmethod(pique_class, (t_method)pique_errthresh, + gensym("errthresh"), A_FLOAT, 0); + post("pique 0.1 for PD version 23"); +} + diff --git a/pd/extra/rev1-final.pd b/pd/extra/rev1-final.pd new file mode 100644 index 00000000..0ed091c4 --- /dev/null +++ b/pd/extra/rev1-final.pd @@ -0,0 +1,106 @@ +#N canvas 133 53 729 468 10; +#X obj 72 240 inlet~; +#X obj 347 28 loadbang; +#X obj 90 376 +~; +#X obj 52 408 +~; +#X obj 52 437 outlet~; +#X obj 409 96 pow; +#X obj 372 118 *; +#X floatatom 372 159; +#X obj 82 264 *~ 0; +#X obj 177 175 pow; +#X text 386 140 delay \, msec; +#X floatatom 201 237; +#X obj 190 150 * 0.001; +#X text 206 220 gain for this stage; +#X obj 103 327 *~ 0; +#X obj 201 202 *; +#X text 25 13 Allpass filter for mono reverberator. Arg 1 = delay name \, arg2 = stage number \, arg 3 = delay time; +#X obj 373 76 8; +#X obj 409 75 1.79; +#X obj 114 175 0.7; +#X obj 363 50 t b b b b; +#X obj 177 108 0; +#X obj 372 207 abs; +#X obj 372 229 moses 0.01; +#X obj 443 229 print wrong-delay-time; +#X obj 233 391 inlet~; +#X obj 219 419 +~; +#X obj 219 443 outlet~; +#X text 74 83 decay after; +#X text 85 98 1 second; +#X obj 83 119 r \$1-decay; +#X obj 327 262 r \$1-clear; +#X obj 240 298 0; +#X obj 327 281 t b; +#X obj 327 344 delay; +#X obj 327 322 + 5; +#X obj 158 279 delread~ \$2 \$4; +#X obj 90 397 delwrite~ \$2 \$4; +#X obj 327 302 f \$4; +#X obj 371 184 - \$4; +#X obj 446 75 float \$3; +#X obj 241 318 1; +#X obj 158 300 *~ 1; +#X obj 52 298 *~ 0; +#X obj 10 209 t b f f; +#X obj 28 233 *; +#X obj 10 256 -; +#X obj 41 258 * -1; +#X obj 11 297 *~ 0; +#X obj 214 181 sqrt; +#X connect 0 0 8 0; +#X connect 1 0 20 0; +#X connect 2 0 37 0; +#X connect 3 0 4 0; +#X connect 3 0 26 0; +#X connect 5 0 6 1; +#X connect 6 0 7 0; +#X connect 6 0 12 0; +#X connect 7 0 39 0; +#X connect 8 0 43 0; +#X connect 8 0 48 0; +#X connect 9 0 15 0; +#X connect 9 0 14 1; +#X connect 12 0 9 1; +#X connect 14 0 2 1; +#X connect 14 0 3 1; +#X connect 15 0 11 0; +#X connect 15 0 8 1; +#X connect 17 0 6 0; +#X connect 18 0 5 0; +#X connect 18 0 49 0; +#X connect 19 0 44 0; +#X connect 19 0 47 0; +#X connect 20 0 21 0; +#X connect 20 0 19 0; +#X connect 20 1 17 0; +#X connect 20 2 18 0; +#X connect 20 3 40 0; +#X connect 21 0 9 0; +#X connect 22 0 23 0; +#X connect 23 1 24 0; +#X connect 25 0 26 1; +#X connect 26 0 27 0; +#X connect 30 0 9 0; +#X connect 31 0 33 0; +#X connect 32 0 42 1; +#X connect 33 0 32 0; +#X connect 33 0 38 0; +#X connect 34 0 41 0; +#X connect 35 0 34 0; +#X connect 36 0 42 0; +#X connect 38 0 35 0; +#X connect 39 0 22 0; +#X connect 40 0 5 1; +#X connect 41 0 42 1; +#X connect 42 0 14 0; +#X connect 43 0 3 0; +#X connect 44 0 46 0; +#X connect 44 1 45 0; +#X connect 44 2 45 1; +#X connect 45 0 46 1; +#X connect 46 0 48 1; +#X connect 47 0 43 1; +#X connect 48 0 2 0; +#X connect 49 0 15 1; diff --git a/pd/extra/rev1-stage.pd b/pd/extra/rev1-stage.pd new file mode 100644 index 00000000..c1ee6574 --- /dev/null +++ b/pd/extra/rev1-stage.pd @@ -0,0 +1,99 @@ +#N canvas 86 133 729 452 10; +#X obj 27 238 inlet~; +#X obj 347 28 loadbang; +#X obj 171 281 * -1; +#X obj 36 353 +~; +#X obj 69 395 +~; +#X obj 69 424 outlet~; +#X obj 409 96 pow; +#X obj 372 118 *; +#X floatatom 372 159; +#X obj 37 262 *~ 0; +#X obj 177 175 pow; +#X text 408 162 delay \, msec; +#X floatatom 177 238; +#X obj 190 150 * 0.001; +#X text 182 221 gain for this stage; +#X obj 49 332 *~ 0; +#X obj 47 375 *~ 0; +#X obj 177 203 *; +#X floatatom 409 119; +#X text 25 13 Allpass filter for mono reverberator. Arg 1 = delay name \, arg2 = stage number \, arg 3 = delay time; +#X obj 373 76 8; +#X obj 409 75 1.79; +#X obj 68 185 0.7; +#X obj 363 50 t b b b b; +#X obj 177 108 0; +#X obj 372 207 abs; +#X obj 372 229 moses 0.01; +#X obj 443 229 print wrong-delay-time; +#X obj 233 391 inlet~; +#X obj 219 419 +~; +#X obj 219 443 outlet~; +#X text 74 83 decay after; +#X text 85 98 1 second; +#X obj 83 119 r \$1-decay; +#X obj 259 256 r \$1-clear; +#X obj 206 301 0; +#X obj 259 275 t b; +#X obj 259 338 delay; +#X obj 259 316 + 5; +#X obj 79 280 delread~ \$2 \$4; +#X obj 36 447 delwrite~ \$2 \$4; +#X obj 259 296 f \$4; +#X obj 371 184 - \$4; +#X obj 446 75 float \$3; +#X obj 207 321 1; +#X obj 79 301 *~ 1; +#X obj 207 188 sqrt; +#X floatatom 35 148; +#X connect 0 0 9 0; +#X connect 1 0 23 0; +#X connect 2 0 16 1; +#X connect 3 0 16 0; +#X connect 3 0 40 0; +#X connect 4 0 5 0; +#X connect 4 0 29 0; +#X connect 6 0 7 1; +#X connect 6 0 18 0; +#X connect 7 0 8 0; +#X connect 7 0 13 0; +#X connect 8 0 42 0; +#X connect 9 0 3 0; +#X connect 10 0 17 0; +#X connect 13 0 10 1; +#X connect 15 0 3 1; +#X connect 16 0 4 0; +#X connect 17 0 12 0; +#X connect 17 0 9 1; +#X connect 20 0 7 0; +#X connect 21 0 6 0; +#X connect 21 0 46 0; +#X connect 22 0 2 0; +#X connect 22 0 15 1; +#X connect 23 0 24 0; +#X connect 23 0 22 0; +#X connect 23 1 20 0; +#X connect 23 2 21 0; +#X connect 23 3 43 0; +#X connect 24 0 10 0; +#X connect 25 0 26 0; +#X connect 26 1 27 0; +#X connect 28 0 29 1; +#X connect 29 0 30 0; +#X connect 33 0 10 0; +#X connect 33 0 47 0; +#X connect 34 0 36 0; +#X connect 35 0 45 1; +#X connect 36 0 35 0; +#X connect 36 0 41 0; +#X connect 37 0 44 0; +#X connect 38 0 37 0; +#X connect 39 0 45 0; +#X connect 41 0 38 0; +#X connect 42 0 25 0; +#X connect 43 0 6 1; +#X connect 44 0 45 1; +#X connect 45 0 15 0; +#X connect 45 0 4 1; +#X connect 46 0 17 1; diff --git a/pd/extra/rev1~.pd b/pd/extra/rev1~.pd new file mode 100644 index 00000000..83fd6d20 --- /dev/null +++ b/pd/extra/rev1~.pd @@ -0,0 +1,64 @@ +#N canvas 66 116 512 312 10; +#X obj 345 154 dbtorms; +#X obj 316 120 min 100; +#X obj 316 100 inlet; +#X obj 45 16 inlet~; +#X obj 254 298 outlet~; +#X obj 432 106 inlet; +#X obj 432 130 t b; +#X obj 269 145 t b f; +#X obj 281 185 -; +#X obj 282 254 line~; +#X obj 282 233 pack 0 100; +#X obj 269 166 105; +#X obj 256 276 *~; +#X obj 282 210 * 0.01; +#X text 282 65 reverb decay speed; +#X text 278 79 (dB left after 1 sec); +#X text 425 84 bang to clear; +#X obj 44 41 rev1-stage \$0 \$0-del1 0 8; +#X obj 44 64 rev1-stage \$0 \$0-del2 1 14.32; +#X obj 44 87 rev1-stage \$0 \$0-del3 2 25.6328; +#X obj 44 110 rev1-stage \$0 \$0-del4 3 45.8827; +#X obj 44 133 rev1-stage \$0 \$0-del5 4 82.1301; +#X obj 44 156 rev1-stage \$0 \$0-del6 5 147.013; +#X obj 44 179 rev1-stage \$0 \$0-del7 6 263.153; +#X obj 44 202 rev1-stage \$0 \$0-del8 7 471.044; +#X obj 44 225 rev1-stage \$0 \$0-del9 8 843.168; +#X obj 44 248 rev1-final \$0 \$0-del10 9 1509.27; +#X obj 346 177 s \$0-decay; +#X obj 432 153 s \$0-clear; +#X connect 0 0 27 0; +#X connect 1 0 0 0; +#X connect 1 0 7 0; +#X connect 2 0 1 0; +#X connect 3 0 17 0; +#X connect 5 0 6 0; +#X connect 6 0 28 0; +#X connect 7 0 11 0; +#X connect 7 1 8 1; +#X connect 8 0 13 0; +#X connect 9 0 12 1; +#X connect 10 0 9 0; +#X connect 11 0 8 0; +#X connect 12 0 4 0; +#X connect 13 0 10 0; +#X connect 17 0 18 0; +#X connect 17 1 18 1; +#X connect 18 0 19 0; +#X connect 18 1 19 1; +#X connect 19 0 20 0; +#X connect 19 1 20 1; +#X connect 20 0 21 0; +#X connect 20 1 21 1; +#X connect 21 0 22 0; +#X connect 21 1 22 1; +#X connect 22 0 23 0; +#X connect 22 1 23 1; +#X connect 23 0 24 0; +#X connect 23 1 24 1; +#X connect 24 0 25 0; +#X connect 24 1 25 1; +#X connect 25 0 26 0; +#X connect 25 1 26 1; +#X connect 26 1 12 0; |