Imported Upstream version 0.1.1

parents
This diff is collapsed.
This diff is collapsed.
peakit~ - find frequency peaks of an FFT and output lists of frequencies and magnitudes.
(c) Edward Kelly 2005. This software is subject to the GNU General Public License, and may be freely copied, distributed and modified.
You will need the listmoses external to make the best use of this software, and to run the peakit-listmoses demonstration patches in the help file.
Have fun!
Ed Kelly <morph_2016@yahoo.co.uk>
#N canvas 1 52 450 300 10;
#X obj 155 148 count;
#N canvas 529 241 271 210 10;
#X obj 69 42 inlet;
#X obj 180 76 inlet;
#X obj 69 59 f;
#X obj 92 59 + 1;
#X msg 172 148 0;
#X obj 92 76 t f f;
#X obj 106 103 f;
#X obj 150 93 >= \$1;
#X obj 150 131 sel 0 1;
#X obj 172 114 inlet;
#X obj 25 139 outlet;
#X obj 69 139 outlet;
#X obj 69 122 sel 0;
#X text 16 25 INLETS: bang/set reset limit;
#X obj 25 76 t f f;
#X obj 139 59 loadbang;
#X msg 25 93 1;
#X obj 55 99 spigot;
#X msg 139 76 0;
#X text 20 170 OUTLETS: count bang-when-done;
#X connect 0 0 2 0;
#X connect 1 0 7 1;
#X connect 2 0 3 0;
#X connect 2 0 14 0;
#X connect 3 0 5 0;
#X connect 4 0 2 1;
#X connect 4 0 17 1;
#X connect 5 0 7 0;
#X connect 5 1 6 1;
#X connect 6 0 2 1;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 8 1 4 0;
#X connect 9 0 4 0;
#X connect 12 0 11 0;
#X connect 14 0 10 0;
#X connect 14 0 16 0;
#X connect 14 1 17 0;
#X connect 15 0 18 0;
#X connect 16 0 17 1;
#X connect 17 0 12 0;
#X connect 18 0 17 1;
#N canvas 0 22 433 272 10;
#X obj 71 134 cup;
#X msg 133 118 0;
#X msg 177 118 25;
#X msg 220 118 -67;
#X text 153 89 set to float;
#X text 130 100 (but do not output);
#X obj 71 81 metro 500;
#X obj 71 62 loadbang;
#X floatatom 71 156 5 0 0 0 - - -;
#X text 196 24 cup counts up ^_^;
#X text 165 46 it's the simplest counter there is;
#X text 184 70 why waste cpu power on counting?;
#X text 106 236 Ed;
#X text 71 198 someday I may write a haiku poem about it;
#X msg 280 119 setbang 198;
#X text 278 103 set and output;
#N canvas 0 0 450 300 simplecounter 0;
#X obj 107 147 cup;
#X msg 138 147 0;
#X msg 107 80 1;
#X floatatom 107 191 5 0 0 0 - - -;
#X obj 107 63 loadbang;
#X obj 107 97 metro 200;
#X text 228 190 don't forget the delay 0!;
#X obj 174 172 select 10;
#X obj 174 189 delay 0;
#X text 80 233 cup counts up from float;
#X text 79 248 simplicity helps me think;
#X text 80 263 organise my patch;
#X text 81 218 ______A_CUP_HAIKU_______;
#X connect 0 0 3 0;
#X connect 0 0 7 0;
#X connect 1 0 0 0;
#X connect 2 0 5 0;
#X connect 4 0 2 0;
#X connect 5 0 0 0;
#X connect 7 0 8 0;
#X connect 8 0 1 0;
#X restore 230 158 pd simplecounter;
#X connect 0 0 8 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 6 0;
#X connect 14 0 0 0;
#include "m_pd.h"
t_class *cup_class;
typedef struct _cup
{
t_object x_obj;
t_int f_count, fa;
t_outlet *count;
} t_cup;
void cup_float(t_cup *y, t_floatarg f)
{
y->f_count = f;
}
void cup_bang(t_cup *y)
{
outlet_float(y->count, y->f_count);
y->f_count += 1;
}
void cup_setbang(t_cup *y, t_floatarg f)
{
y->f_count = f;
outlet_float(y->count, y->f_count);
y->f_count += 1;
}
void *cup_new(t_floatarg f)
{
t_cup *y = (t_cup *)pd_new(cup_class);
y->fa = f;
y->f_count = 0;
y->count = outlet_new(&y->x_obj, gensym("float"));
return(void *)y;
}
void cup_setup(void)
{
cup_class = class_new(gensym("cup"),
(t_newmethod)cup_new,
0, sizeof(t_cup),
0, A_DEFFLOAT, 0);
post("cup counts up ^_^");
class_addbang(cup_class, cup_bang);
class_addfloat(cup_class, cup_float);
class_addmethod(cup_class, (t_method)cup_setbang, gensym("setbang"), A_DEFFLOAT, 0);}
#N canvas 0 0 450 300 10;
#X obj 87 161 cupd;
#X obj 87 94 metro 100;
#X obj 87 56 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 110 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X floatatom 87 201 5 0 0 0 - - -;
#X msg 197 102 160;
#X text 109 59 bang counts;
#X text 70 14 cupd counts up ^_^ and down _^_;
#X text 223 101 float sets next;
#X text 132 135 != 0 counts down \, 0 counts up;
#X text 69 235 aaaaah \, simplicity!;
#X connect 0 0 4 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 0 1;
#X connect 5 0 0 0;
#include "m_pd.h"
t_class *cupd_class;
typedef struct _cupd
{
t_object x_obj;
t_int f_count;
t_float f_dir, f_prevdir, firstbang, floatset;
t_outlet *count;
} t_cupd;
void cupd_float(t_cupd *y, t_floatarg f)
{
y->f_count = f;
y->floatset = 1;
}
void cupd_bang(t_cupd *y)
{
int flag = y->f_dir != y->f_prevdir ? 1 : 0;
if (flag==1&&y->firstbang==0&&y->floatset==0)
{
y->f_count += y->f_dir == 0 ? 2 : -2;
outlet_float(y->count, y->f_count);
y->f_count += y->f_dir == 0 ? 1 : -1;
}
else
{
outlet_float(y->count, y->f_count);
y->f_count += y->f_dir == 0 ? 1 : -1;
y->firstbang = y->floatset = 0;
}
y->f_prevdir = y->f_dir;
}
void cupd_setbang(t_cupd *y, t_floatarg f)
{
y->f_count = f;
outlet_float(y->count, y->f_count);
y->f_count += y->f_dir == 0 ? 1 : -1;
y->firstbang = y->floatset = 0;
y->f_prevdir = y->f_dir;
}
void *cupd_new(t_floatarg f)
{
t_cupd *y = (t_cupd *)pd_new(cupd_class);
y->f_dir = f;
y->f_count = 0;
y->firstbang = 1;
y->floatset = 0;
floatinlet_new(&y->x_obj, &y->f_dir);
y->count = outlet_new(&y->x_obj, gensym("float"));
return(void *)y;
}
void cupd_setup(void)
{
cupd_class = class_new(gensym("cupd"),
(t_newmethod)cupd_new,
0, sizeof(t_cupd),
0, A_DEFFLOAT, 0);
post("cupd counts up ^_^ and down _^_");
class_addbang(cupd_class, cupd_bang);
class_addfloat(cupd_class, cupd_float);
class_addmethod(cupd_class, (t_method)cupd_setbang, gensym("setbang"), A_DEFFLOAT, 0);}
#N canvas 1 52 450 300 10;
#X obj 138 148 doubledelta;
#X obj 139 113 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 5900 1;
#X floatatom 138 178 5 0 0 0 - - -;
#X floatatom 201 178 5 0 0 0 - - -;
#X text 87 63 delta and delta-of-delta of incoming values;
#X connect 0 0 2 0;
#X connect 0 1 3 0;
#X connect 1 0 0 0;
#include "m_pd.h"
t_class *doubledelta_class;
typedef struct _doubledelta
{
t_object x_obj;
t_float f_now, f_prev, f_delta, f_delta_prev, f_doubledelta, fa;
t_outlet *delta, *doubledelta;
} t_doubledelta;
void doubledelta_float(t_doubledelta *y, t_floatarg f)
{
y->f_delta_prev = y->f_delta;
y->f_prev = y->f_now;
y->f_now = f;
y->f_delta = y->f_now - y->f_prev;
y->f_doubledelta = y->f_delta - y->f_delta_prev;
outlet_float(y->doubledelta, y->f_doubledelta);
outlet_float(y->delta, y->f_delta);
}
void doubledelta_bang(t_doubledelta *y)
{
outlet_float(y->doubledelta, y->f_doubledelta);
outlet_float(y->delta, y->f_delta);
}
void *doubledelta_new(t_floatarg f)
{
t_doubledelta *y = (t_doubledelta *)pd_new(doubledelta_class);
y->fa = f;
y->delta = outlet_new(&y->x_obj, gensym("float"));
y->doubledelta = outlet_new(&y->x_obj, gensym("float"));
return(void *)y;
}
void doubledelta_setup(void)
{
doubledelta_class = class_new(gensym("doubledelta"),
(t_newmethod)doubledelta_new,
0, sizeof(t_doubledelta),
0, A_DEFFLOAT, 0);
post("delta & delta-delta values, <morph_2016@yahoo.co.uk>");
class_addbang(doubledelta_class, doubledelta_bang);
class_addfloat(doubledelta_class, doubledelta_float);
}
#N canvas 15 49 200 200 10;
#N canvas 25 49 420 300 META 1;
#X text 13 41 NAME ekext;
#X text 10 25 AUTHOR Ed Kelly;
#X text 10 10 VERSION 0.1.1;
#X restore 10 10 pd META;
This diff is collapsed.
This diff is collapsed.
#N canvas 184 397 913 445 10;
#N canvas 0 22 464 243 frame-scoring 0;
#X obj 61 76 inlet~;
#X obj 362 116 block~ 1024;
#X obj 61 93 rfft~;
#X obj 61 110 cartopol~;
#X obj 197 72 inlet~;
#X obj 197 89 rfft~;
#X obj 197 106 cartopol~;
#X obj 60 166 framescore~;
#X obj 60 183 outlet;
#X obj 296 149 inlet;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 3 1;
#X connect 3 0 7 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 5 1 6 1;
#X connect 6 0 7 1;
#X connect 7 0 8 0;
#X connect 9 0 7 2;
#X restore 95 210 pd frame-scoring;
#X floatatom 95 262 0 0 0 0 similarity - -;
#X obj 80 279 f;
#X obj 151 70 bng 15 250 50 0 empty empty different 0 -6 0 8 -262144
-1 -1;
#X obj 151 85 t b b;
#X obj 74 70 bng 15 250 50 0 empty empty same 0 -6 0 8 -262144 -1 -1
;
#X obj 74 85 t b b;
#X floatatom 342 165 5 1 100 0 - - -;
#X floatatom 342 196 5 0 0 1 window - -;
#X obj 342 179 / 100;
#N canvas 0 22 532 477 testinput 0;
#X obj 73 73 openpanel;
#X obj 107 23 inlet;
#X obj 107 40 sel 1 2;
#N canvas 0 22 450 300 graph20 0;
#X array test-1 325922 float 0;
#X coords 0 1 325921 -1 300 80 1;
#X restore 83 191 graph;
#N canvas 0 22 450 300 graph20 0;
#X array test-2 192058 float 0;
#X coords 0 1 192057 -1 300 80 1;
#X restore 83 282 graph;
#X msg 73 90 read -resize \$1 test-1;
#X obj 73 107 soundfiler;
#X obj 169 124 t b f;
#X obj 240 73 openpanel;
#X obj 240 107 soundfiler;
#X msg 240 90 read -resize \$1 test-2;
#X obj 169 158 / 44.1;
#X obj 169 141 min;
#X obj 213 158 outlet;
#X obj 329 124 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 329 139 outlet;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 2 1 8 0;
#X connect 5 0 6 0;
#X connect 6 0 12 0;
#X connect 7 0 12 0;
#X connect 7 1 12 1;
#X connect 8 0 10 0;
#X connect 9 0 7 0;
#X connect 9 0 14 0;
#X connect 10 0 9 0;
#X connect 11 0 13 0;
#X connect 12 0 11 0;
#X connect 14 0 15 0;
#X restore 314 48 pd testinput;
#X msg 314 31 1;
#X msg 337 31 2;
#X floatatom 314 65 0 0 0 0 shortest - -;
#X obj 314 82 / 2;
#X floatatom 314 216 0 0 0 0 - - -;
#X obj 263 216 del 500;
#N canvas 0 22 264 157 playsound 0;
#X obj 51 82 tabplay~ test-1;
#X obj 164 65 inlet;
#X obj 51 65 inlet;
#X obj 51 99 outlet~;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X restore 74 136 pd playsound;
#N canvas 0 22 264 157 playsound 0;
#X obj 51 82 tabplay~ test-1;
#X obj 153 65 inlet;
#X obj 51 65 inlet;
#X obj 51 99 outlet~;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X restore 160 136 pd playsound;
#X text 439 12 framescore~ calculates a weighted similarity value for
two signal vectors. The value is weighted proportional to amplitude
\, so that comparisons made between higher value vectors have more
effect on the output than comparisons between low value vectors.;
#X obj 337 14 r loadsamples;
#X msg 103 119 set test-1;
#X msg 233 102 set test-1;
#X msg 233 119 set test-2;
#X text 437 80 Its use is in comparing alpha vectors from an rfft~
-> cartopol~ pair \, where higher amplitude bins are weighted against
low amplitude bins. The maximum amplitude of the comparison vector
on inlet 2 is used to scale the output value so that it always gives
a score between 0 (no similarity) and 1 (identical alpha).;
#X text 434 242 start here;
#X obj 125 313 > 0.5;
#X msg 102 313 1;
#X obj 102 330 -;
#X obj 80 296 t f b f;
#X obj 80 355 spigot;
#X obj 124 355 spigot;
#X obj 124 372 print similar;
#X obj 80 389 print different;
#X msg 436 258 \; pd dsp 1 \; loadsamples bang;
#X obj 246 153 loadbang;
#X msg 246 170 1;
#X text 92 37 _Compare_;
#X text 670 244 see also;
#X obj 671 258 framespect~;
#X text 438 158 Differences between the peak levels of the two vectors
may cause similarities in peak patterns to be missed. This can be avoided
by first passing the alpha vectors through a <blocknorm~> object from
the <creb> library.;
#X text 3 210 HERE it is-->;
#X obj 671 278 simile~;
#X obj 671 298 simile;
#X obj 671 318 hssc~;
#X text 438 210 Alternatively the object may be used to compare any
positive pair of vectors block-by-block.;
#X connect 0 0 1 0;
#X connect 1 0 2 1;
#X connect 2 0 29 0;
#X connect 3 0 4 0;
#X connect 4 0 16 0;
#X connect 4 0 18 0;
#X connect 4 0 17 0;
#X connect 4 1 23 0;
#X connect 4 1 21 0;
#X connect 5 0 6 0;
#X connect 6 0 16 0;
#X connect 6 0 17 0;
#X connect 6 0 18 0;
#X connect 6 1 21 0;
#X connect 6 1 22 0;
#X connect 7 0 9 0;
#X connect 8 0 0 2;
#X connect 9 0 8 0;
#X connect 10 0 13 0;
#X connect 10 1 11 0;
#X connect 11 0 10 0;
#X connect 12 0 10 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 16 1;
#X connect 16 0 2 0;
#X connect 17 0 0 0;
#X connect 18 0 0 1;
#X connect 20 0 12 0;
#X connect 21 0 17 1;
#X connect 22 0 18 1;
#X connect 23 0 18 1;
#X connect 26 0 28 1;
#X connect 26 0 31 1;
#X connect 27 0 28 0;
#X connect 28 0 30 1;
#X connect 29 0 30 0;
#X connect 29 0 31 0;
#X connect 29 1 27 0;
#X connect 29 2 26 0;
#X connect 30 0 33 0;
#X connect 31 0 32 0;
#X connect 35 0 36 0;
#X connect 36 0 7 0;
/*
* framescore~ : Weighted block comparison.
* Copyright (C) 2005 Edward Kelly <morph_2016@yahoo.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "m_pd.h"
static t_class *framescore_tilde_class;
typedef struct _framescore_tilde
{
t_object x_obj;
t_float f;
t_float f_max, f_win, f_accum;
t_outlet *f_score;
} t_framescore_tilde;
t_int *framescore_tilde_perform(t_int *w)
{
t_framescore_tilde *x = (t_framescore_tilde *)(w[1]);
t_sample *in1 = (t_sample *)(w[2]);
t_sample *in2 = (t_sample *)(w[3]);
int n = (int)(w[4]);
float vector1;
float vector2;
x->f_accum = 0;
float block_accum = 0;
x->f_max = 0;
float score = 0;
float avg = 0;
int block = n;
x->f_win = x->f_win > 0 ? x->f_win : 0.01;
while (n--)
{
vector1 = (*in1++);
vector2 = (*in2++);
vector1 = vector1 > 0 ? vector1 : 0 - vector1;
vector2 = vector2 > 0 ? vector2 : 0 - vector2;
block_accum += vector2;
x->f_max = vector2 > x->f_max ? vector2 : x->f_max;
float diff = vector1 > vector2 ? vector1 - vector2 : vector2 - vector1;
x->f_accum += (1/((diff/x->f_win)+1)) * vector2;
}
score = x->f_accum / x->f_max;
block_accum /= x->f_max;
avg = score / block_accum;
outlet_float(x->f_score, avg);
return(w+5);
}
void framescore_tilde_dsp(t_framescore_tilde *x, t_signal **sp)
{
dsp_add(framescore_tilde_perform, 4, x,
sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
}
void *framescore_tilde_new(t_floatarg f)
{
t_framescore_tilde *x = (t_framescore_tilde *)pd_new(framescore_tilde_class);
x->f_win = f;
inlet_new (&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal);
floatinlet_new (&x->x_obj, &x->f_win);
x->f_score = outlet_new(&x->x_obj, gensym("float"));
return (void *)x;
}
void framescore_tilde_setup(void)
{
framescore_tilde_class = class_new(gensym("framescore~"),
(t_newmethod)framescore_tilde_new,
0, sizeof(t_framescore_tilde),
CLASS_DEFAULT, A_DEFFLOAT, 0);
post("|+++++++++++framescore~+++++++++++++|");
post("|+++++weighted block comparison+++++|");
post("|+++edward+++++++kelly+++++++2005+++|");
class_addmethod(framescore_tilde_class, (t_method)framescore_tilde_dsp,
gensym("dsp"), 0);
CLASS_MAINSIGNALIN(framescore_tilde_class, t_framescore_tilde, f);
}
#N canvas 109 303 913 445 10;
#N canvas 0 22 468 247 frame-scoring 0;
#X obj 61 76 inlet~;
#X obj 362 116 block~ 1024;
#X obj 61 93 rfft~;
#X obj 197 72 inlet~;
#X obj 197 89 rfft~;
#X obj 60 183 outlet;
#X obj 295 150 inlet;
#X obj 60 166 framespect~;
#X connect 0 0 2 0;
#X connect 2 0 7 0;
#X connect 2 1 7 1;
#X connect 3 0 4 0;
#X connect 4 0 7 2;
#X connect 4 1 7 3;
#X connect 6 0 7 4;
#X connect 7 0 5 0;
#X restore 95 210 pd frame-scoring;
#X floatatom 95 262 0 0 0 0 similarity - -;
#X obj 80 279 f;
#X obj 151 70 bng 15 250 50 0 empty empty different 0 -6 0 8 -262144
-1 -1;
#X obj 151 85 t b b;
#X obj 74 70 bng 15 250 50 0 empty empty same 0 -6 0 8 -262144 -1 -1
;
#X obj 74 85 t b b;
#X floatatom 342 165 5 1 100 0 - - -;
#X floatatom 342 196 5 0 0 1 window - -;
#X obj 342 179 / 100;
#N canvas 0 22 532 477 testinput 0;
#X obj 73 73 openpanel;
#X obj 107 23 inlet;
#X obj 107 40 sel 1 2;
#N canvas 0 22 450 300 graph20 0;
#X array test-1 325922 float 0;
#X coords 0 1 325921 -1 300 80 1;
#X restore 83 191 graph;
#N canvas 0 22 450 300 graph20 0;
#X array test-2 192058 float 0;
#X coords 0 1 192057 -1 300 80 1;
#X restore 83 282 graph;
#X msg 73 90 read -resize \$1 test-1;
#X obj 73 107 soundfiler;
#X obj 169 124 t b f;
#X obj 240 73 openpanel;
#X obj 240 107 soundfiler;
#X msg 240 90 read -resize \$1 test-2;
#X obj 169 158 / 44.1;
#X obj 169 141 min;
#X obj 213 158 outlet;
#X obj 329 124 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 329 139 outlet;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 2 1 8 0;
#X connect 5 0 6 0;
#X connect 6 0 12 0;
#X connect 7 0 12 0;
#X connect 7 1 12 1;
#X connect 8 0 10 0;
#X connect 9 0 7 0;
#X connect 9 0 14 0;
#X connect 10 0 9 0;
#X connect 11 0 13 0;
#X connect 12 0 11 0;
#X connect 14 0 15 0;
#X restore 314 48 pd testinput;
#X msg 314 31 1;
#X msg 337 31 2;
#X floatatom 314 65 0 0 0 0 shortest - -;
#X obj 314 82 / 2;
#X floatatom 314 216 0 0 0 0 - - -;
#X obj 263 216 del 500;
#N canvas 0 22 264 157 playsound 0;
#X obj 51 82 tabplay~ test-1;
#X obj 164 65 inlet;
#X obj 51 65 inlet;
#X obj 51 99 outlet~;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X restore 74 136 pd playsound;
#N canvas 0 22 264 157 playsound 0;
#X obj 51 82 tabplay~ test-1;
#X obj 153 65 inlet;
#X obj 51 65 inlet;
#X obj 51 99 outlet~;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X restore 160 136 pd playsound;
#X text 439 12 framescore~ calculates a weighted similarity value for
two signal vectors. The value is weighted proportional to amplitude
\, so that comparisons made between higher value vectors have more
effect on the output than comparisons between low value vectors.;
#X obj 337 14 r loadsamples;
#X msg 103 119 set test-1;
#X msg 233 102 set test-1;
#X msg 233 119 set test-2;
#X text 434 242 start here;
#X obj 125 313 > 0.5;
#X msg 102 313 1;
#X obj 102 330 -;
#X obj 80 296 t f b f;
#X obj 80 355 spigot;
#X obj 124 355 spigot;
#X obj 124 372 print similar;
#X obj 80 389 print different;
#X msg 436 258 \; pd dsp 1 \; loadsamples bang;
#X obj 246 153 loadbang;
#X msg 246 170 1;
#X text 92 37 _Compare_;
#X text 437 80 Its use is in comparing alpha vectors from an rfft~
object where higher amplitude bins are weighted against low amplitude
bins. The maximum amplitude of the comparison vector on inlets 3+4
is used to scale the output value so that it always gives a score between
0 (no similarity) and 1 (identical alpha).;
#X text 672 243 see also;
#X obj 671 258 framescore~;
#X text 3 210 HERE it is-->;
#X obj 671 278 simile~;
#X obj 671 298 simile;
#X obj 671 318 hssc~;
#X text 438 158 Differences between the peak levels of the two vectors
may cause similarities in peak patterns to be missed. Since the cartesian-to-polar
conversion is done internally to the object \, <blocknorm~> may not
be used in the same way as it can with <framescore~> \, but since the
phase is not calculated as it is in <cartopol~> it is marginally less
CPU-intensive.;
#X connect 0 0 1 0;
#X connect 1 0 2 1;
#X connect 2 0 28 0;
#X connect 3 0 4 0;
#X connect 4 0 16 0;
#X connect 4 0 18 0;
#X connect 4 0 17 0;
#X connect 4 1 23 0;
#X connect 4 1 21 0;
#X connect 5 0 6 0;
#X connect 6 0 16 0;
#X connect 6 0 17 0;
#X connect 6 0 18 0;
#X connect 6 1 21 0;
#X connect 6 1 22 0;