diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2014-11-06 17:29:10 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2014-11-06 17:29:10 +0000 |
commit | 24eb93e7c365ce8c775d7495ad528d3e33ea8033 (patch) | |
tree | c97f9928f19d64b30c7724c5f6b1ce7234ba222b | |
parent | b46aca1241df7bf23bfce6c28b6db203525340ac (diff) | |
download | LibXtract-24eb93e7c365ce8c775d7495ad528d3e33ea8033.tar.gz LibXtract-24eb93e7c365ce8c775d7495ad528d3e33ea8033.tar.bz2 LibXtract-24eb93e7c365ce8c775d7495ad528d3e33ea8033.zip |
Remove puredata and MaxMSP examples
28 files changed, 0 insertions, 2479 deletions
diff --git a/examples/MSP/Info.plist b/examples/MSP/Info.plist deleted file mode 100644 index 9a02ed6..0000000 --- a/examples/MSP/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>xtract~</string> - <key>CFBundleIconFile</key> - <string></string> - <key>CFBundleIdentifier</key> - <string>co.uk.postlude</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>iLaX</string> - <key>CFBundleSignature</key> - <string>max2</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>CSResourcesFileMapped</key> - <true/> -</dict> -</plist> diff --git a/examples/MSP/Makefile b/examples/MSP/Makefile deleted file mode 100644 index bb3fbb4..0000000 --- a/examples/MSP/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -NAME=xtract~
-CSYM=xtract~
-
-all: universal
-current: universal
-
-FRAMEWORKS = /Library/Frameworks
-MAXINCLUDE = $(FRAMEWORKS)/MaxAPI.framework/Headers
-MSPINCLUDE = $(FRAMEWORKS)/MaxAudioAPI.framework/Headers
-INSTALLDIR = /Applications/Max5/Cycling\ \'74/externals/
-XTRACT_HEADERS = /usr/local/include
-
-LIPO = /usr/bin/lipo
-CC = gcc
-
-#DEBUG_FLAGS = -Werror -Wall
-
-CFLAGS = -F$(FRAMEWORKS) -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -x c -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -fmessage-length=0 -I$(MAXINCLUDE) -I$(MSPINCLUDE) $(DEBUG_FLAGS) -I$(XTRACT_HEADERS)
-
-I386CFLAGS = -arch i386
-IX86_64CFLAGS = -arch x86_64
-
-LDFLAGS = -F$(FRAMEWORKS) -L$(MAXINCLUDE) -L$(MSPINCLUDE) -framework Carbon -framework MaxAPI -framework MaxAudioAPI -Wl,-Y,1455 -bundle -L/usr/local/lib -lxtract
-
-I386LDFLAGS = -arch i386
-IX86_64CFLAGS = -arch x86_64
-
-universal:
- $(CC) $(CFLAGS) $(I386CFLAGS) -o $(NAME)-i386.o -c $(NAME).c
- $(CC) $(LDFLAGS) $(I386LDFLAGS) -o $(NAME)-i386 $(NAME)-i386.o
- $(LIPO) -create $(NAME)-i386 -output $(NAME)
- mkdir -p $(NAME).mxo/Contents/MacOS
- cp Info.plist PkgInfo $(NAME).mxo/Contents/
- cp $(NAME) $(NAME).mxo/Contents/MacOS
-
-
-intel:
- $(CC) $(CFLAGS) $(I386CFLAGS) -o $(NAME)-i386.o -c $(NAME).c
- $(CC) $(LDFLAGS) $(I386LDFLAGS) -o $(NAME)-i386 $(NAME)-i386.o
- $(LIPO) -create $(NAME)-i386 -output $(NAME)
- mkdir -p $(NAME).mxo/Contents/MacOS
- cp Info.plist PkgInfo $(NAME).mxo/Contents/
- cp $(NAME) $(NAME).mxo/Contents/MacOS
-
-intel64:
- $(CC) $(CFLAGS) $(IX86_64CFLAGS) -o $(NAME)-64.o -c $(NAME).c
- $(CC) $(LDFLAGS) $(IX86_64LDFLAGS) -o $(NAME)-64 $(NAME)-64.o
- $(LIPO) -create $(NAME)-64 -output $(NAME)
- mkdir -p $(NAME).mxo/Contents/MacOS
- cp Info.plist PkgInfo $(NAME).mxo/Contents/
- cp $(NAME) $(NAME).mxo/Contents/MacOS
-
-
-
-clean:
- rm -rf *64* *i386* xtract~ *.mxo
-
-install:
- $(INSTALL) cp -r $(NAME).mxo $(INSTALLDIR)
diff --git a/examples/MSP/PkgInfo b/examples/MSP/PkgInfo deleted file mode 100644 index 0febb6e..0000000 --- a/examples/MSP/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -iLaXmax2
\ No newline at end of file diff --git a/examples/MSP/test/magspec b/examples/MSP/test/magspec deleted file mode 100644 index 14904f6..0000000 --- a/examples/MSP/test/magspec +++ /dev/null @@ -1 +0,0 @@ -max v2;
#N vpatcher 762 88 1362 488;
#P window setfont "Sans Serif" 9.;
#N out 1;
#P newobj 219 220 33 196617 out 1;
#N in 2;
#P newobj 316 36 25 196617 in 2;
#N in 1;
#P newobj 218 44 25 196617 in 1;
#P newex 218 112 108 196617 wave~ mags 0. 11.61;
#P newex 218 77 101 196617 phasor~ 86.133003;
#P newex 53 119 100 196617 buffer~ mags 11.62;
#P newex 218 146 134 196617 xtract~ irregularity_k 512;
#P connect 4 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 0 0;
#P connect 0 0 6 0;
#P connect 5 0 3 2;
#P pop;
\ No newline at end of file diff --git a/examples/MSP/test/xtract-test.pat b/examples/MSP/test/xtract-test.pat deleted file mode 100644 index 72394bf..0000000 --- a/examples/MSP/test/xtract-test.pat +++ /dev/null @@ -1 +0,0 @@ -max v2;
#N vpatcher 22 65 823 798;
#P origin -203 -11;
#P window setfont "Sans Serif" 9.;
#P newex 154 177 46 196617 / 1000.;
#P newex 19 349 39 196617 noise~;
#P flonum 79 206 88 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 79 180 71 196617 expr log($f1);
#P message 377 385 68 196617 /braun/5 \$1;
#P message 305 385 68 196617 /braun/4 \$1;
#P message 229 385 68 196617 /braun/3 \$1;
#P message 155 386 68 196617 /braun/2 \$1;
#P flonum 657 181 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 511 176 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 426 179 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 334 180 63 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 594 180 55 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 0 378 69 196617 send~ source;
#P newex 425 150 72 196617 r irregularity;
#P newex 508 151 72 196617 r fundamental;
#P newex 656 151 57 196617 r variance;
#P newex 223 151 104 196617 r standard_deviation;
#P newex 593 150 55 196617 r centroid;
#P newex 79 148 55 196617 r kurtosis;
#P newex 332 151 80 196617 r inharmonicity;
#P newex 154 151 61 196617 r skewness;
#N vpatcher 9 59 787 818;
#P window setfont "Sans Serif" 9.;
#P newex 622 460 37 196617 pack f;
#P window linecount 1;
#P newex 213 260 83 196617 receive~ source;
#P newex 213 290 35 196617 *~ 1.;
#P newex 516 261 72 196617 s irregularity;
#P newex 226 390 72 196617 s fundamental;
#P newex 557 514 57 196617 s variance;
#P newex 364 560 104 196617 s standard_deviation;
#P newex 312 444 55 196617 s centroid;
#P newex 183 688 55 196617 s kurtosis;
#P newex 70 468 80 196617 s inharmonicity;
#P newex 7 689 61 196617 s skewness;
#P newex 71 423 95 196617 receive~ spectrum;
#P message 213 426 40 196617 list \$1;
#P newex 70 445 153 196617 xtract~ spectral_inharmonicity;
#P newex 529 403 62 196617 poke~ mags;
#P newex 436 265 27 196617 / 2.;
#P newex 470 207 29 196617 * 2.;
#P newex 555 378 85 196617 count~ 0 1024 1;
#P newex 470 232 111 196617 poly~ magspec vs 512;
#P newex 7 667 134 196617 xtract~ spectral_skewness;
#P newex 7 644 95 196617 receive~ spectrum;
#P newex 408 337 44 196617 pack f f;
#P newex 183 667 128 196617 xtract~ spectral_kurtosis;
#P newex 183 644 95 196617 receive~ spectrum;
#P newex 301 559 44 196617 pack f f;
#P newex 333 513 95 196617 receive~ spectrum;
#P message 502 514 40 196617 list \$1;
#P newex 335 533 177 196617 xtract~ spectral_standard_deviation;
#P newex 502 467 95 196617 receive~ spectrum;
#P newex 442 403 81 196617 send~ spectrum;
#P newex 502 488 130 196617 xtract~ spectral_variance;
#P newex 213 360 58 196617 xtract~ f0;
#P newex 394 234 47 196617 * 1000.;
#P newex 394 212 31 196617 !/ 0.;
#P newex 324 80 27 196617 i 10;
#P newex 304 57 30 196617 t b b;
#P newex 304 35 48 196617 loadbang;
#P newex 318 169 27 196617 / 0.;
#P newex 301 326 27 196617 *~;
#P newex 318 274 46 196617 phasor~;
#P newex 318 298 87 196617 wave~ hann 0. 0.;
#P newex 304 130 54 196617 dspstate~;
#P newex 324 103 73 196617 adstatus sigvs;
#B color 5;
#P newex 301 405 128 196617 xtract~ spectral_centroid;
#P newex 301 360 117 196617 xtract~ spectrum 1024;
#P comment 406 300 109 196617 //windowing function;
#P window linecount 0;
#P comment 46 52 100 196617 //basic feature cascade;
#P comment 596 233 100 196617 //poly~ used to reduce down to half-block size to get just magnitudes;
#P comment 598 406 140 196617 //mags is inside the poly~;
#P connect 28 0 29 0;
#P connect 29 0 38 0;
#P connect 37 0 35 0;
#P connect 35 0 39 0;
#P connect 24 0 29 1;
#P connect 25 0 26 0;
#P connect 26 0 40 0;
#P connect 47 0 46 0;
#P connect 46 0 17 0;
#P connect 17 0 36 0;
#P connect 36 0 35 1;
#P connect 17 0 44 0;
#P connect 46 0 10 0;
#P connect 10 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 24 0;
#P connect 24 0 26 1;
#P connect 12 0 13 0;
#P connect 13 0 7 0;
#P connect 5 0 41 0;
#P connect 7 1 11 0;
#P connect 11 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 10 1;
#P connect 13 1 14 0;
#P connect 14 0 6 0;
#P connect 7 3 11 1;
#P connect 23 0 21 0;
#P connect 21 0 24 1;
#P connect 21 0 42 0;
#P connect 7 1 15 0;
#P connect 15 0 16 0;
#P connect 16 0 8 2;
#P connect 11 0 27 0;
#P connect 27 0 4 1;
#P connect 7 3 15 1;
#P connect 16 0 33 0;
#P connect 4 0 19 0;
#P connect 11 0 32 0;
#P connect 32 0 30 0;
#P connect 20 0 18 0;
#P connect 18 0 22 0;
#P connect 22 0 21 1;
#P connect 30 0 45 0;
#P connect 4 0 34 0;
#P connect 31 0 34 1;
#P connect 18 0 43 0;
#P connect 33 0 30 1;
#P connect 5 0 48 0;
#P connect 48 0 18 1;
#P pop;
#P newobj 594 83 37 196617 p guts;
#P newex 0 269 38 196617 * 100;
#P slider 0 116 15 128 0 1;
#P number 0 294 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 79 386 68 196617 /braun/1 \$1;
#P newex 79 476 120 196617 udpsend 127.0.0.1 4444;
#N vpatcher 10 59 364 406;
#P window setfont "Sans Serif" 9.;
#P newex 47 33 48 196617 loadbang;
#P window linecount 1;
#P newex 87 102 27 196617 t i i;
#P newex 87 258 43 196617 pack i f;
#P newex 87 80 27 196617 - 1;
#P newex 47 59 51 196617 Uzi 1024;
#P newex 87 283 59 196617 peek~ hann;
#P newex 120 227 38 196617 + 0.5;
#P newex 120 206 42 196617 * -0.5;
#P newex 104 126 46 196617 / 1023.;
#P newex 120 161 47 196617 * 6.283;
#P newex 120 183 23 196617 cos;
#P window linecount 0;
#P comment 182 38 100 196617 //makes a hanning window in a buffer called hann;
#P connect 11 0 7 0;
#P connect 7 2 8 0;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P connect 9 0 6 0;
#P connect 10 1 3 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 9 1;
#P pop;
#P newobj 550 35 80 196617 p make_hanning;
#P newex 533 57 97 196617 buffer~ hann 23.22;
#P user ezdac~ 648 37 692 70 0;
#P newex 0 321 55 196617 saw~ 440;
#P connect 7 0 8 0;
#P connect 8 0 6 0;
#P connect 6 0 0 0;
#P connect 0 0 18 0;
#P connect 30 0 18 0;
#P connect 12 0 28 0;
#P connect 28 0 29 0;
#P connect 28 0 5 0;
#P connect 27 0 4 0;
#P connect 26 0 4 0;
#P connect 25 0 4 0;
#P connect 24 0 4 0;
#P connect 5 0 4 0;
#P connect 10 0 31 0;
#P connect 11 0 24 0;
#P connect 17 0 25 0;
#P connect 16 0 26 0;
#P connect 11 0 20 0;
#P connect 13 0 27 0;
#P connect 17 0 21 0;
#P connect 16 0 22 0;
#P connect 13 0 19 0;
#P connect 15 0 23 0;
#P pop;
\ No newline at end of file diff --git a/examples/MSP/version.plist b/examples/MSP/version.plist deleted file mode 100644 index 169b5fa..0000000 --- a/examples/MSP/version.plist +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>BuildVersion</key> - <string>38</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>ProjectName</key> - <string>CarbonProjectTemplates</string> - <key>SourceVersion</key> - <string>140000</string> -</dict> -</plist> diff --git a/examples/MSP/xtract~.c b/examples/MSP/xtract~.c deleted file mode 100644 index e46ec6a..0000000 --- a/examples/MSP/xtract~.c +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (C) 2012 Jamie Bullock - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - */ - -/* calculates the spectral xtract of one frame, given peak frequency and amplitude to first and second inputs respectively */ - -#include "ext.h" -#include "z_dsp.h" -#include <math.h> -#include <string.h> - -#include "xtract/libxtract.h" - -#define BLOCKSIZE 1024 /* FIX: this should be dynamic - somehow */ -#define NYQUIST 22050.0f - -void *xtract_tilde_class; - -/* Struct for keeping track of memory allocations */ -typedef struct _tracked_memory { - char argv; -} tracked_memory; - -typedef struct _xtract { - t_pxobject x_obj; - void *outlet; /*Float outlet */ - t_float f; - t_int feature; - t_symbol *feature_name; - t_int init_blocksize; - t_int done_init; - t_int feature_type; - tracked_memory memory; - void *argv; - double *data; - double *result; -} t_xtract_tilde; - -static t_int *xtract_perform(t_int *w) { - t_float *in = (t_float *)(w[1]); - t_xtract_tilde *x = (t_xtract_tilde *)(w[2]); - t_int N = (t_int)(w[3]); - t_int return_code = 0; - double result = 0.f; - - for(n = 0; n < N; ++n){ - x->data[n] = (double)in[n]; - } - - return_code = xtract[x->feature](x->data, N, x->argv, &result); - - if(return_code == XTRACT_FEATURE_NOT_IMPLEMENTED) - perror("Feature not implemented"); - - /* set nan, inf or -inf to 0 */ - result = (isinf(result) || isnan(result) ? 0 : result); - - outlet_float(x->outlet, (float)result); - return (w+4); -} - -static t_int *xtract_perform_vector(t_int *w) { - t_sample *in = (t_float *)(w[1]); - t_sample *out = (t_float *)(w[2]); - t_xtract_tilde *x = (t_xtract_tilde *)(w[3]); - t_int N = (t_int)(w[4]), n; - t_int return_code = 0; - - if(x->feature == XTRACT_PEAK_SPECTRUM) - N >>= 1; - - if(N != x->init_blocksize && x->done_init){ - post("xtract~ %s: Blocksize mismatch, try specifying the blocksize as a second argument", x->feature_name->s_name); - return (w+5); - } - - for(n = 0; n < N; ++n){ - x->data[n] = (double)in[n]; - } - - return_code = xtract[x->feature](x->data, N, x->argv, x->result); - - for(n = 0; n < N; ++n){ - out[n] = (float)x->result[n]; - } - - if(return_code == XTRACT_FEATURE_NOT_IMPLEMENTED) - perror("Feature not implemented"); - - return (w+5); -} - -static void xtract_tilde_dsp(t_xtract_tilde *x, t_signal **sp) { - - if(x->feature_type == XTRACT_VECTOR) - dsp_add(xtract_perform_vector, 4, - sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); - - else dsp_add(xtract_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); - -} - -static void *xtract_tilde_new(t_symbol *me, t_int argc, t_atom *argv) { - - t_symbol *tmp; - t_xtract_tilde *x = (t_xtract_tilde *)newobject(xtract_tilde_class); - xtract_mel_filter *mf; - t_int n, N, f, F, n_args, type; - t_float *argv_max; - xtract_function_descriptor_t *fd; - char *p_name, *p_desc, *author; - int year; - - tmp = NULL; - p_name = p_desc = author = NULL; - - n_args = type = x->feature = 0; - - f = F = XTRACT_FEATURES; - - N = BLOCKSIZE; - - x->argv = NULL; - x->done_init = 0; - - x->data = (double *)getbytes(N * sizeof(double)); - x->result = (double *)getbytes(N * sizeof(double)); - - - if(argc) - tmp = argv[0].a_w.w_sym; /*atom_getsymbol(argv); */ - if(argc > 1) - N = (t_int)argv[1].a_w.w_long; - - x->init_blocksize = N; - - /* get function descriptors */ - fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); - - /* iterate over descriptors */ - while(f--){ - /* map creation arg to feature */ - if(tmp == gensym(fd[f].algo.name)){ - x->feature = f; - break; - } - } - - /* allocate memory for feature arguments */ - n_args = fd[f].argc; - type = fd[f].argv.type; - - if(n_args){ - for(n = 0; n < n_args; n++){ - argv_max = &fd[f].argv.max[n]; - //post("Argument %d, max: %.2f", n, *argv_max); - } - if(type == XTRACT_MEL_FILTER){ - x->memory.argv = (size_t)(n_args * sizeof(xtract_mel_filter)); - x->argv = (xtract_mel_filter *)getbytes(x->memory.argv); - } - else if(type == XTRACT_INT){ - x->memory.argv = (size_t)(n_args * sizeof(t_int)); - x->argv = (t_int *)getbytes(x->memory.argv); - } - else if (type == XTRACT_FLOAT){ - x->memory.argv = (size_t)(n_args * sizeof(t_float)); - x->argv = (t_float *)getbytes(x->memory.argv); - } - else - x->memory.argv = 0; - } - - - p_name = fd[f].algo.p_name; - p_desc = fd[f].algo.p_desc; - author = fd[f].algo.author; - year = fd[f].algo.year; - - if(argc){ - if(strcmp(p_name, "")) - post("xtract~: %s", p_name ); - if(strcmp(p_desc, "")) - post("xtract~: %s", p_desc ); - if(strcmp(author, "") && year) - post("xtract~: %s(%d)", author, year); - } - else - post("xtract~: No arguments given"); - - /* do init if needed */ - if(x->feature == XTRACT_MFCC){ - - mf = x->argv; - - mf->n_filters = 20; - - post("xtract~: mfcc: filters = %d", - ((xtract_mel_filter *)x->argv)->n_filters); - mf->filters = - (t_float **)getbytes(mf->n_filters * sizeof(t_float *)); - for(n = 0; n < mf->n_filters; n++) - mf->filters[n] = (float *)getbytes(N * sizeof(float)); - - xtract_init_mfcc(N, NYQUIST, XTRACT_EQUAL_GAIN, 80.0f, - 18000.0f, mf->n_filters, mf->filters); - } - else if(x->feature == XTRACT_BARK_COEFFICIENTS) - xtract_init_bark(N, NYQUIST, x->argv); - - /* Initialise fft_plan if required */ - if(x->feature == XTRACT_AUTOCORRELATION_FFT || - x->feature == XTRACT_SPECTRUM || - x->feature == XTRACT_DCT){ - xtract_init_fft(N, x->feature); - x->done_init = 1; - } - - if(x->feature == XTRACT_AUTOCORRELATION || - x->feature == XTRACT_AUTOCORRELATION_FFT || - x->feature == XTRACT_MFCC || x->feature == XTRACT_AMDF || - x->feature == XTRACT_ASDF|| x->feature == XTRACT_DCT || - x->feature == XTRACT_BARK_COEFFICIENTS || - x->feature == XTRACT_SPECTRUM || - x->feature == XTRACT_PEAK_SPECTRUM || - x->feature == XTRACT_HARMONIC_SPECTRUM) - x->feature_type = XTRACT_VECTOR; - - else if (x->feature == XTRACT_FLUX || x->feature == XTRACT_ATTACK_TIME || - x->feature == XTRACT_DECAY_TIME || x->feature == XTRACT_DELTA) - x->feature_type = XTRACT_DELTA; - - else x->feature_type = XTRACT_SCALAR; - - /* argv through right inlet */ - inlet_new((t_pxobject *)x, "list"); - - /* DSP inlet */ - dsp_setup((t_pxobject *)x, 1); - - - /* if feature is vector, create signal out */ - if(x->feature_type == XTRACT_VECTOR) - outlet_new((t_pxobject *)x, "signal"); - - /* otherwise: float */ - else - x->outlet = floatout((t_pxobject *)x); - - - /* free the function descriptors */ - xtract_free_descriptors(fd); - - return (void *)x; -} - -static void xtract_tilde_get_args(t_xtract_tilde *x, t_symbol *selector, -t_int argc, t_atom *argv) { -/* - if(argc > (t_int)sizeof(x->argv) / - (t_int)sizeof(t_float) || x->argv == NULL) - post("Too many parameters to right inlet"); - else{*/ - - t_float temp = 0.f; - x->argv = getbytes(argc * sizeof(float)); - - while(argc--){ - temp = argv[argc].a_w.w_float; - ((t_float *)x->argv)[argc] = temp; - } - /* }*/ -} - -static void xtract_tilde_show_help(t_xtract_tilde *x, t_symbol *s){ - - int i; - - i = XTRACT_FEATURES; - xtract_function_descriptor_t *fd, *d; - - fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); - post("\nxtract~: Feature List\n"); - - while(i--){ - d = &fd[i]; - post("\t%s", d->algo.name); - } - - xtract_free_descriptors(fd); -} - -static void xtract_tilde_free(t_xtract_tilde *x) { - - if(x->argv != NULL && x->memory.argv) - freebytes(x->argv, x->memory.argv); - freebytes(x->data); - freebytes(x->result); -} - -int main(void) { - - setup((t_messlist **)&xtract_tilde_class, - (method)xtract_tilde_new, - (method)xtract_tilde_free, - sizeof(t_xtract_tilde), - 0L, - A_GIMME, 0); - - addmess((method)xtract_tilde_dsp, "dsp", A_CANT, 0); - addmess((method)xtract_tilde_get_args, "list", A_GIMME, 0); - addmess((method)xtract_tilde_show_help, "help", A_DEFSYM, 0); - dsp_initclass(); - //class_setname("xtract~", "xtract~"); - - return 0; - -} diff --git a/examples/puredata/bark-example.pd b/examples/puredata/bark-example.pd deleted file mode 100644 index e59b232..0000000 --- a/examples/puredata/bark-example.pd +++ /dev/null @@ -1,52 +0,0 @@ -#N canvas 191 188 450 625 10; -#N canvas 0 0 450 300 graph1 0; -#X array bark 26 float 5; -#A 0 0 0 0 0 0 0 0.00450555 0 0 0 0.0906432 0 0 0.154719 0 0.0683638 -0.0384251 0.0569213 0.0220149 0.0976565 0.064886 0.067408 0.0374335 -0.000314513 4.48489e-05 0; -#X coords 0 1 25 -1 200 140 1; -#X restore 236 -233 graph; -#X obj 273 104 xtract~ spectrum 64; -#X obj 272 73 xtract~ windowed 64; -#X obj 272 136 tabsend~ mags; -#N canvas 0 0 450 300 graph2 0; -#X array mags 32 float 5; -#A 0 0.00450555 0.0906432 0.154719 0.0683638 0.0384251 0.0569213 0.0220149 -0.0423353 0.0553211 0.018837 0.046049 0.0530074 0.0144005 0.0165512 -0.0167357 0.00365258 0.000494011 0.000160456 7.35776e-05 3.51928e-05 -3.1222e-05 1.40643e-05 1.18581e-05 8.65756e-06 7.31448e-06 6.333e-06 -2.75085e-06 4.85414e-06 3.08083e-06 2.56348e-06 3.22329e-06 1.50987e-08 -; -#X coords 0 1 31 -1 200 140 1; -#X restore 16 -232 graph; -#N canvas 3 50 450 300 bark 0; -#X obj 364 19 block~ 32; -#X obj 144 160 tabsend~ bark; -#X obj 145 93 tabreceive~ mags; -#X obj 145 118 xtract~ bark_coefficients 32; -#X connect 2 0 3 0; -#X connect 3 0 1 0; -#X restore 271 167 pd bark; -#N canvas 0 0 450 300 graph3 0; -#X array waveform 67 float 5; -#A 0 -0.304942 0 0.304942 0.578981 0.795978 0.938463 0.999999 0.985604 -0.910237 0.795681 0.666471 0.545664 0.451213 0.393581 0.37492 0.389832 -0.427409 0.474038 0.516335 0.543621 0.549513 0.532424 0.495019 0.442906 -0.382948 0.321642 0.2639 0.212453 0.167896 0.129229 0.094662 0.062379 -0.0310556 8.38604e-07 -0.031054 -0.0623773 -0.0946602 -0.129227 -0.167893 --0.212451 -0.263897 -0.321639 -0.382945 -0.442903 -0.495017 -0.532422 --0.549513 -0.543622 -0.516337 -0.474041 -0.427411 -0.389833 -0.37492 --0.393579 -0.451209 -0.545658 -0.666465 -0.795674 -0.910232 -0.985601 --1 -0.938469 -0.795988 -0.578994 -0.304958 -1.67721e-05 0.304926; -#X coords 0 1 66 -1 200 140 1; -#X restore 17 -56 graph; -#X obj 23 135 loadbang; -#X obj 271 47 tabosc4~ waveform; -#X obj 270 21 sig~ 2000; -#X msg 23 165 \; waveform sinesum 64 0.8 0.3 0.3 0.3 0.1 \; waveform -normalize 1; -#X connect 1 0 3 0; -#X connect 2 0 1 0; -#X connect 7 0 10 0; -#X connect 8 0 2 0; -#X connect 9 0 8 0; diff --git a/examples/puredata/harmonic_spectrum.pd b/examples/puredata/harmonic_spectrum.pd deleted file mode 100644 index 9522217..0000000 --- a/examples/puredata/harmonic_spectrum.pd +++ /dev/null @@ -1,108 +0,0 @@ -#N canvas 621 238 587 354 10; -#X obj 82 127 xtract~ spectrum; -#N canvas 6 48 450 300 mag_spectrum 0; -#X obj 260 64 block~ 512; -#N canvas 0 0 450 300 (subpatch) 0; -#X array mag_spectrum 512 float 3; -#A 0 0.0212162 0.0317487 0.0195466 0.00561563 0.0177077 0.0476304 0.0567499 -0.0474959 0.0970338 0.464764 0.096619 0.0562304 0.0238859 0.0221252 -0.0281975 0.0124481 0.0234213 0.0308018 0.0182565 0.0118857 0.0086735 -0.0188852 0.0119291 0.0237176 0.00864544 0.00273517 0.0113407 0.0100331 -0.0382518 0.0213396 0.0296342 0.034342 0.0171451 0.00243189 0.0301973 -0.00739387 0.0278942 0.0198999 0.0173251 0.0225384 0.0042204 0.0186626 -0.0191895 0.0116634 0.00931694 0.00501582 0.012182 0.0301927 0.0167377 -0.0194199 0.0254657 0.0208484 0.0438904 0.030928 0.0123733 0.0220734 -0.0199979 0.028819 0.00481497 0.0136932 0.00975227 0.0256796 0.0157346 -0.040834 0.0247319 0.0333543 0.00981976 0.00128905 0.0108467 0.00859555 -0.00120924 0.0198812 0.00942567 0.0179 0.021585 0.0144289 0.0138407 -0.0259725 0.0088767 0.0189066 0.0241189 0.0123437 0.0110563 0.0110612 -0.0135812 0.0295776 0.00935764 0.00530153 0.0136921 0.00645618 0.00677527 -0.018981 0.00559285 0.0423402 0.012537 0.0196257 0.0107362 0.0244728 -0.0169689 0.00800423 0.0106661 0.00580486 0.00123392 0.0318564 0.00313052 -0.00918496 0.0148799 0.0215053 0.0103284 0.0101435 0.0159162 0.0265488 -0.0149968 0.0144774 0.0127121 0.0210075 0.0136251 0.0246422 0.0150687 -0.0125131 0.0238336 0.0144661 0.00459801 0.0176529 0.0196158 0.00860441 -0.02399 0.0125216 0.0132359 0.0217819 0.0122651 0.0233058 0.00750471 -0.0162637 0.00563749 0.0107775 0.021111 0.0161979 0.00453912 0.0148774 -0.000913515 0.0250208 0.0255661 0.0349255 0.0140773 0.0264259 0.00978363 -0.0128433 0.017953 0.0123747 0.000980419 0.0202137 0.0111122 0.0122572 -0.0150218 0.0198538 0.00786684 0.0152549 0.00976639 0.00464054 0.0141998 -0.00772205 0.016834 0.0153422 0.00997133 0.00674112 0.0190689 0.0255067 -0.0107735 0.0116028 0.0145695 0.0243072 0.0254179 0.00474025 0.00489552 -0.0260339 0.025168 0.0067304 0.0217401 0.00904745 0.0146951 0.0182503 -0.0392981 0.00691688 0.00454291 0.0212321 0.00856008 0.00406878 0.0208133 -0.0184339 0.0295088 0.0299841 0.0114197 0.00718674 0.00452769 0.0230214 -0.00951422 0.0362591 0.011827 0.0228309 0.0272509 0.0168917 0.0301141 -0.0192356 0.0161379 0.0236251 0.0141769 0.0320988 0.0151104 0.0143148 -0.0313421 0.0272517 0.0313192 0.0226451 0.0218267 0.0183534 0.00742306 -0.0236084 0.0220338 0.00740086 0.0283414 0.0325231 0.0465779 0.027643 -0.0240922 0.0164632 0.0113228 0.0164433 0.0194295 0.0161885 0.0152107 -0.0173802 0.024051 0.0108911 0.0118482 0.0144843 0.0158265 0.0159634 -0.0105952 0.0106542 0.0124575 0.0159426 0.0126567 0.00726532 0.0130271 -0.011397 0.00576796 0.0219027 0.0120067 0.0112131 0.0217665 0.028283 -0.00556188 0.0172272 0.0156255 0.00790093 0.00810658 0.0129488 0.0178136 -0.0131554 0.0221222 0.00680469 0.0248362 0.019694 0.00703206 0.0339999 -0.0136595 0.00676699 0.0151537 0.0263812 0.0226784 0.00493732 0.0295971 -0.0212905 0.0360165 0.0220007 0.0306554 0.0132068 0.0143121 0.0110527 -0.00200652 0.0119865 0.029585 0.0195924 0.00423938 0.0292942 0.0235783 -0.0149287 0.0091102 0.0132163 0.00536295 0.0112099 0.0160713 0.0266621 -0.0049689 0.0151439 0.0168654 0.0132658 0.0118611 0.0180696 0.0176023 -0.00712655 0.0239444 0.00829241 0.016034 0.00839455 0.0132304 0.0193391 -0.00969501 0.0108692 0.01659 0.026616 0.029016 0.00760763 0.00869712 -0.013781 0.0124679 0.0153336 0.0169436 0.0151282 0.00582287 0.0252088 -0.010132 0.0144077 0.0172376 0.0138607 0.0192887 0.0162585 0.0250082 -0.0124786 0.0213438 0.0185502 0.00461736 0.0107252 0.0246183 0.0199021 -0.0213024 0.0325369 0.0128834 0.0297772 0.0139391 0.0290136 0.00977331 -0.0293352 0.0223587 0.00683776 0.00774782 0.00868099 0.0177819 0.0501341 -0.0168349 0.0122174 0.0045685 0.00933541 0.0153631 0.0120776 0.0136674 -0.0110695 0.00526424 0.0223792 0.0189218 0.0324813 0.0175627 0.0103907 -0.00722242 0.0192809 0.0222755 0.0144299 0.0189361 0.00997853 0.0065123 -0.0109085 0.00674032 0.0146737 0.0185307 0.0158343 0.0202681 0.00576984 -0.0147357 0.0204028 0.00339465 0.020232 0.00719163 0.0106671 0.0111035 -0.0214937 0.0121637 0.0168017 0.00981358 0.0179859 0.0189836 0.00543421 -0.0183689 0.0268019 0.0143586 0.0221351 0.00688864 0.0237894 0.0253554 -0.02866 0.00769269 0.015072 0.00734027 0.020403 0.0248997 0.0108569 -0.0154023 0.00941389 0.0291191 0.00872522 0.0223672 0.00639403 0.021712 -0.0246656 0.00448177 0.0050129 0.0137407 0.0122352 0.0130276 0.0181434 -0.0239518 0.0052326 0.0193361 0.0226996 0.0202401 0.0208808 0.030179 -0.00866272 0.0413012 0.0268073 0.0105023 0.0168644 0.00408668 0.00292807 -0.0134017 0.0205693 0.0173767 0.0117562 0.00719525 0.00927211 0.027002 -0.0271098 0.0216011 0.00717236 0.0138263 0.00271252 0.0143244 0.00397278 -0.0219117 0.0104727 0.0199572 0.0140881 0.00060853 0.0142593 0.0227859 -0.0109915 0.0209464 0.0273022 0.0140469 0.0104995 0.00597412 0.00458115 -0.0301041 0.00698568 0.0164327 0.0147746 0.0181867 0.0160428 0.00350695 -0.0073609 0.016644 0.0147995 0.014512 0.0058076 0.0198532 0.0114418 -0.0141326 0.0116806 0.0179014 0.0186733 0.0171869 0.0219169 0.0151714 -0.00699651 0.023865 0.0292064 0.00678898 0.0329386 0.0143645 0.0170765 -0.0206896 0.0111348 0.0100621 0.0115056 0.015144 0.00661284 0.00584966 -0.0215877 0.0121954 0.0291166 0.0302916 0.0354529 0.0102541 0.00448918 -0.0112287 0.0154816 0.00960475 0.035809 0.0276429 0.0209137 0.0209784 -300.821; -#X coords 0 1 511 0 200 140 1; -#X restore 125 121 graph; -#X restore 245 43 pd mag_spectrum; -#X obj 82 162 tabsend~ mag_spectrum; -#X obj 244 15 block~ 1024; -#X obj 278 253 xtract~ peak_spectrum; -#X obj 255 277 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X obj 279 224 tabreceive~ mag_spectrum; -#X msg 453 223 list \$1; -#X obj 453 178 samplerate~; -#X obj 58 71 noise~; -#X obj 113 70 osc~ 440; -#X obj 453 198 / 1024; -#X obj 278 277 xtract~ harmonic_spectrum; -#X obj 278 307 print~; -#X obj 453 151 loadbang; -#X connect 0 0 2 0; -#X connect 4 0 12 0; -#X connect 5 0 13 0; -#X connect 6 0 4 0; -#X connect 7 0 4 1; -#X connect 8 0 11 0; -#X connect 9 0 0 0; -#X connect 10 0 0 0; -#X connect 11 0 7 0; -#X connect 12 0 13 0; -#X connect 14 0 8 0; diff --git a/examples/puredata/lpcc-test.pd b/examples/puredata/lpcc-test.pd deleted file mode 100644 index 607e846..0000000 --- a/examples/puredata/lpcc-test.pd +++ /dev/null @@ -1,57 +0,0 @@ -#N canvas 356 233 722 300 10; -#X obj 160 170 xtract~ autocorrelation; -#N canvas 0 0 450 300 graph1 0; -#X array lpcc 16 float 5; -#A 0 0 0 -0.827113 -0.827113 -0.827113 -0.485055 0.314974 0.657032 -0.810476 0.396513 0.0440753 -0.630112 -0.9456 -0.887411 -1.12995 0.596854 -; -#X coords 0 16 15 -16 200 140 1; -#X restore 458 97 graph; -#X obj 149 34 noise~; -#N canvas 9 103 450 300 lpc 0; -#X obj 323 25 block~ 32; -#X obj 140 52 inlet~; -#X obj 140 113 xtract~ lpc; -#N canvas 237 125 450 300 lpcc 0; -#X obj 26 130 xtract~ lpcc; -#N canvas 0 0 450 300 graph1 0; -#X array lpc 16 float 5; -#A 0 -1.03207 -1.03207 -1.03207 -21.8757 -21.8757 -21.8757 -21.8757 --0.391539 -0.391539 -0.391539 -0.391539 0.448536 0.448536 0.448536 -0.448536 0.516603; -#X coords 0 16 15 -16 200 140 1; -#X restore 219 37 graph; -#X obj 23 12 block~ 16; -#X obj 26 51 tabreceive~ lpc; -#X msg 95 107 list 16; -#X obj 24 196 tabsend~ lpcc; -#X obj 95 85 loadbang; -#X connect 0 0 5 0; -#X connect 3 0 0 0; -#X connect 4 0 0 1; -#X connect 6 0 4 0; -#X restore 298 172 pd lpcc; -#X obj 137 220 tabsend~ lpc; -#X obj 139 152 a_blockswap~ 32; -#X connect 1 0 2 0; -#X connect 2 0 5 0; -#X connect 5 0 4 0; -#X restore 160 218 pd lpc; -#X obj 31 52 a_hann 16; -#X obj 31 25 loadbang; -#X obj 98 23 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1 --1; -#X obj 156 139 *~; -#X obj 27 -41 block~ 16 4; -#X obj 265 81 *~ 0.4; -#X obj 148 87 *~ 0.1; -#X obj 266 46 osc~ 1000; -#X connect 0 0 3 0; -#X connect 2 0 10 0; -#X connect 4 0 7 0; -#X connect 5 0 4 0; -#X connect 6 0 4 0; -#X connect 7 0 0 0; -#X connect 9 0 7 1; -#X connect 10 0 7 1; -#X connect 11 0 9 0; diff --git a/examples/puredata/regression-test.pd b/examples/puredata/regression-test.pd deleted file mode 100644 index daf8e17..0000000 --- a/examples/puredata/regression-test.pd +++ /dev/null @@ -1,84 +0,0 @@ -#N canvas 520 223 894 462 10; -#X obj 168 31 noise~; -#X obj 168 61 xtract~ spectrum; -#X obj 72 106 xtract~ irregularity_j; -#X obj 95 142 xtract~ irregularity_k; -#X obj 112 206 xtract~ tristimulus_1; -#X obj 145 269 xtract~ tristimulus_2; -#X obj 166 327 xtract~ tristimulus_3; -#X obj 315 87 xtract~ spectral_mean; -#X obj 311 140 xtract~ spectral_variance; -#X obj 326 194 xtract~ spectral_standard_deviation; -#X obj 375 245 xtract~ spectral_kurtosis; -#X floatatom 378 281 5 0 0 0 - - -; -#X floatatom 88 252 5 0 0 0 - - -; -#X floatatom 116 317 5 0 0 0 - - -; -#X floatatom 156 376 5 0 0 0 - - -; -#X floatatom 57 197 5 0 0 0 - - -; -#X floatatom 107 179 5 0 0 0 - - -; -#X floatatom 666 292 5 0 0 0 - - -; -#X obj 603 98 xtract~ mean; -#X obj 599 151 xtract~ variance; -#X obj 614 205 xtract~ standard_deviation; -#X obj 663 256 xtract~ kurtosis; -#X obj 430 365 xtract~ smoothness; -#X floatatom 436 400 5 0 0 0 - - -; -#X msg 696 129 list \$1; -#X msg 762 172 list \$1; -#X msg 728 230 list \$1; -#X msg 505 214 list \$1; -#X msg 375 168 list \$1; -#X msg 465 116 list \$1; -#X obj 611 406 xtract~ loudness; -#X floatatom 612 430 5 0 0 0 - - -; -#X obj 649 360 xtract~ inharmonicity; -#X floatatom 658 385 5 0 0 0 - - -; -#X floatatom 750 327 5 0 0 0 - - -; -#X obj 195 404 xtract~ autocorrelation; -#X obj 257 445 xtract~ bark_coefficients; -#X obj 49 437 xtract~ peak_spectrum; -#X obj 486 438 xtract~ mfcc; -#X obj 28 24 block~ 1024; -#X connect 0 0 1 0; -#X connect 0 0 18 0; -#X connect 0 0 19 0; -#X connect 0 0 20 0; -#X connect 0 0 21 0; -#X connect 1 0 2 0; -#X connect 1 0 3 0; -#X connect 1 0 4 0; -#X connect 1 0 7 0; -#X connect 1 0 8 0; -#X connect 1 0 9 0; -#X connect 1 0 10 0; -#X connect 1 0 5 0; -#X connect 1 0 6 0; -#X connect 1 0 22 0; -#X connect 1 0 30 0; -#X connect 1 0 32 0; -#X connect 1 0 35 0; -#X connect 1 0 36 0; -#X connect 1 0 37 0; -#X connect 1 0 38 0; -#X connect 2 0 15 0; -#X connect 3 0 16 0; -#X connect 4 0 12 0; -#X connect 5 0 13 0; -#X connect 6 0 14 0; -#X connect 7 0 29 0; -#X connect 8 0 28 0; -#X connect 9 0 27 0; -#X connect 10 0 11 0; -#X connect 18 0 24 0; -#X connect 19 0 25 0; -#X connect 20 0 26 0; -#X connect 21 0 17 0; -#X connect 22 0 23 0; -#X connect 24 0 19 1; -#X connect 25 0 20 1; -#X connect 26 0 21 1; -#X connect 27 0 10 1; -#X connect 28 0 9 1; -#X connect 29 0 8 1; -#X connect 30 0 31 0; -#X connect 32 0 33 0; diff --git a/examples/puredata/simple-example.pd b/examples/puredata/simple-example.pd deleted file mode 100644 index 80e8761..0000000 --- a/examples/puredata/simple-example.pd +++ /dev/null @@ -1,26 +0,0 @@ -#N canvas 5 48 450 300 10; -#X obj 154 42 osc~ 440; -#X floatatom 154 180 8 0 0 0 - - -; -#N canvas 619 86 450 300 spectral_mean 1; -#X obj 144 80 xtract~ spectrum; -#X obj 346 21 block~ 1024; -#X obj 145 47 inlet~; -#X obj 145 190 outlet; -#X obj 145 129 xtract~ spectral_centroid; -#X msg 269 57 list \$1; -#X msg 270 11 44100; -#X obj 270 33 / 1024; -#X obj 67 130 print~; -#X obj 73 104 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; -#X connect 0 0 4 0; -#X connect 0 0 8 0; -#X connect 2 0 0 0; -#X connect 4 0 3 0; -#X connect 5 0 0 1; -#X connect 6 0 7 0; -#X connect 7 0 5 0; -#X connect 9 0 8 0; -#X restore 154 115 pd spectral_mean; -#X connect 0 0 2 0; -#X connect 2 0 1 0; diff --git a/examples/puredata/simple-test.pd b/examples/puredata/simple-test.pd deleted file mode 100644 index dce728c..0000000 --- a/examples/puredata/simple-test.pd +++ /dev/null @@ -1,8 +0,0 @@ -#N canvas 642 248 670 289 10; -#X obj 192 63 osc~ 440; -#X floatatom 194 187 10 0 0 0 - - -; -#X obj 193 94 *~ 0.3; -#X obj 193 137 xtract~ f0; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 1 0; diff --git a/examples/puredata/spectrum-512-test.pd b/examples/puredata/spectrum-512-test.pd deleted file mode 100644 index fe22e23..0000000 --- a/examples/puredata/spectrum-512-test.pd +++ /dev/null @@ -1,8 +0,0 @@ -#N canvas 5 48 450 300 10; -#X obj 127 77 noise~; -#X obj 262 59 loadbang; -#X msg 262 86 list 86.1328; -#X obj 127 112 xtract~ spectrum 64; -#X connect 0 0 3 0; -#X connect 1 0 2 0; -#X connect 2 0 3 1; diff --git a/examples/puredata/subband_mean.pd b/examples/puredata/subband_mean.pd deleted file mode 100644 index 332b3d2..0000000 --- a/examples/puredata/subband_mean.pd +++ /dev/null @@ -1,102 +0,0 @@ -#N canvas 493 51 587 478 10; -#X obj 82 127 xtract~ spectrum; -#N canvas 6 48 450 300 mag_spectrum 0; -#X obj 260 64 block~ 512; -#N canvas 0 0 450 300 (subpatch) 0; -#X array mag_spectrum 512 float 3; -#A 0 0.0132486 0.0096563 0.0354424 0.0165249 0.0339139 0.0245265 0.0429209 -0.0604935 0.0858024 0.472867 0.131911 0.0710302 0.0320982 0.0389981 -0.0272274 0.015468 0.0195354 0.0195954 0.0188111 0.0207361 0.0166347 -0.00157469 0.02206 0.0104267 0.0070746 0.0295359 0.0121162 0.013655 -0.0102867 0.00591679 0.00586671 0.00641669 0.0105255 0.0120749 0.00294434 -0.013461 0.00875645 0.0157844 0.00649163 0.0150134 0.0135169 0.0191429 -0.0282347 0.0241475 0.0185751 0.00689928 0.022662 0.00670788 0.00318354 -0.00283897 0.0142583 0.017543 0.00907015 0.0164521 0.0223336 0.02503 -0.0121266 0.0170551 0.0284856 0.0271476 0.00775067 0.00155745 0.0197414 -0.0150477 0.0279912 0.0224467 0.00407337 0.00497963 0.000851764 0.0161942 -0.0176389 0.0160251 0.0175218 0.027366 0.00792114 0.0222662 0.0160268 -0.0279591 0.0112953 0.00409087 0.00645786 0.015363 0.0293401 0.0105894 -0.00844756 0.0175758 0.0215718 0.0200431 0.00260135 0.0101493 0.0200218 -0.00456712 0.0278158 0.0215603 0.0262786 0.0129843 0.00468684 0.024167 -0.0149199 0.0101847 0.00482173 0.00959639 0.0325585 0.0291854 0.0138181 -0.0169087 0.0236841 0.0291382 0.0199014 0.00511631 0.00370711 0.0101142 -0.0120038 0.00115485 0.0154999 0.00297503 0.0140602 0.0191407 0.0210018 -0.0322096 0.0224205 0.0206845 0.0191659 0.031921 0.0151202 0.0168541 -0.036274 0.0229901 0.0349309 0.0208622 0.0131437 0.00933729 0.0126362 -0.025394 0.00901058 0.01157 0.0131736 0.00677092 0.0194996 0.0173273 -0.00325973 0.0124627 0.0110635 0.0167556 0.0136908 0.0065692 0.0262649 -0.0225311 0.0235114 0.0197293 0.00282572 0.0240237 0.00657686 0.0173891 -0.0257314 0.012755 0.0217556 0.00329426 0.0158449 0.0240496 0.0106366 -0.022061 0.00708543 0.0209552 0.00957124 0.0102439 0.016452 0.00943987 -0.0137701 0.0165189 0.0184722 0.0335198 0.023159 0.0140537 0.0137668 -0.0249716 0.0252517 0.0222753 0.0196876 0.00917165 0.0231789 0.0223262 -0.0130253 0.0143873 0.0174217 0.0262216 0.0221904 0.00554891 0.0169622 -0.0214176 0.00636145 0.0190085 0.00084364 0.00991013 0.00538487 0.0132557 -0.034742 0.00783582 0.0329481 0.00777087 0.0132578 0.0246518 0.00381398 -0.0136186 0.0101923 0.0105305 0.0135506 0.00659576 0.00948354 0.0244682 -0.00372209 0.0144119 0.00303586 0.0193436 0.0127196 0.0248709 0.0018994 -0.0102549 0.00929058 0.0222578 0.0290115 0.0211259 0.0397477 0.0200812 -0.0044044 0.0132484 0.0407253 0.00666307 0.0303175 0.014019 0.00897817 -0.00528597 0.0267464 0.014286 0.0215917 0.0260188 0.0217563 0.00233073 -0.01223 0.0020918 0.00739707 0.00231818 0.0237471 0.0197745 0.0138808 -0.00300929 0.0166336 0.0104104 0.0131831 0.00639908 0.00556837 0.0145624 -0.00884734 0.023722 0.0139918 0.0214095 0.0136722 0.0246529 0.0212282 -0.0214965 0.0114811 0.0181338 0.0193226 0.0165735 0.0138509 0.0193118 -0.00444871 0.0119447 0.00337634 0.0148758 0.0187246 0.0244031 0.010354 -0.0146917 0.0135728 0.0135919 0.0270935 0.00721325 0.0254225 0.0171227 -0.0239136 0.00854048 0.00875449 0.0127878 0.0253363 0.0114877 0.0122164 -0.0159164 0.0182439 0.0100041 0.00461047 0.0245388 0.0189458 0.00619877 -0.0248993 0.00963699 0.0249874 0.0271515 0.0145729 0.0279523 0.027924 -0.0220959 0.0262779 0.015607 0.00716239 0.012087 0.0337037 0.00516229 -0.0170121 0.0336761 0.00650737 0.00497518 0.02043 0.0105242 0.00488026 -0.0104467 0.00818958 0.00628406 0.0211596 0.0165034 0.0182923 0.0199196 -0.0249672 0.0164662 0.0214767 0.0120562 0.0322599 0.00383154 0.00921745 -0.00146418 0.0356547 0.0103786 0.0165492 0.0304809 0.0131255 0.0167945 -0.00558382 0.0238359 0.0175395 0.00780578 0.0346175 0.00236843 0.0255091 -0.0201751 0.0108775 0.0210824 0.0209226 0.0320313 0.0437274 0.00560051 -0.0344518 0.00791858 0.0208586 0.0286015 0.0248276 0.0237304 0.0412748 -0.0120705 0.0241371 0.00511147 0.0317298 0.0139929 0.028099 0.0103861 -0.00891256 0.00822179 0.016315 0.0248265 0.0213948 0.0239172 0.0166187 -0.0310473 0.0186244 0.0166212 0.0366136 0.0136573 0.0269544 0.010431 -0.0249531 0.0120786 0.0109345 0.0123368 0.0151866 0.0357349 0.00463059 -0.0118539 0.00970646 0.00946582 0.00969734 0.00891857 0.00890028 0.0202631 -0.0215117 0.0111571 0.0250767 0.0209911 0.0198019 0.0093692 0.0131443 -0.00748891 0.024563 0.0247875 0.0230017 0.00794473 0.00888343 0.0217427 -0.0343637 0.0287685 0.00968487 0.0498302 0.0171984 0.0315536 0.00588345 -0.010743 0.0126087 0.0182915 0.00907374 0.00443379 0.0379275 0.023097 -0.0160588 0.00775962 0.0344518 0.0164484 0.0376125 0.0172285 0.0132559 -0.029612 0.0116543 0.0273187 0.023721 0.0046918 0.0172711 0.00766218 -0.0112108 0.0180092 0.0278611 0.0190289 0.0202484 0.0127141 0.0276473 -0.0169104 0.028993 0.00897726 0.00712007 0.0122292 0.00820719 0.0168334 -0.00864513 0.0127985 0.0237389 0.0120437 0.0212306 0.0304613 0.0189116 -0.0197339 0.0212744 0.0151605 0.0141882 0.0195768 0.00291933 0.0358095 -0.0293726 0.0169182 0.0103468 0.0135299 0.0266578 0.0154398 0.00245885 -0.00794718 0.0127344 0.0298125 0.00820393 0.00626316 0.0170656 0.0230811 -0.00259497 0.0173437 0.00922873 0.0205893 0.0209727 0.00431716 0.00870416 -0.00315811 0.0163018 0.0292532 0.0154488 0.0141043 0.0250745 0.00961138 -0.0142033 0.010861 0.0187522 0.0241866 0.016184 0.0184565 0.0162928 -0.011523 0.0141778 0.0157446 0.0228784 0.0380396 0.0176535 0.0102128 -0.0272628 0.0115185 0.0148983 0.0233291 0.00915212 0.0157429 0.0298723 -101.909; -#X coords 0 1 511 0 200 140 1; -#X restore 125 121 graph; -#X restore 245 43 pd mag_spectrum; -#X obj 82 162 tabsend~ mag_spectrum; -#X obj 244 15 block~ 1024; -#X obj 279 224 tabreceive~ mag_spectrum; -#X obj 58 71 noise~; -#X obj 113 70 osc~ 440; -#X obj 278 307 print~; -#X obj 453 188 loadbang; -#X obj 278 266 xtract~ subbands 1024; -#X obj 118 230 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X msg 453 223 list 0 8 0 16; -#X connect 0 0 2 0; -#X connect 4 0 9 0; -#X connect 5 0 0 0; -#X connect 6 0 0 0; -#X connect 8 0 11 0; -#X connect 9 0 7 0; -#X connect 10 0 7 0; -#X connect 11 0 9 1; diff --git a/examples/puredata/subframe-test.pd b/examples/puredata/subframe-test.pd deleted file mode 100644 index df1b0f8..0000000 --- a/examples/puredata/subframe-test.pd +++ /dev/null @@ -1,131 +0,0 @@ -#N canvas 667 51 613 639 10; -#X obj 263 -160 xtract~ subframe windowed 64; -#X obj 473 -126 tabsend~ windowed; -#N canvas 0 0 450 300 (subpatch) 0; -#X array windowed 64 float 5; -#A 0 0 -0.00539658 -0.0365654 -0.0889249 -0.119512 -0.0710801 0.0849429 -0.314014 0.517949 0.575413 0.405857 0.0231818 -0.452978 -0.839845 -0.971146 --0.775526 -0.314544 0.24085 0.684547 0.864859 0.746131 0.414296 0.0268876 --0.264158 -0.377502 -0.324844 -0.185212 -0.0511399 0.0208516 0.0292007 -0.0100387 7.11504e-15 0 0.000585724 -0.0198747 -0.079146 -0.154996 --0.187268 -0.111695 0.0928308 0.373338 0.611529 0.674151 0.482276 0.0628278 --0.447978 -0.856285 -0.995151 -0.80163 -0.347457 0.191996 0.616082 -0.785785 0.677697 0.381243 0.044994 -0.197483 -0.283735 -0.235181 -0.126292 --0.0330596 0.00773548 0.00706581 7.42552e-15; -#X coords 0 1 63 -1 200 140 1; -#X restore 46 -552 graph; -#X obj 264 -125 xtract~ subframe spectrum 64; -#N canvas 0 0 450 300 (subpatch) 0; -#X array sf_mags1 16 float 5; -#A 0 0.00796987 0.144169 0.24068 0.109756 0.00127541 0.000110428 0.000122432 -0.000120516 0.000102996 8.516e-05 6.88438e-05 5.77259e-05 4.7595e-05 -4.13114e-05 3.56295e-05 1.33207e-06; -#X coords 0 1 15 -1 200 140 1; -#X restore 261 -551 graph; -#N canvas 0 0 450 300 (subpatch) 0; -#X array sf_mags2 32 float 5; -#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00902428 0.143577 0.241043 0.109515 -0.001105 0.000101461 0.000191993 0.000175226 0.000143044 0.000113519 -8.72515e-05 6.69791e-05 4.84639e-05 3.34907e-05 1.99719e-05 2.52196e-07 -; -#X coords 0 1 31 -1 200 140 1; -#X restore 259 -389 graph; -#N canvas 0 0 450 300 (subpatch) 0; -#X array both 35 float 5; -#A 0 0.00796987 0.144169 0.24068 0.109756 0.00127541 0.000110428 0.000122432 -0.000120516 0.000102996 8.516e-05 6.88438e-05 5.77259e-05 4.7595e-05 -4.13114e-05 3.56295e-05 1.33207e-06 0.00902428 0.143577 0.241043 0.109515 -0.001105 0.000101461 0.000191993 0.000175226 0.000143044 0.000113519 -8.72515e-05 6.69791e-05 4.84639e-05 3.34907e-05 1.99719e-05 2.52196e-07 -0 0 0; -#X coords 0 1 34 -1 200 140 1; -#X restore 46 -393 graph; -#N canvas 18 175 447 500 get_mags 0; -#X obj 71 265 +~; -#X obj 72 233 tabreceive~ sf_mags1; -#X obj 221 233 tabreceive~ sf_mags2; -#X obj 101 30 tabsend~ sf_mags1; -#X obj 70 86 tabsend~ temp; -#X obj 69 124 tabreceive~ temp; -#X obj 70 175 tabsend~ sf_mags2; -#X obj 70 302 outlet~; -#X obj 70 -10 inlet~; -#X obj 70 59 a_blockswap~ 64; -#X obj 69 151 a_blockswap~ 32; -#N canvas 0 0 450 300 (subpatch) 0; -#X array temp 16 float 5; -#A 0 0.00902428 0.143577 0.241043 0.109515 0.001105 0.000101461 0.000191993 -0.000175226 0.000143044 0.000113519 8.72515e-05 6.69791e-05 4.84639e-05 -3.34907e-05 1.99719e-05 2.52196e-07; -#X coords 0 1 15 -1 200 140 1; -#X restore 226 -6 graph; -#X connect 0 0 7 0; -#X connect 1 0 0 0; -#X connect 2 0 0 1; -#X connect 5 0 10 0; -#X connect 8 0 3 0; -#X connect 8 0 9 0; -#X connect 9 0 4 0; -#X connect 10 0 6 0; -#X restore 263 -94 pd get_mags; -#N canvas 0 0 450 300 (subpatch) 0; -#X array diff 16 float 5; -#A 0 -0.00105441 0.000592396 -0.000363603 0.000240721 0.00017041 8.96674e-06 --6.95604e-05 -5.47096e-05 -4.00485e-05 -2.83591e-05 -1.84077e-05 -9.25315e-06 --8.68906e-07 7.82074e-06 1.56576e-05 1.07988e-06; -#X coords 0 1 15 -1 200 140 1; -#X restore 46 -234 graph; -#N canvas 6 433 450 300 diff 0; -#X obj 134 136 tabsend~ diff; -#X obj 134 49 tabreceive~ both; -#X obj 135 78 xtract~ difference_vector 32; -#X obj 348 10 block~ 32; -#X connect 1 0 2 0; -#X connect 2 0 0 0; -#X restore 260 -43 pd diff; -#N canvas 3 50 450 300 flux 0; -#X obj 143 17 tabreceive~ diff; -#X obj 371 -13 block~ 16; -#X obj 144 53 xtract~ flux 16; -#X obj 144 90 outlet; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X restore 262 -16 pd flux; -#X obj 262 -70 tabsend~ both; -#N canvas 9 100 467 310 source 0; -#X obj 162 -117 noise~; -#X obj 100 -40 *~; -#X obj 105 140 hsl 100 10 0 1 0 0 vol vol-set empty -2 -6 0 10 -204786 --1 -1 9900 1; -#X msg 212 -58 1; -#X obj 115 -94 r vol; -#X obj 161 -40 *~; -#X obj 212 -89 t b f; -#X obj 225 -30 -; -#X obj 101 20 outlet~; -#X text 111 118 noise <-> sine; -#X obj 336 -87 loadbang; -#X obj 100 -115 osc~ 4000; -#X msg 336 -61 \; vol 1 \; vol-set 1; -#X connect 0 0 5 0; -#X connect 1 0 8 0; -#X connect 3 0 7 0; -#X connect 4 0 1 1; -#X connect 4 0 6 0; -#X connect 5 0 8 0; -#X connect 6 0 3 0; -#X connect 6 1 7 1; -#X connect 7 0 5 1; -#X connect 10 0 12 0; -#X connect 11 0 1 0; -#X coords 0 -1 1 1 110 60 1 100 100; -#X restore 263 -231 pd source; -#X floatatom 262 40 5 0 0 0 spectral_flux - -; -#X obj 262 7 a_bavg 128; -#X connect 0 0 1 0; -#X connect 0 0 3 0; -#X connect 3 0 7 0; -#X connect 7 0 11 0; -#X connect 10 0 14 0; -#X connect 12 0 0 0; -#X connect 14 0 13 0; diff --git a/examples/puredata/tonality_from_subbands.pd b/examples/puredata/tonality_from_subbands.pd deleted file mode 100644 index 3665bad..0000000 --- a/examples/puredata/tonality_from_subbands.pd +++ /dev/null @@ -1,160 +0,0 @@ -#N canvas 493 51 587 478 10; -#X obj 82 212 xtract~ spectrum; -#N canvas 9 75 450 300 mag_spectrum 0; -#X obj 260 64 block~ 512; -#N canvas 0 0 450 300 (subpatch) 0; -#X array mag_spectrum 512 float 3; -#A 0 0.00791511 0.00796441 0.00804782 0.00816725 0.00832556 0.00852671 -0.00877601 0.00908054 0.00944968 0.00989593 0.0104362 0.0110935 0.0119005 -0.0129037 0.0141728 0.0158165 0.0180132 0.0210785 0.0256274 0.0330392 -0.0471787 0.0845833 0.462538 0.12868 0.0556718 0.0352146 0.0256003 -0.0200227 0.0163861 0.013831 0.0119397 0.0104852 0.00933302 0.00839885 -0.00762689 0.00697887 0.00642763 0.00595337 0.00554132 0.00518025 0.00486145 -0.00457808 0.00432469 0.00409689 0.00389113 0.00370479 0.00353334 0.00337798 -0.00323515 0.00310359 0.00298209 0.00286958 0.00276511 0.00266788 0.00257719 -0.00249241 0.00241301 0.00233849 0.00226844 0.00220248 0.00214026 0.00208149 -0.00202589 0.00197323 0.00192327 0.00187583 0.00183072 0.00178779 0.00174693 -0.00170751 0.00167039 0.00163477 0.00160066 0.00156795 0.00153673 0.00150668 -0.00147784 0.00145013 0.00142347 0.00139785 0.00137317 0.00134938 0.00132645 -0.00130433 0.00128297 0.00126234 0.0012424 0.00122312 0.00120446 0.0011864 -0.00116891 0.00115197 0.00113544 0.00111958 0.00110411 0.0010891 0.00107452 -0.00106035 0.00104659 0.00103319 0.00102017 0.00100749 0.000995155 -0.000983141 0.000971438 0.000960027 0.000948909 0.000938068 0.000927495 -0.000917176 0.000907107 0.000897275 0.000887676 0.000878296 0.000869136 -0.000860182 0.000851426 0.000842866 0.000834491 0.0008263 0.000818288 -0.000810442 0.000802759 0.000795238 0.000787864 0.00078067 0.000773593 -0.000766665 0.000759872 0.000753206 0.000746684 0.000740281 0.000733997 -0.000727835 0.000721787 0.00071585 0.000710022 0.000704302 0.000698687 -0.000693163 0.000687744 0.00068242 0.000677189 0.000672046 0.000666989 -0.000662008 0.000657152 0.000652346 0.000647625 0.000642983 0.00063827 -0.000633902 0.00062948 0.00062513 0.000620847 0.00061663 0.00061248 -0.000608394 0.000604371 0.00060041 0.000596508 0.000592662 0.000588881 -0.000585149 0.000581476 0.000577854 0.000574287 0.000570768 0.0005673 -0.000563885 0.000560517 0.000557198 0.000553921 0.000550691 0.000547506 -0.000544363 0.00054127 0.000538212 0.000535196 0.000532221 0.000529285 -0.000526391 0.000523531 0.000520713 0.00051793 0.000515163 0.00051246 -0.000509783 0.00050714 0.000504528 0.000501949 0.000499401 0.000496887 -0.000494399 0.000491941 0.000489499 0.000486984 0.000484886 0.00048249 -0.000480167 0.000477879 0.00047517 0.000473408 0.000471204 0.000469028 -0.000466878 0.000464756 0.000462657 0.000460551 0.000458529 0.000456502 -0.000454496 0.000452516 0.000450556 0.000448618 0.000446703 0.000444806 -0.000442933 0.000441081 0.000439249 0.000437435 0.000435644 0.000433869 -0.000432115 0.00043038 0.000428663 0.000426967 0.000425283 0.000423621 -0.000421977 0.000420346 0.000418718 0.000417151 0.000415575 0.000414008 -0.000412461 0.000410933 0.000409421 0.000407924 0.000406438 0.00040497 -0.000403515 0.000402073 0.000400648 0.000399229 0.000397818 0.000396404 -0.000394843 0.000394005 0.000392514 0.000391154 0.000389825 0.000388485 -0.00038723 0.000385942 0.000384692 0.000383438 0.000382193 0.000380966 -0.000379752 0.000378546 0.000377355 0.000376173 0.000375004 0.000373846 -0.000372698 0.000371564 0.000370438 0.000369319 0.000368222 0.000367128 -0.000366044 0.00036497 0.000363896 0.000362854 0.000361811 0.000360777 -0.000359753 0.000358738 0.000357735 0.000356738 0.000355751 0.000354775 -0.000353804 0.000352844 0.000351894 0.000350951 0.000350019 0.000349093 -0.000348178 0.000347267 0.000346367 0.000345476 0.000344592 0.000343716 -0.000342849 0.000341989 0.000341133 0.000340284 0.000339464 0.000338628 -0.000337809 0.000336992 0.000336174 0.000335386 0.000334592 0.000333804 -0.000333026 0.000332255 0.000331489 0.000330732 0.000329979 0.000329234 -0.000328496 0.000327764 0.000327041 0.000326322 0.000325609 0.000324903 -0.000324195 0.000323522 0.000322828 0.000322148 0.000321469 0.000320755 -0.000320146 0.000319485 0.000318837 0.000318193 0.000317549 0.000316917 -0.000316288 0.000315666 0.000315051 0.000314437 0.000313833 0.000313232 -0.000312637 0.000312049 0.000311464 0.000310884 0.000310312 0.000309744 -0.000309181 0.000308621 0.000308068 0.00030752 0.000306974 0.00030644 -0.000305907 0.000305374 0.000304852 0.000304332 0.000303818 0.00030331 -0.000302803 0.000302303 0.000301806 0.000301317 0.000300826 0.000300345 -0.000299868 0.000299394 0.000298923 0.000298458 0.000297995 0.000297538 -0.000297083 0.000296631 0.000296177 0.000295711 0.000295329 0.000294857 -0.000294385 0.000293858 0.00029202 0.00029358 0.000292995 0.000292537 -0.000292112 0.000291698 0.000291297 0.000290902 0.00029051 0.000290124 -0.000289743 0.000289366 0.000288996 0.000288627 0.000288263 0.0002879 -0.000287544 0.000287195 0.000286843 0.000286509 0.000286161 0.000285818 -0.000285489 0.000285158 0.000284832 0.000284511 0.000284184 0.000283871 -0.000283558 0.00028325 0.000282946 0.000282636 0.000282341 0.000282046 -0.000281753 0.000281465 0.000281177 0.000280893 0.000280613 0.000280336 -0.000280061 0.000279788 0.000279522 0.000279243 0.000278967 0.000278676 -0.000278261 0.000278674 0.000278138 0.000277848 0.000277583 0.000277294 -0.000277122 0.000276878 0.000276643 0.000276415 0.000276191 0.000275971 -0.000275756 0.00027554 0.000275331 0.000275124 0.000274919 0.000274721 -0.000274521 0.000274329 0.000274132 0.00027394 0.000273764 0.00027358 -0.000273397 0.000273221 0.000273038 0.000272878 0.000272708 0.000272543 -0.000272381 0.000272217 0.000272063 0.000271911 0.000271758 0.00027161 -0.000271463 0.00027132 0.000271182 0.000271044 0.00027091 0.000270778 -0.000270653 0.000270522 0.0002704 0.000270284 0.000270164 0.000270048 -0.000269937 0.00026983 0.000269723 0.00026963 0.000269475 0.000269405 -0.000269311 0.00026922 0.000269133 0.000269041 0.000268957 0.000268874 -0.000268794 0.000268718 0.000268642 0.00026857 0.000268503 0.000268438 -0.000268366 0.000268309 0.000268254 0.000268193 0.000268139 0.000268089 -0.000268038 0.000268001 0.000267953 0.000267913 0.000267873 0.000267822 -0.000267814 0.000267781 0.000267753 0.000267727 0.000267703 0.000267684 -0.000267668 0.000267654 0.000267642 0.000267632 0.000267626 0.000267624 -0.0751003; -#X coords 0 1 511 0 200 140 1; -#X restore 125 121 graph; -#X restore 245 43 pd mag_spectrum; -#X obj 82 247 tabsend~ mag_spectrum; -#X obj 244 15 block~ 1024; -#X obj 82 46 noise~; -#N canvas 9 100 450 653 tonality 0; -#N canvas 0 0 450 300 (subpatch) 0; -#X array subbands 8 float 5; -#A 0 0.459222 0.00349705 0.00161501 0.00109469 0.000855802 0.000726442 -0.000653362 0; -#X coords 0 1 7 -1 200 140 1; -#X restore 35 -128 graph; -#X obj 60 73 tabreceive~ subbands; -#X obj 366 -129 block~ 8; -#X obj 61 127 xtract~ flatness 8; -#X msg 173 200 list \$1; -#X obj 30 227 xtract~ flatness_db 8; -#X obj 35 283 xtract~ tonality 8; -#X msg 156 257 list \$1; -#X obj 37 353 outlet; -#X connect 1 0 3 0; -#X connect 3 0 4 0; -#X connect 4 0 5 1; -#X connect 5 0 7 0; -#X connect 6 0 8 0; -#X connect 7 0 6 1; -#X restore 282 354 pd tonality; -#X floatatom 282 414 5 0 0 0 - - -; -#X obj 82 186 *~ 0; -#X obj 122 186 *~ 0; -#X obj 144 120 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 --1 -1 12700 1; -#N canvas 3 50 450 300 xfade 0; -#X obj 183 139 -; -#X obj 183 170 outlet; -#X obj 183 30 inlet; -#X obj 272 175 outlet; -#X obj 183 87 t a a; -#X msg 183 116 1 \$1; -#X obj 183 58 / 127; -#X connect 0 0 1 0; -#X connect 2 0 6 0; -#X connect 4 0 5 0; -#X connect 4 1 3 0; -#X connect 5 0 0 0; -#X connect 6 0 4 0; -#X restore 141 145 pd xfade; -#N canvas 262 411 450 300 subbands 0; -#X obj 89 114 tabreceive~ mag_spectrum; -#X obj 263 78 loadbang; -#X obj 88 197 tabsend~ subbands; -#X obj 362 28 block~ 512; -#X obj 88 156 xtract~ subbands 512; -#X msg 263 113 list 35 8 1 0; -#X connect 0 0 4 0; -#X connect 1 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 1; -#X restore 84 297 pd subbands; -#X obj 122 77 osc~ 1000; -#X connect 0 0 2 0; -#X connect 4 0 7 0; -#X connect 5 0 6 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X connect 9 0 10 0; -#X connect 10 0 7 1; -#X connect 10 1 8 1; -#X connect 12 0 8 0; diff --git a/examples/puredata/xtract/a_bavg.pd b/examples/puredata/xtract/a_bavg.pd deleted file mode 100644 index 38c8c71..0000000 --- a/examples/puredata/xtract/a_bavg.pd +++ /dev/null @@ -1,36 +0,0 @@ -#N canvas 0 0 450 300 10; -#X obj 140 183 +; -#X obj 243 216 f; -#X obj 242 124 f; -#X obj 275 124 + 1; -#X msg 244 193 0; -#X obj 175 223 f; -#X obj 175 245 / \$1; -#X obj 242 147 % \$1; -#X obj 319 172 f \$1; -#X obj 319 192 - 1; -#X obj 243 170 sel; -#X obj 319 146 loadbang; -#X obj 161 60 inlet; -#X obj 165 84 t b f; -#X obj 175 271 outlet; -#X text 28 12 Averages a series of N numbers where N is given by the -first arument (works in blocks); -#X connect 0 0 1 0; -#X connect 0 0 5 1; -#X connect 1 0 0 1; -#X connect 2 0 3 0; -#X connect 2 0 7 0; -#X connect 3 0 2 1; -#X connect 4 0 1 0; -#X connect 5 0 6 0; -#X connect 6 0 14 0; -#X connect 7 0 10 0; -#X connect 8 0 9 0; -#X connect 9 0 10 1; -#X connect 10 0 4 0; -#X connect 10 0 5 0; -#X connect 11 0 8 0; -#X connect 12 0 13 0; -#X connect 13 0 2 0; -#X connect 13 1 0 0; diff --git a/examples/puredata/xtract/a_blockswap~.pd b/examples/puredata/xtract/a_blockswap~.pd deleted file mode 100644 index 65dbd10..0000000 --- a/examples/puredata/xtract/a_blockswap~.pd +++ /dev/null @@ -1,43 +0,0 @@ -#N canvas 415 243 512 595 10; -#X obj 141 161 samplerate~; -#X obj 141 401 phasor~; -#X obj 23 10 inlet~; -#X obj 140 523 outlet~; -#X obj 141 78 loadbang; -#X text 232 72 Clone of zexy blockswap~; -#X text 232 90 First argument gives block size; -#X obj 245 167 f \$1; -#X obj 245 343 /; -#X obj 141 109 t b b; -#X obj 284 264 / 2; -#X obj 245 265 t b a; -#X obj 245 304 f; -#X obj 245 213 - 1; -#X obj 141 332 / \$1; -#X obj 140 473 *~ \$1; -#X obj 385 4 table \$0-input; -#X obj 23 34 tabsend~ \$0-input; -#X msg 321 315 \; \$1-input resize \$2; -#X obj 321 265 pack \$0 \$1; -#X obj 245 189 t a a b; -#X obj 141 496 tabread~ \$0-input; -#X connect 0 0 14 0; -#X connect 1 0 15 0; -#X connect 2 0 17 0; -#X connect 4 0 9 0; -#X connect 7 0 20 0; -#X connect 8 0 1 1; -#X connect 9 0 0 0; -#X connect 9 1 7 0; -#X connect 10 0 12 1; -#X connect 11 0 12 0; -#X connect 11 1 8 1; -#X connect 12 0 8 0; -#X connect 13 0 11 0; -#X connect 14 0 1 0; -#X connect 15 0 21 0; -#X connect 19 0 18 0; -#X connect 20 0 13 0; -#X connect 20 1 10 0; -#X connect 20 2 19 0; -#X connect 21 0 3 0; diff --git a/examples/puredata/xtract/a_hann.pd b/examples/puredata/xtract/a_hann.pd deleted file mode 100644 index fbc7af4..0000000 --- a/examples/puredata/xtract/a_hann.pd +++ /dev/null @@ -1,30 +0,0 @@ -#N canvas 379 192 709 463 10; -#X obj 381 119 samplerate~; -#X obj 384 187 phasor~; -#X msg 470 117 0; -#X obj 384 216 expr~ 0.5 - cos($v1 * 6.28) * 0.5; -#X obj 381 141 /~ \$1; -#X text 43 20 Creation arg gives window size; -#X obj 346 38 t b b b b; -#X obj 504 92 float \$1; -#X obj 346 10 inlet; -#X msg 504 114 resize \$1; -#X obj 504 139 s \$0-hann; -#X obj 589 37 table \$0-hann; -#X obj 318 296 tabwrite~ \$0-hann; -#X obj 58 186 tabreceive~ \$0-hann; -#X obj 59 229 outlet~; -#X obj 589 11 block~ \$1; -#X connect 0 0 4 0; -#X connect 1 0 3 0; -#X connect 2 0 1 1; -#X connect 3 0 12 0; -#X connect 4 0 1 0; -#X connect 6 0 12 0; -#X connect 6 1 2 0; -#X connect 6 2 0 0; -#X connect 6 3 7 0; -#X connect 7 0 9 0; -#X connect 8 0 6 0; -#X connect 9 0 10 0; -#X connect 13 0 14 0; diff --git a/examples/puredata/xtract/a_mton.pd b/examples/puredata/xtract/a_mton.pd deleted file mode 100644 index 7829dbe..0000000 --- a/examples/puredata/xtract/a_mton.pd +++ /dev/null @@ -1,66 +0,0 @@ -#N canvas 165 175 599 406 10; -#X obj 151 123 inlet; -#X obj 151 179 % 12; -#X obj 151 232 sel 0 1 2 3 4 5 6 7 8 9 10 11; -#X obj 483 268 / 12; -#X obj 483 291 int; -#X obj 483 313 outlet; -#X msg 80 272 C; -#X msg 110 272 C#; -#X msg 142 273 D; -#X msg 174 273 D#; -#X msg 203 273 E; -#X msg 236 274 F; -#X msg 269 274 F#; -#X msg 299 274 G; -#X msg 329 274 G#; -#X msg 359 275 A; -#X msg 393 275 A#; -#X msg 425 275 B; -#X obj 235 342 symbol; -#X obj 235 368 outlet; -#X obj 569 206 int; -#X obj 537 184 t f f; -#X obj 537 207 -; -#X obj 538 313 outlet; -#X text 51 30 a_mton takes midi note number as a float and outputs -note name \, octave and deviation in cents.; -#X obj 537 231 * 100; -#X obj 537 250 - 50; -#X connect 0 0 1 0; -#X connect 0 0 3 0; -#X connect 0 0 21 0; -#X connect 1 0 2 0; -#X connect 2 0 6 0; -#X connect 2 1 7 0; -#X connect 2 2 8 0; -#X connect 2 3 9 0; -#X connect 2 4 10 0; -#X connect 2 5 11 0; -#X connect 2 6 12 0; -#X connect 2 7 13 0; -#X connect 2 8 14 0; -#X connect 2 9 15 0; -#X connect 2 10 16 0; -#X connect 2 11 17 0; -#X connect 3 0 4 0; -#X connect 4 0 5 0; -#X connect 6 0 18 0; -#X connect 7 0 18 0; -#X connect 8 0 18 0; -#X connect 9 0 18 0; -#X connect 10 0 18 0; -#X connect 11 0 18 0; -#X connect 12 0 18 0; -#X connect 13 0 18 0; -#X connect 14 0 18 0; -#X connect 15 0 18 0; -#X connect 16 0 18 0; -#X connect 17 0 18 0; -#X connect 18 0 19 0; -#X connect 20 0 22 1; -#X connect 21 0 22 0; -#X connect 21 1 20 0; -#X connect 22 0 25 0; -#X connect 25 0 26 0; -#X connect 26 0 23 0; diff --git a/examples/puredata/xtract/a_output~.pd b/examples/puredata/xtract/a_output~.pd deleted file mode 100644 index 8cbf956..0000000 --- a/examples/puredata/xtract/a_output~.pd +++ /dev/null @@ -1,71 +0,0 @@ -#N canvas 0 0 757 675 12; -#X obj 516 522 t b; -#X obj 516 469 f; -#X obj 516 547 f; -#X msg 630 546 0; -#X obj 516 499 moses 1; -#X obj 630 518 t b f; -#X obj 596 479 moses 1; -#X obj 29 97 dbtorms; -#X obj 85 170 inlet~; -#X msg 278 300 \; pd dsp 1; -#X obj 29 170 line~; -#X obj 64 242 *~; -#X obj 64 272 dac~; -#X obj 29 127 pack 0 50; -#X text 121 146 audio in; -#X text 301 496 test if less than 1 -->; -#X text 267 523 if true convert to bang -->; -#X text 100 96 <-- convert from dB to linear units; -#X floatatom 31 13 3 0 100 0 dB - -; -#X obj 44 37 bng 15 250 50 0 empty empty mute -38 7 0 10 -262144 -1 --1; -#X text 118 126 <-- make a ramp to avoid clicks or zipper noise; -#X obj 148 170 inlet~; -#X obj 154 241 *~; -#X text 502 399 MUTE logic:; -#X obj 293 247 s \$0-master-out; -#X obj 29 71 r \$0-master-out; -#X obj 596 450 r \$0-master-out; -#X text 182 8 Level control abstraction \, used in many of the Pd example -patches. The level and mute controls show up on the parent \, calling -patch.; -#X text 229 549 previous nonzero master-lvl -->; -#X text 301 453 recall previous; -#X text 301 471 value of master-lvl -->; -#X text 16 310 automatically start DSP -->; -#X obj 85 192 hip~ 3; -#X obj 147 192 hip~ 3; -#X text 26 608 NOTE: This abstraction was written by Miller Puckette -\, and is include with the PD examples as part of the 'standard' PD -documentation. JB 23/05/05; -#X obj 278 193 r \$0-master-lvl-stereo; -#X obj 516 573 s \$0-master-lvl-stereo; -#X obj 623 215 inlet; -#X connect 0 0 2 0; -#X connect 1 0 4 0; -#X connect 2 0 36 0; -#X connect 3 0 36 0; -#X connect 4 0 0 0; -#X connect 4 1 5 0; -#X connect 5 0 3 0; -#X connect 6 1 2 1; -#X connect 7 0 13 0; -#X connect 8 0 32 0; -#X connect 10 0 22 0; -#X connect 10 0 11 0; -#X connect 11 0 12 0; -#X connect 13 0 10 0; -#X connect 18 0 9 0; -#X connect 18 0 24 0; -#X connect 19 0 1 0; -#X connect 21 0 33 0; -#X connect 22 0 12 1; -#X connect 25 0 7 0; -#X connect 26 0 1 1; -#X connect 26 0 6 0; -#X connect 32 0 11 1; -#X connect 33 0 22 1; -#X connect 35 0 18 0; -#X connect 37 0 18 0; -#X coords 0 0 1 1 65 55 1 0 0; diff --git a/examples/puredata/xtract/a_spigot~.pd b/examples/puredata/xtract/a_spigot~.pd deleted file mode 100644 index 86ebd54..0000000 --- a/examples/puredata/xtract/a_spigot~.pd +++ /dev/null @@ -1,21 +0,0 @@ -#N canvas 0 0 450 300 10; -#X obj 153 112 inlet~; -#X obj 152 229 outlet~; -#X obj 153 186 expr~ $v1 * $v2; -#X obj 252 162 line~; -#X msg 258 121 1 20; -#X msg 299 121 0 20; -#X obj 255 14 inlet; -#X obj 255 36 > 0; -#X obj 255 63 select 1 0; -#X text 49 261 Audio spigot. Same behaviour as spigot but for audio -; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 2 1; -#X connect 4 0 3 0; -#X connect 5 0 3 0; -#X connect 6 0 7 0; -#X connect 7 0 8 0; -#X connect 8 0 4 0; -#X connect 8 1 5 0; diff --git a/examples/puredata/xtract/f0.pd b/examples/puredata/xtract/f0.pd deleted file mode 100644 index 6ea0714..0000000 --- a/examples/puredata/xtract/f0.pd +++ /dev/null @@ -1,302 +0,0 @@ -#N canvas 730 93 584 590 10; -#N canvas 162 173 901 522 guts 0; -#X obj 205 48 osc~; -#X obj 338 70 a_spigot~; -#X obj 205 70 a_spigot~; -#X obj 331 -26 line; -#X msg 331 -50 \$1 50; -#X obj 357 282 ftom; -#X obj 3 48 ftom; -#N canvas 0 0 450 300 fm 0; -#X obj 181 114 osc~; -#X obj 138 175 osc~; -#X obj 137 154 +~; -#X obj 144 209 outlet~; -#X obj 182 82 *; -#X obj 137 26 inlet; -#X obj 204 6 inlet; -#X obj 179 54 f; -#X obj 204 30 t b f; -#X obj 182 143 *~; -#X obj 238 81 - 2; -#X obj 225 113 * 100000; -#X connect 0 0 9 0; -#X connect 1 0 3 0; -#X connect 2 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 2 0; -#X connect 5 0 4 0; -#X connect 5 0 7 1; -#X connect 6 0 8 0; -#X connect 7 0 4 0; -#X connect 7 0 2 0; -#X connect 8 0 7 0; -#X connect 8 1 4 1; -#X connect 8 1 10 0; -#X connect 9 0 2 1; -#X connect 10 0 11 0; -#X connect 11 0 9 1; -#X restore 339 47 pd fm; -#X obj 459 69 a_spigot~; -#X obj 253 168 +~; -#N canvas 0 0 450 300 noise 0; -#X obj 260 126 noise~; -#X obj 269 161 *~; -#X obj 270 194 lop~; -#X obj 305 161 * 10000; -#X obj 320 124 inlet; -#X obj 268 236 outlet~; -#X connect 0 0 1 0; -#X connect 1 0 2 0; -#X connect 2 0 5 0; -#X connect 3 0 2 1; -#X connect 4 0 3 0; -#X connect 4 0 1 1; -#X restore 587 66 pd noise; -#N canvas 554 114 496 580 pda 0; -#X obj 99 100 xtract~ f0; -#X obj 197 6 inlet~; -#X msg 361 203 list \$1; -#X obj 244 115 *~; -#X obj 59 25 r sr; -#X obj 149 267 tabsend~ freqs; -#X obj 401 30 table freqs; -#X obj 148 292 tabreceive~ freqs; -#X obj 6 220 != 0; -#X obj 4 331 spigot; -#X obj 57 331 spigot; -#X obj 67 217 == 0; -#X obj 27 369 f; -#X obj 28 415 lop~ 20; -#X obj 27 393 sig~; -#X obj 29 469 snapshot~; -#X obj 95 434 bang~; -#X obj 26 529 outlet; -#X obj 29 499 a_bavg 4; -#X obj 197 29 lop~ 5000; -#X obj 402 8 block~ 2048; -#X obj 200 51 hip~ 20; -#X msg 60 48 list \$1; -#X obj 274 59 r \$0-window-gen; -#X obj 274 80 a_hann 2048; -#X obj 148 222 xtract~ peak_spectrum; -#X obj 149 315 xtract~ lowest_value; -#X obj 150 243 a_blockswap~ 2048; -#X obj 359 127 samplerate~; -#X obj 358 150 / 2048; -#X msg 358 171 \$1 10; -#X obj 356 105 r \$0-peak-args; -#X obj 147 195 xtract~ spectrum 2048; -#X connect 0 0 2 0; -#X connect 0 0 8 0; -#X connect 0 0 9 0; -#X connect 0 0 11 0; -#X connect 1 0 19 0; -#X connect 2 0 26 1; -#X connect 3 0 32 0; -#X connect 4 0 22 0; -#X connect 7 0 26 0; -#X connect 8 0 9 1; -#X connect 9 0 12 0; -#X connect 10 0 12 0; -#X connect 11 0 10 1; -#X connect 12 0 14 0; -#X connect 13 0 15 0; -#X connect 14 0 13 0; -#X connect 15 0 18 0; -#X connect 16 0 15 0; -#X connect 18 0 17 0; -#X connect 19 0 21 0; -#X connect 21 0 0 0; -#X connect 21 0 3 0; -#X connect 22 0 0 1; -#X connect 23 0 24 0; -#X connect 24 0 3 1; -#X connect 25 0 27 0; -#X connect 26 0 10 0; -#X connect 27 0 5 0; -#X connect 28 0 29 0; -#X connect 29 0 30 0; -#X connect 30 0 25 1; -#X connect 31 0 28 0; -#X connect 32 0 25 0; -#X restore 357 262 pd pda; -#N canvas 0 0 596 417 d_saw 0; -#X obj 382 176 phasor~; -#X obj 397 96 noise~; -#X obj 346 116 sig~; -#X obj 381 149 +~; -#X obj 397 117 *~; -#X obj 242 198 phasor~; -#X obj 319 283 outlet~; -#X obj 385 215 *~ 0.5; -#X obj 240 227 *~ 0.3; -#X obj 270 173 * 0.01; -#X obj 241 174 +; -#X obj 460 97 * 0.1; -#X obj 312 249 lop~ 10000; -#X obj 369 51 inlet; -#X obj 261 55 inlet fund; -#X obj 258 138 f; -#X obj 286 105 t b f; -#X connect 0 0 7 0; -#X connect 1 0 4 0; -#X connect 2 0 3 0; -#X connect 3 0 0 0; -#X connect 4 0 3 1; -#X connect 5 0 8 0; -#X connect 7 0 12 0; -#X connect 8 0 12 0; -#X connect 9 0 10 1; -#X connect 10 0 5 0; -#X connect 11 0 4 1; -#X connect 12 0 6 0; -#X connect 13 0 16 0; -#X connect 14 0 2 0; -#X connect 14 0 11 0; -#X connect 14 0 15 1; -#X connect 14 0 10 0; -#X connect 15 0 10 0; -#X connect 15 0 9 0; -#X connect 16 0 15 0; -#X connect 16 1 9 1; -#X restore 457 45 pd d_saw; -#X obj 160 262 fiddle~ 2048; -#X obj 75 47 adc~; -#X obj 76 71 a_spigot~; -#X obj 2 69 a_mton; -#X obj 160 283 a_mton; -#X obj 357 301 a_mton; -#X obj 733 -70 loadbang; -#X obj 68 241 loadbang; -#X msg 67 263 symbol; -#X text 411 263 <-The magic happens in here; -#X obj 660 323 a_output~; -#X msg 747 271 0; -#X obj 263 46 r \$0-sine; -#X obj 134 48 r \$0-adc; -#X obj 396 48 r \$0-fm; -#X obj 521 43 r \$0-saw; -#X obj 586 41 r \$0-noisiness; -#X obj 473 -1 r \$0-inharmonicity; -#X obj 161 409 s \$0-fidd_f0_note; -#X obj 178 386 s \$0-fidd_f0_8ve; -#X obj 197 361 s \$0-fidd_f0_cent; -#X obj 356 367 s \$0-pda_f0_note; -#X obj 333 -73 r \$0-fund; -#X obj 375 345 s \$0-pda_f0_8ve; -#X obj 395 326 s \$0-pda_f0_cent; -#X obj 745 230 r \$0-master-lvl-stereo; -#X obj 747 252 r \$0-master-lvl-mute; -#X obj 747 291 s \$0-master-lvl-stereo; -#X obj 733 -45 f \$0; -#X obj 38 357 s \$0-f0_cent; -#X obj 19 378 s \$0-f0_8ve; -#X obj 0 406 s \$0-f0_note; -#X obj 254 261 s~ \$0-dacs; -#X obj 670 281 r~ \$0-dacs; -#X msg 732 -19 \; pd dsp 1 \; \; \$1-window-gen bang \; sr 44100 \; -\; \$1-master-lvl-stereo 50 \; \$1-peak-args bang; -#X connect 0 0 2 0; -#X connect 1 0 9 0; -#X connect 2 0 9 0; -#X connect 3 0 0 0; -#X connect 3 0 12 0; -#X connect 3 0 7 0; -#X connect 3 0 6 0; -#X connect 4 0 3 0; -#X connect 5 0 18 0; -#X connect 6 0 16 0; -#X connect 7 0 1 0; -#X connect 8 0 9 0; -#X connect 9 0 11 0; -#X connect 9 0 13 0; -#X connect 9 0 45 0; -#X connect 10 0 9 1; -#X connect 11 0 5 0; -#X connect 12 0 8 0; -#X connect 13 0 17 0; -#X connect 14 0 15 0; -#X connect 15 0 9 0; -#X connect 16 0 44 0; -#X connect 16 1 43 0; -#X connect 16 2 42 0; -#X connect 17 0 31 0; -#X connect 17 1 32 0; -#X connect 17 2 33 0; -#X connect 18 0 34 0; -#X connect 18 1 36 0; -#X connect 18 2 37 0; -#X connect 19 0 41 0; -#X connect 20 0 21 0; -#X connect 21 0 31 0; -#X connect 21 0 34 0; -#X connect 21 0 44 0; -#X connect 24 0 23 2; -#X connect 24 0 40 0; -#X connect 25 0 2 1; -#X connect 26 0 15 1; -#X connect 27 0 1 1; -#X connect 28 0 8 1; -#X connect 29 0 10 0; -#X connect 30 0 7 1; -#X connect 35 0 4 0; -#X connect 38 0 23 2; -#X connect 39 0 24 0; -#X connect 41 0 47 0; -#X connect 46 0 23 0; -#X connect 46 0 23 1; -#X restore 519 -226 pd guts; -#X obj 11 -226 cnv 15 500 200 empty empty PDA_comparison 20 12 0 14 --261681 -66577 0; -#X obj 34 -94 hsl 128 15 2 2.05 0 0 \$0-inharmonicity empty fm-inharmonicity --2 -6 0 8 -225271 -1 -1 0 1; -#X obj 34 -50 hsl 128 15 0 0.5 0 0 \$0-noisiness empty noisiness -2 --6 0 8 -225271 -1 -1 0 1; -#X obj 33 -135 hsl 128 15 30 3000 0 0 \$0-fund empty f0 -2 -6 0 8 -225271 --1 -1 0 1; -#X obj 32 -172 tgl 15 0 \$0-sine empty sine 0 -6 0 8 -225280 -1 -1 -0 1; -#X obj 73 -172 tgl 15 0 \$0-fm empty fm 0 -6 0 8 -225280 -1 -1 0 1 -; -#X obj 110 -172 tgl 15 0 \$0-saw empty saw 0 -6 0 8 -225280 -1 -1 0 -1; -#X obj 227 -133 cnv 15 200 100 empty empty empty 20 12 0 14 -262131 --66577 0; -#X obj 226 -199 cnv 15 200 60 empty empty empty 20 12 0 14 -225280 --66577 0; -#X symbolatom 242 -170 5 0 0 0 f0 #0-f0_note -; -#X floatatom 312 -170 5 0 0 0 8ve #0-f0_8ve -; -#X symbolatom 245 -112 5 0 0 0 f0 #0-fidd_f0_note -; -#X floatatom 313 -112 5 0 0 0 8ve #0-fidd_f0_8ve -; -#X text 304 -200 Input; -#X text 308 -84 xtract~; -#X text 305 -134 fiddle~; -#X floatatom 315 -62 5 0 0 0 8ve #0-pda_f0_8ve -; -#X symbolatom 247 -62 5 0 0 0 f0 #0-pda_f0_note -; -#X text 20 8 Notes:; -#X text 20 36 In this patch xtract~ is used to provide a combination -of time domain and frequency domain fundamental frequency estimation. -; -#X text 27 233 A block size of 2048 has been used in this example. -Which allows for a theoretical limit of 21Hz. In reality xtract~ can -be used to detect frequencies down to 30Hz with this block size \, -but with a larger block size it could go lower!; -#X text 23 88 [xtract~ f0] uses a method based on the AMDF function -\, with centre and peak clipping used to provide noise robustness. -This could be further improved \, as could the efficiency of the algorithm. -; -#X obj 147 -172 tgl 15 0 \$0-adc empty adc~ 0 -6 0 8 -257472 -1 -1 -0 1; -#X floatatom 386 -171 5 0 0 0 cent #0-f0_cent -; -#X floatatom 386 -63 5 0 0 0 cent #0-pda_f0_cent -; -#X floatatom 386 -113 5 0 0 0 cent #0-fidd_f0_cent -; -#X obj 465 -187 vsl 10 100 0 127 0 0 \$0-master-lvl-stereo \$0-master-lvl-stereo -out -4 -8 0 8 -262131 -1 -1 3898 1; -#X obj 465 -77 bng 10 250 50 0 \$0-master-lvl-mute empty mute -6 16 -0 8 -262131 -1 -1; -#X text 26 154 If [xtract~ f0] is unable to find a fundamental (i.e. -its output is 0 \, the lowest frequency in the peak spectrum is used. -In general this happens for very low frequencies. [xtract~ spectrum] -\, [xtract~ peak_spectrum] \, and [xtract~ lowest_value] are used to -achieve this.; diff --git a/examples/puredata/xtract/mfcc.pd b/examples/puredata/xtract/mfcc.pd deleted file mode 100644 index 2310c7f..0000000 --- a/examples/puredata/xtract/mfcc.pd +++ /dev/null @@ -1,276 +0,0 @@ -#N canvas 737 25 578 583 10; -#N canvas 116 214 598 221 guts 0; -#X obj 318 37 loadbang; -#X obj 318 64 f \$0; -#N canvas 0 0 450 300 dacs 0; -#X obj 164 152 a_output~; -#X msg 251 100 0; -#X obj 249 59 r \$0-master-lvl-stereo; -#X obj 251 81 r \$0-master-lvl-mute; -#X obj 251 120 s \$0-master-lvl-stereo; -#X obj 174 110 inlet~; -#X connect 1 0 0 2; -#X connect 1 0 4 0; -#X connect 2 0 0 2; -#X connect 3 0 1 0; -#X connect 5 0 0 0; -#X connect 5 0 0 1; -#X restore 85 126 pd dacs; -#X obj 16 24 r \$0-fund; -#X msg 318 88 \; pd dsp 1 \; \$1-master-lvl-stereo 60 \; \$1-window-gen -bang \; \$1-mfcc xticks 0 5 5 \; \$1-mfcc yticks 0 50 1 \; \$1-mfcc -xlabel -120 0 5 10 15 20; -#N canvas 308 141 679 510 paf 0; -#X obj 331 95 / 10; -#X obj 331 120 pack 0 50; -#X obj 139 412 fexpr~ $x1 * $x2; -#X obj 241 188 cos~; -#X obj 241 166 expr~ ($v1 * 0.5) - 0.25; -#X obj 380 197 *~ 256; -#X obj 462 209 line~; -#X obj 462 189 pack 0 50; -#X obj 289 194 *~; -#X obj 282 216 +~ 256; -#X obj 118 328 cos~; -#X obj 118 305 *~; -#X obj 161 328 cos~; -#X obj 161 305 +~; -#X obj 154 358 -~; -#X obj 174 390 *~; -#X obj 136 390 +~; -#X obj 230 291 wrap~; -#X obj 199 291 -~; -#X obj 199 259 samphold~; -#X obj 331 142 line~; -#X obj 138 438 outlet~; -#X obj 462 167 inlet bandwidth; -#X obj 47 121 phasor~; -#X obj 48 100 line~; -#X msg 47 78 \$1 20; -#X obj 48 57 inlet fund; -#X obj 331 73 inlet cf; -#X obj 282 316 tabread4~ \$0-hann; -#X obj 466 426 table \$0-hann; -#N canvas 0 0 450 300 hann 0; -#X obj 136 98 samplerate~; -#X obj 139 166 phasor~; -#X msg 225 96 0; -#X obj 139 195 expr~ 0.5 - cos($v1 * 6.28) * 0.5; -#X obj 114 51 t b b b b; -#X obj 114 23 inlet; -#X obj 261 117 s \$0-hann; -#X obj 139 220 tabwrite~ \$0-hann; -#X msg 259 93 resize 512; -#X obj 136 120 /~ 512; -#X connect 0 0 9 0; -#X connect 1 0 3 0; -#X connect 2 0 1 1; -#X connect 3 0 7 0; -#X connect 4 0 7 0; -#X connect 4 1 2 0; -#X connect 4 2 0 0; -#X connect 4 3 8 0; -#X connect 5 0 4 0; -#X connect 8 0 6 0; -#X connect 9 0 1 0; -#X restore 466 390 pd hann; -#X obj 466 362 r \$0-window-gen; -#X connect 0 0 1 0; -#X connect 1 0 20 0; -#X connect 2 0 21 0; -#X connect 3 0 8 0; -#X connect 4 0 3 0; -#X connect 5 0 8 1; -#X connect 6 0 5 0; -#X connect 7 0 6 0; -#X connect 8 0 9 0; -#X connect 9 0 28 0; -#X connect 10 0 14 1; -#X connect 10 0 16 0; -#X connect 11 0 13 0; -#X connect 11 0 10 0; -#X connect 12 0 14 0; -#X connect 13 0 12 0; -#X connect 14 0 15 0; -#X connect 15 0 16 1; -#X connect 16 0 2 0; -#X connect 17 0 18 1; -#X connect 17 0 15 1; -#X connect 18 0 11 1; -#X connect 19 0 18 0; -#X connect 19 0 17 0; -#X connect 20 0 19 0; -#X connect 22 0 7 0; -#X connect 23 0 19 1; -#X connect 23 0 13 1; -#X connect 23 0 11 0; -#X connect 23 0 4 0; -#X connect 24 0 23 0; -#X connect 25 0 24 0; -#X connect 26 0 25 0; -#X connect 27 0 0 0; -#X connect 28 0 2 1; -#X connect 31 0 30 0; -#X restore 35 80 pd paf; -#X obj 85 25 r \$0-cf; -#X obj 140 23 r \$0-bw; -#X obj 145 127 r \$0-window-gen; -#X obj 145 148 a_hann 1024; -#N canvas 34 54 723 391 spectrum 0; -#X obj 194 153 *~; -#X obj 181 69 inlet~; -#X obj 252 68 inlet~; -#X obj 195 176 xtract~ spectrum; -#N canvas 0 0 450 300 mag_spectrum 0; -#X obj 260 64 block~ 512; -#N canvas 0 0 450 300 (subpatch) 0; -#X array mag_spectrum 512 float 3; -#A 0 0.0347679 0.0238386 0.0342933 0.0362505 0.0295941 0.0500627 0.0356107 -0.0419818 0.0507073 0.0290984 0.0416723 0.0321575 0.0192698 0.0252058 -0.0116167 0.00836482 0.00784646 0.00138145 0.00132721 0.000381971 0.000573959 -0.000406984 0.000280216 0.000179901 0.000186049 0.000268997 0.000263714 -0.000155282 0.000139129 0.000167519 0.000124361 0.000180699 0.000142076 -0.000144225 0.000119736 0.000148186 0.000111046 0.000121504 0.000107089 -0.000121003 9.47739e-05 0.000125579 0.000100434 0.000104701 9.41711e-05 -0.000104671 8.29275e-05 9.69602e-05 8.842e-05 9.28634e-05 8.08756e-05 -9.55736e-05 7.85888e-05 8.25423e-05 7.83809e-05 8.18489e-05 7.07095e-05 -8.02309e-05 7.42804e-05 7.48963e-05 6.96933e-05 7.65881e-05 6.52446e-05 -6.90523e-05 6.72559e-05 6.77385e-05 6.22041e-05 6.80202e-05 6.33565e-05 -6.27514e-05 6.09007e-05 6.3778e-05 5.64576e-05 5.99506e-05 5.87628e-05 -5.80413e-05 5.54242e-05 5.86565e-05 5.49603e-05 5.42429e-05 5.4014e-05 -5.47262e-05 5.03136e-05 5.31452e-05 5.20179e-05 5.08749e-05 4.98008e-05 -5.13611e-05 4.85163e-05 4.80735e-05 4.85478e-05 4.80833e-05 4.56452e-05 -4.77271e-05 4.64662e-05 4.53934e-05 4.50956e-05 4.56013e-05 4.35624e-05 -4.34772e-05 4.40007e-05 4.30346e-05 4.18994e-05 4.31475e-05 4.18919e-05 -4.11025e-05 4.11284e-05 4.10175e-05 3.97421e-05 3.98145e-05 4.01797e-05 -3.90583e-05 3.87068e-05 3.92256e-05 3.81535e-05 3.76564e-05 3.77768e-05 -3.73499e-05 3.66974e-05 3.67557e-05 3.68833e-05 3.58508e-05 3.59041e-05 -3.58715e-05 3.51094e-05 3.48463e-05 3.49077e-05 3.43984e-05 3.41789e-05 -3.40861e-05 3.40455e-05 3.32054e-05 3.34367e-05 3.30168e-05 3.26526e-05 -3.24827e-05 3.24396e-05 3.19881e-05 3.19942e-05 3.17211e-05 3.16122e-05 -3.10021e-05 3.12408e-05 3.06344e-05 3.06429e-05 3.04321e-05 3.03029e-05 -2.99668e-05 3.00742e-05 2.95874e-05 2.95749e-05 2.91166e-05 2.92872e-05 -2.87315e-05 2.88123e-05 2.86934e-05 2.84017e-05 2.82494e-05 2.83481e-05 -2.76694e-05 2.7905e-05 2.74856e-05 2.7595e-05 2.70659e-05 2.73785e-05 -2.70175e-05 2.68042e-05 2.67559e-05 2.67275e-05 2.61115e-05 2.64444e-05 -2.60253e-05 2.6143e-05 2.56633e-05 2.59967e-05 2.55765e-05 2.54011e-05 -2.54205e-05 2.52767e-05 2.48309e-05 2.51035e-05 2.48111e-05 2.47337e-05 -2.44776e-05 2.47857e-05 2.41466e-05 2.42557e-05 2.41419e-05 2.40363e-05 -2.36974e-05 2.39439e-05 2.36521e-05 2.35678e-05 2.34062e-05 2.3597e-05 -2.29854e-05 2.32039e-05 2.30333e-05 2.29341e-05 2.27001e-05 2.29057e-05 -2.25917e-05 2.25413e-05 2.24169e-05 2.25144e-05 2.1993e-05 2.22539e-05 -2.20491e-05 2.19648e-05 2.18146e-05 2.19472e-05 2.16342e-05 2.16211e-05 -2.15227e-05 2.15229e-05 2.11552e-05 2.13981e-05 2.1145e-05 2.11307e-05 -2.10028e-05 2.10558e-05 2.07771e-05 2.08104e-05 2.06922e-05 2.06572e-05 -2.0421e-05 2.06044e-05 2.03378e-05 2.03852e-05 2.0236e-05 2.02428e-05 -2.00298e-05 2.00682e-05 1.99341e-05 1.99055e-05 1.9766e-05 1.98595e-05 -1.96149e-05 1.9708e-05 1.95175e-05 1.951e-05 1.93652e-05 1.93882e-05 -1.9253e-05 1.92475e-05 1.91492e-05 1.91725e-05 1.89653e-05 1.90797e-05 -1.88526e-05 1.88553e-05 1.87737e-05 1.87674e-05 1.86322e-05 1.86603e-05 -1.85738e-05 1.8523e-05 1.84042e-05 1.84821e-05 1.82465e-05 1.82856e-05 -1.82333e-05 1.81908e-05 1.80772e-05 1.81247e-05 1.80205e-05 1.79422e-05 -1.78919e-05 1.79356e-05 1.76952e-05 1.77907e-05 1.77256e-05 1.76545e-05 -1.75951e-05 1.76011e-05 1.75059e-05 1.74307e-05 1.74315e-05 1.73783e-05 -1.72885e-05 1.72999e-05 1.72644e-05 1.71807e-05 1.71397e-05 1.71261e-05 -1.70455e-05 1.6948e-05 1.70073e-05 1.6948e-05 1.6794e-05 1.69151e-05 -1.68262e-05 1.6732e-05 1.67057e-05 1.67527e-05 1.65599e-05 1.65856e-05 -1.65865e-05 1.65142e-05 1.64285e-05 1.65163e-05 1.63755e-05 1.63693e-05 -1.63267e-05 1.62936e-05 1.62273e-05 1.6209e-05 1.62148e-05 1.61265e-05 -1.61024e-05 1.61131e-05 1.60167e-05 1.60016e-05 1.59628e-05 1.59332e-05 -1.58903e-05 1.58553e-05 1.58772e-05 1.57569e-05 1.57924e-05 1.57572e-05 -1.56537e-05 1.56966e-05 1.56074e-05 1.56212e-05 1.55779e-05 1.5539e-05 -1.55494e-05 1.5449e-05 1.5495e-05 1.54081e-05 1.53711e-05 1.53932e-05 -1.52964e-05 1.53376e-05 1.52897e-05 1.52396e-05 1.52538e-05 1.51629e-05 -1.52182e-05 1.50957e-05 1.51177e-05 1.51097e-05 1.50368e-05 1.50477e-05 -1.50399e-05 1.49629e-05 1.49619e-05 1.4934e-05 1.49109e-05 1.48107e-05 -1.49298e-05 1.48269e-05 1.47474e-05 1.48734e-05 1.47248e-05 1.47904e-05 -1.46943e-05 1.47132e-05 1.46267e-05 1.47303e-05 1.44649e-05 1.46803e-05 -1.45807e-05 1.45165e-05 1.45321e-05 1.45863e-05 1.44389e-05 1.44883e-05 -1.45138e-05 1.43366e-05 1.45488e-05 1.42999e-05 1.43532e-05 1.43481e-05 -1.44012e-05 1.40856e-05 1.4473e-05 1.42298e-05 1.42492e-05 1.42315e-05 -1.43224e-05 1.40978e-05 1.42317e-05 1.41411e-05 1.41222e-05 1.41452e-05 -1.40687e-05 1.4097e-05 1.40772e-05 1.40533e-05 1.4062e-05 1.39999e-05 -1.40167e-05 1.39786e-05 1.39683e-05 1.39479e-05 1.39503e-05 1.39196e-05 -1.39185e-05 1.3891e-05 1.38968e-05 1.38385e-05 1.38591e-05 1.38226e-05 -1.3823e-05 1.37987e-05 1.38058e-05 1.37687e-05 1.37731e-05 1.37467e-05 -1.3741e-05 1.37012e-05 1.37238e-05 1.36772e-05 1.36989e-05 1.36648e-05 -1.36677e-05 1.36383e-05 1.36465e-05 1.36082e-05 1.36107e-05 1.35828e-05 -1.36001e-05 1.35517e-05 1.35862e-05 1.35436e-05 1.3545e-05 1.35258e-05 -1.35259e-05 1.34894e-05 1.35036e-05 1.34777e-05 1.34856e-05 1.34502e-05 -1.34863e-05 1.34282e-05 1.34469e-05 1.34125e-05 1.34237e-05 1.34026e-05 -1.33887e-05 1.34055e-05 1.33624e-05 1.33684e-05 1.34108e-05 1.32959e-05 -1.33875e-05 1.32811e-05 1.33619e-05 1.33219e-05 1.3276e-05 1.33497e-05 -1.32483e-05 1.33257e-05 1.3305e-05 1.32275e-05 1.33069e-05 1.32249e-05 -1.32866e-05 1.32339e-05 1.32487e-05 1.3251e-05 1.32172e-05 1.32353e-05 -1.323e-05 1.31875e-05 1.32223e-05 1.319e-05 1.32038e-05 1.31846e-05 -1.31983e-05 1.31761e-05 1.31802e-05 1.31635e-05 1.31737e-05 1.31439e-05 -1.31682e-05 1.31427e-05 1.31617e-05 1.31332e-05 1.31547e-05 1.3133e-05 -1.31335e-05 1.31252e-05 1.31203e-05 1.31178e-05 1.313e-05 1.31048e-05 -1.31309e-05 1.30961e-05 1.31287e-05 1.30943e-05 1.31076e-05 1.3093e-05 -1.30996e-05 1.30943e-05 1.3103e-05 1.30871e-05 1.31077e-05 1.30727e-05 -1.31072e-05 1.30737e-05 1.3094e-05 1.30748e-05 1.30877e-05 1.30874e-05 -1.30868e-05 1.30789e-05 1.30949e-05 1.30709e-05 1.30856e-05; -#X coords 0 1 511 0 200 140 1; -#X restore 125 121 graph; -#X restore 358 92 pd mag_spectrum; -#X obj 195 211 tabsend~ mag_spectrum; -#X obj 357 64 block~ 1024; -#X obj 197 301 xtract~ mfcc; -#X obj 196 274 tabreceive~ mag_spectrum; -#X obj 197 333 tabsend~ \$0-mfcc; -#X connect 0 0 3 0; -#X connect 1 0 0 0; -#X connect 2 0 0 1; -#X connect 3 0 5 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X restore 32 167 pd spectrum; -#X connect 0 0 1 0; -#X connect 1 0 4 0; -#X connect 3 0 5 0; -#X connect 5 0 2 0; -#X connect 5 0 10 0; -#X connect 6 0 5 1; -#X connect 7 0 5 2; -#X connect 8 0 9 0; -#X connect 9 0 10 1; -#X restore 516 -222 pd guts; -#X obj 6 -225 cnv 15 500 200 empty empty MFCC 20 12 0 14 -261681 -66577 -0; -#X obj 184 -202 cnv 15 250 150 empty empty empty 20 12 0 14 -262131 --66577 0; -#X obj 465 -187 vsl 10 100 0 127 0 0 \$0-master-lvl-stereo \$0-master-lvl-stereo -out -4 -8 0 8 -262131 -1 -1 0 1; -#X obj 465 -77 bng 10 250 50 0 \$0-master-lvl-mute empty mute -6 16 -0 8 -262131 -1 -1; -#X obj 32 -114 hsl 128 15 20 150 0 0 \$0-cf empty centre_frequency --2 -6 0 8 -225271 -1 -1 700 1; -#X obj 33 -153 hsl 128 15 80 2000 0 0 \$0-fund empty fundamental -2 --6 0 8 -225271 -1 -1 200 1; -#X text 19 7 Notes:; -#X text 20 87 [xtract~ mfcc] outputs a series 20 Mel-Frequency Cepstral -Coefficients. When it is instantiated \, an initialisation function -creates a bank of 20 mel-spaced filters \, between 80Hz and 1800Hz -on a linear scale. All filters have the same gain; -#X text 23 255 With LibXtract it is possible to change the number of -Mel filters as well as the range of frequencies over which they operate -\, and the filter scaling (equal area/equal gain). With this PD example -\, sensible defaults have been chosen to improve usability; -#N canvas 0 0 450 300 (subpatch) 0; -#X array \$0-mfcc 20 float 1; -#A 0 -226.816 39.0179 27.0649 13.3895 3.18296 -4.35309 -6.98078 -6.73432 --4.09373 -1.24401 0.693745 0.961352 0.393719 -0.854615 -1.49734 -1.75847 --1.32051 -0.652124 0.00802549 0.234184; -#X coords 0 50 19 -500 200 100 1; -#X restore 212 -178 graph; -#X text 28 -188 PAF synthesiser; -#X obj 34 -71 hsl 128 15 1 10 0 0 \$0-bw empty formant_bandwidth -2 --6 0 8 -225271 -1 -1 600 1; -#X text 20 36 In this patch [xtract~ spectrum] is first used to extract -the magnitude spectrum from an audio signal in overlapping blocks of -1024 samples.; -#X text 23 165 Whilst DSP is running the input vector (magnitude spectrum) -is filtered by this filterbank \, and the total energy output from -each filter is appended to a new vector. This new vector (mel-filtered -spectrum) is then subjected to a fast cosine transform. The output -can be visualised in the graph labelled \$0-mfcc.; diff --git a/examples/puredata/xtract/sonogram.pd b/examples/puredata/xtract/sonogram.pd deleted file mode 100644 index 78a7b42..0000000 --- a/examples/puredata/xtract/sonogram.pd +++ /dev/null @@ -1 +0,0 @@ -#N canvas 0 0 450 300 10; diff --git a/examples/puredata/xtract/xtract-help.pd b/examples/puredata/xtract/xtract-help.pd deleted file mode 100644 index 8e0959b..0000000 --- a/examples/puredata/xtract/xtract-help.pd +++ /dev/null @@ -1,42 +0,0 @@ -#N canvas 685 60 450 725 10; -#X text 21 12 [xtract~]; -#X text 24 19 ________; -#X text 22 52 [xtract~] provides a wrapper for the feature extraction -library: LibXtract. Please refer to the documentation at libxtract.sourceforge.net -\, for a full explanation of the library and the functions it provides. -Only the operation of the PD external will be explained here along -with a few use case scenarios.; -#X obj 27 299 xtract~; -#X msg 27 270 help; -#X text 27 328 Other than this help message \, the data sent to the -left inlet should always be a 'signal' (i.e. audio rate). This is the -data from a which a given feature will be extracted.; -#X obj 183 520 xtract~ mean; -#X floatatom 133 616 10 0 0 0 - - -; -#X floatatom 254 553 5 0 0 0 - - -; -#X msg 183 552 list \$1; -#X obj 133 586 xtract~ variance; -#X obj 182 496 phasor~ 0.1; -#X text 40 671 Below are some possible use cases (click to open):; -#X text 27 382 The outlet may be a scalar (control rate) \, or a vector -(audio rate) \, depending on the nature of the feature that is being -extracted.; -#X obj 43 695 f0; -#X obj 84 695 mfcc; -#X text 28 435 Any additional arguments that need to be passed to the -feature extraction function must be provided as a list to the right -inlet \, e.g.; -#X text 24 231 A complete list of features may be obtained by sending -the external a |help( message:; -#X text 20 148 [xtract~] must always be called with one argument \, -in the following form: [xtract~ <feature>] \, where <feature> is a -feature supported by the LibXtract library.; -#X text 21 198 An optional second argument can be used to explicitly -set the blocksize for FFT-based features; -#X connect 4 0 3 0; -#X connect 6 0 8 0; -#X connect 6 0 9 0; -#X connect 9 0 10 1; -#X connect 10 0 7 0; -#X connect 11 0 6 0; -#X connect 11 0 10 0; diff --git a/examples/puredata/xtract~.c b/examples/puredata/xtract~.c deleted file mode 100644 index a7f7325..0000000 --- a/examples/puredata/xtract~.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (C) 2012 Jamie Bullock - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - */ - -/* calculates the spectral xtract of one frame, given peak frequency and amplitude to first and second inputs respectively */ - -#include "m_pd.h" -#include <math.h> -#include <string.h> - -#include "xtract/libxtract.h" - -#define BLOCKSIZE 1024 /* FIX: this should be dynamic - somehow */ -#define NYQUIST 22050.0f - -#ifndef isnan - /* FIX: should probably try to handle signalling NaNs */ - int isnan(x){ if(x == x) return 0; else return 1;} -#endif - -#ifndef isinf - int isinf(x) {if(x == 1.0 / 0. || x == -1.0 / 0.) return 1; else return 0;} -#endif - -static t_class *xtract_class; - -/* Struct for keeping track of memory allocations */ -typedef struct _tracked_memory { - char argv; -} tracked_memory; - -typedef struct _xtract { - t_object x_obj; - t_float f; - double *window; - double *data; - double *result; - t_int feature, - is_scalar, - is_subframe, - argv_type, - init_blocksize, - done_init; - t_symbol *feature_name; - tracked_memory memory; - void *argv; -} t_xtract_tilde; - -static t_int *xtract_perform(t_int *w) { - t_sample *in = (t_sample *)(w[1]); - t_xtract_tilde *x = (t_xtract_tilde *)(w[2]); - t_int N = (t_int)(w[3]); - t_int rv = 0; - double result = 0.0; - - for(t_int n = 0; n < N; ++n) { - x->data[n] = (double)in[n]; - } - - rv = xtract[x->feature](x->data, N, x->argv, &result); - - if(rv == XTRACT_FEATURE_NOT_IMPLEMENTED) - pd_error(x, "Feature not implemented"); - - /* set nan, inf or -inf to 0 */ - result = (isinf(result) || isnan(result) ? 0.0 : result); - - outlet_float(x->x_obj.ob_outlet, (float)result); - return (w+4); -} - -static t_int *xtract_perform_vector(t_int *w) { - - t_sample *in = (t_sample *)(w[1]); - t_sample *out = (t_sample *)(w[2]); - t_xtract_tilde *x = (t_xtract_tilde *)(w[3]); - t_int N = (t_int)(w[4]), n; - t_int rv = 0; - - if(N != x->init_blocksize && x->done_init){ - error("xtract~ %s: Blocksize mismatch, try specifying the blocksize as a second argument", x->feature_name->s_name); - return (w+5); - } - - n = N; - - for(n = 0; n < N; ++n) { - x->data[n] = (double)in[n]; - } - - if(x->feature == XTRACT_PEAK_SPECTRUM || x->feature == XTRACT_LPC) - N >>= 1; - - if(x->is_subframe){ - - rv = xtract_features_from_subframes(x->data, N, x->feature, - x->argv, x->result); - } - else{ - - rv = xtract[x->feature](x->data, N, x->argv, x->result); - } - - if(rv == XTRACT_FEATURE_NOT_IMPLEMENTED) - pd_error(x, "Feature not implemented"); - - while(n--) - out[n] = (float)x->result[n]; - - return (w+5); -} - -static void xtract_dsp(t_xtract_tilde *x, t_signal **sp) { - - if(!x->is_scalar){ - dsp_add(xtract_perform_vector, 4, - sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); - } - - else - dsp_add(xtract_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); - -} - -static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) { - - t_xtract_tilde *x = (t_xtract_tilde *)pd_new(xtract_class); - xtract_mel_filter *mf; - t_int n, N, M, f, F, - n_args, - type; - double *argv_max; - t_symbol *arg1; - xtract_function_descriptor_t *fd; - char *p_name, - *p_desc, - *author; - int year; - - p_name = p_desc = author = NULL; - - n_args = type = 0; - - f = F = XTRACT_FEATURES; - - N = BLOCKSIZE; - - x->argv = NULL; - x->argv_type = 0; - x->done_init = 0; - x->is_scalar = 0; - x->is_subframe = 0; - x->feature = -1; - - /* Allocate data area */ - x->data = (double *)getbytes(N * sizeof(double)); - x->result = (double *)getbytes(N * sizeof(double)); - - /* Parse arguments */ - if(argc){ - arg1 = atom_getsymbol(argv); - if(arg1 == gensym("subframe")) - x->is_subframe = 1; - else - x->feature_name = atom_getsymbol(argv); - } - else { - post("xtract~: No arguments given"); - return (void *)x; - } - if(argc > 1){ - if(x->is_subframe) - x->feature_name = atom_getsymbol(argv+1); - else - N = atom_getint(argv+1); - } - if(argc > 2) - N = atom_getint(argv+2); - - x->init_blocksize = N; - M = N >> 1; - - /* get function descriptors */ - fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); - - /* iterate over descriptors */ - while(f--){ - /* map creation arg to feature */ - if(x->feature_name == gensym(fd[f].algo.name)){ - x->feature = f; - break; - } - } - - if(x->feature == -1) - post("xtract~: feature not found: %s", x->feature_name->s_name); - - /* allocate memory for feature arguments */ - n_args = fd[f].argc; - type = fd[f].argv.type; - - x->argv_type = type; - - if(n_args){ - for(n = 0; n < n_args; n++){ - argv_max = &fd[f].argv.max[n]; - /*post("Argument %d, max: %.2f", n, *argv_max); */ - } - if(type == XTRACT_MEL_FILTER){ - x->memory.argv = (size_t)(n_args * sizeof(xtract_mel_filter)); - x->argv = (xtract_mel_filter *)getbytes(x->memory.argv); - } - else if(type == XTRACT_INT){ - x->memory.argv = (size_t)(n_args * sizeof(t_int)); - x->argv = (t_int *)getbytes(x->memory.argv); - } - else if (type == XTRACT_FLOAT){ - x->memory.argv = (size_t)(n_args * sizeof(t_float)); - x->argv = (t_float *)getbytes(x->memory.argv); - } - else - x->memory.argv = 0; - } - - p_name = fd[f].algo.p_name; - p_desc = fd[f].algo.p_desc; - author = fd[f].algo.author; - year = fd[f].algo.year; - - if(argc){ - if(strcmp(p_name, "")) - post("xtract~: %s", p_name ); - if(strcmp(p_desc, "")) - post("xtract~: %s", p_desc ); - if(strcmp(author, "") && year) - post("xtract~: %s(%d)", author, year); - } - - /* Adjust frame size if we are using subframe features */ - if(x->is_subframe) - N = M; - - post("xtract~: assumed window size: %d", N); - - /* do init if needed */ - if(x->feature == XTRACT_MFCC){ - - mf = x->argv; - - mf->n_filters = 20; - - post("xtract~: mfcc: filters = %d", - ((xtract_mel_filter *)x->argv)->n_filters); - mf->filters = - (double **)getbytes(mf->n_filters * sizeof(double *)); - for(n = 0; n < mf->n_filters; n++) - mf->filters[n] = (double *)getbytes(N * sizeof(double)); - - xtract_init_mfcc(N, NYQUIST, XTRACT_EQUAL_GAIN, 80.0f, - 18000.0f, mf->n_filters, mf->filters); - x->done_init = 1; - } - else if(x->feature == XTRACT_BARK_COEFFICIENTS){ - xtract_init_bark(N, NYQUIST, x->argv); - x->done_init = 1; - } - else if(x->feature == XTRACT_WINDOWED){ - x->window = xtract_init_window(N, XTRACT_HANN); - x->argv = x->window; - x->done_init = 1; - } - else if(x->feature == XTRACT_WAVELET_F0){ - xtract_init_wavelet_f0_state(); - } - - /* Initialise fft_plan if required */ - if(x->feature == XTRACT_AUTOCORRELATION_FFT || - x->feature == XTRACT_SPECTRUM || - x->feature == XTRACT_DCT){ - xtract_init_fft(N, x->feature); - x->done_init = 1; - } - - if(fd[f].is_scalar) - x->is_scalar = 1; - -/* - if(x->feature == XTRACT_AUTOCORRELATION || - x->feature == XTRACT_AUTOCORRELATION_FFT || - x->feature == XTRACT_MFCC || x->feature == XTRACT_AMDF || - x->feature == XTRACT_ASDF|| x->feature == XTRACT_DCT || - x->feature == XTRACT_BARK_COEFFICIENTS || - x->feature == XTRACT_SPECTRUM || - x->feature == XTRACT_PEAK_SPECTRUM || - x->feature == XTRACT_HARMONIC_SPECTRUM || - x->feature == XTRACT_LPC || - x->feature == XTRACT_LPCC || - x->feature == XTRACT_WINDOWED) - x->feature_type = XTRACT_VECTOR; - */ - /* else if (x->feature == XTRACT_FLUX || x->feature == XTRACT_ATTACK_TIME || - x->feature == XTRACT_DECAY_TIME || x->feature == XTRACT_DIFFERENCE_VECTOR) - x->feature_type = XTRACT_DELTA; */ -/* - else x->feature_type = XTRACT_SCALAR; -*/ - - /* argv through right inlet */ - inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("list")); - - /* if feature is vector, create signal out */ - if(!x->is_scalar) - outlet_new(&x->x_obj, &s_signal); - - /* otherwise: float */ - else - outlet_new(&x->x_obj, &s_float); - - if(x->is_scalar && x->is_subframe) - post( - "xtract~: warning: subframes not yet supported for scalar features"); - - /* free the function descriptors */ - xtract_free_descriptors(fd); - - return (void *)x; -} - -static void xtract_tilde_get_args(t_xtract_tilde *x, t_symbol *selector, -t_int argc, t_atom *argv) { -/* - if(argc > (t_int)sizeof(x->argv) / - (t_int)sizeof(t_float) || x->argv == NULL) - post("Too many parameters to right inlet"); - else{*/ - - x->argv = getbytes(argc * sizeof(float)); - - while(argc--){ - switch(x->argv_type){ - case XTRACT_INT: - ((t_int *)x->argv)[argc] = (int)atom_getfloat(&argv[argc]); - break; - case XTRACT_FLOAT: - default: - ((t_float *)x->argv)[argc] = atom_getfloat(&argv[argc]); - break; - } - } - /* }*/ -} - -static void xtract_tilde_show_help(t_xtract_tilde *x, t_symbol *s){ - - int i; - - xtract_function_descriptor_t *fd, *d; - - i = XTRACT_FEATURES; - - fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); - post("\nxtract~: Feature List\n"); - - while(i--){ - d = &fd[i]; - post("\t%s", d->algo.name); - } - - xtract_free_descriptors(fd); -} - -static void xtract_tilde_free(t_xtract_tilde *x) { - - if(x->argv != NULL && x->memory.argv) - freebytes(x->argv, x->memory.argv); - - if(x->window != NULL) - xtract_free_window(x->window); -} - -void xtract_tilde_setup(void) { - xtract_class = class_new(gensym("xtract~"), - (t_newmethod)xtract_new, - (t_method)xtract_tilde_free, - sizeof(t_xtract_tilde), - CLASS_DEFAULT, - A_GIMME, 0); - - class_addmethod(xtract_class, - (t_method)xtract_dsp, gensym("dsp"), 0); - class_addmethod(xtract_class, - (t_method)xtract_tilde_get_args, gensym("list"), A_GIMME, 0); - class_addmethod(xtract_class, - (t_method)xtract_tilde_show_help, gensym("help"), A_DEFSYMBOL, 0); - CLASS_MAINSIGNALIN(xtract_class, t_xtract_tilde, f); - class_sethelpsymbol(xtract_class, gensym("xtract-help")); -} |