Imported Upstream version 2.5.2.git20121005

parents
This software is released under the MIT License, as described here:
http://www.opensource.org/licenses/mit-license.php
and here: http://tinyurl.com/y6u53r
-EL
*******************************************************************
FFTease is Copyright (c) 1999-2008 Eric Lyon and Christopher Penrose
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.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
/* choose your poison */
#define MSP (0)
#define PD (!MSP)
/* for compiling under XP */
#ifndef PIOVERTWO
#define PIOVERTWO 1.5707963268
#define TWOPI 6.2831853072
#endif
#if MSP
#include "ext.h"
#include "z_dsp.h"
#include "buffer.h"
#include "ext_obex.h"
#define t_floatarg double
#endif
#if PD
#include "m_pd.h"
#define t_floatarg float
#endif
/* because Max and Pd have different ideas of what A_FLOAT is, use t_floatarg
to force consistency. Otherwise functions that look good will fail on some
hardware. Also note that Pd messages cannot accept arguments of type A_LONG. */
This diff is collapsed.
#include <math.h>
#include "PenroseOscil.h"
float frequencyToIncrement( float samplingRate, float frequency, int bufferLength ) {
return (frequency / samplingRate) * (float) bufferLength;
}
void makeSineBuffer( float *buffer, int bufferLength ) {
int i;
float myTwoPi = 8. * atan(1.);
for ( i=0; i <= bufferLength; i++ )
*(buffer+i) = sin( myTwoPi * ((float) i / (float) bufferLength) );
return;
}
float bufferOscil( float *phase, float increment, float *buffer,
int bufferLength )
{
float sample;
while ( *phase > bufferLength )
*phase -= bufferLength;
while ( *phase < 0. )
*phase += bufferLength;
sample = *( buffer + (int) (*phase) );
*phase += increment;
return sample;
}
float frequencyToIncrement( float samplingRate, float frequency,
int bufferLength );
void makeSineBuffer( float *buffer, int bufferLength );
float bufferOscil( float *phase, float increment, float *buffer,
int bufferLength );
#include "PenroseRand.h"
float rrand(int *seed)
{
int i = ((*seed = *seed * 1103515245 + 12345)>>16) & 077777;
return((float)i/16384. - 1.);
}
float prand(int *seed)
{
int i = ((*seed = *seed * 1103515245 + 12345)>>16) & 077777;
return((float)i/32768.);
}
float rrand(int *seed);
float prand(int *seed);
FFTease 2.5 by Eric Lyon and Christopher Penrose
This is the third release of FFTease, a set of live spectral sound processors for Max/MSP and Pd. This Pd distribution is compiled for Linux, OS X, and Windows. Move the appropriate set of binaries from "bin" to the Pd "extra" folder. Move the contents of "help" to the Pd "doc/5.reference" directory. You are now ready to use FFTease.
Caveat: these objects are CPU intensive. A few of these objects in a patch could push your computer to its limits. Be very careful with playback volume as some of the objects produce dramatically different (lower or higher) overall levels.
The FFT size, which must be a power of 2, is calculated relative to the Pd block size. It is recommended to use FFTease externals in a sub-patch that contains a block~ object, granting you control of the local block size, and thus FFT size. A larger block size results in a larger FFT size. Don't expect a great savings in CPU usage with smaller block sizes. But do expect increased CPU load as you crank the block size up. A block size of 256, with a default overlap of 4 gives an FFT size of 1024 that works acceptably well in many cases. With some of these objects, an even smaller block size/FFT size can actually work better. See the abstraction "fftease-system.pd" for more information on how to control these parameters.
Acknowledgements: This work draws heavily on the phase vocoder code presented by F. Richard Moore in his classic "Elements of Computer Music." Additional inspiration was derived from work on cross synthesis and noise reduction by Mark Dolson at CARL in the mid-1980s. We also wish to thank Miller Puckette and David Zicarelli for designing and implementing the framework under which FFTease is presented.
The authors would like to warmly acknowledge the support of the following institutions: Brown University, Dartmouth College, IAMAS, Keio University, the University of Manchester, and Queen's University Belfast.
FFTease is copyright 2000-2009 Eric Lyon and Christopher Penrose. FFTease is released under the MIT license.
Eric Lyon
e.lyon@qub.ac.uk
Christopher Penrose
penrose@silvertone.princeton.edu
#N canvas 111 157 450 300 10;
#X obj 102 144 ampdb;
#X floatatom 102 119 5 0 0 0 - - -;
#X obj 105 94 hsl 128 15 -150 0 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X floatatom 102 178 10 0 0 0 - - -;
#X text 46 49 convert negative decibels (dB) to amplitude between 0
and 1;
#X text 166 117 input range is roughly -150 to 0;
#X text 179 178 output range is 0 to 1;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#N canvas 945 219 212 299 10;
#X obj 32 107 pow;
#X obj 32 64 t b f;
#X msg 32 83 10;
#X obj 54 170 /;
#X obj 32 127 t b f;
#X msg 32 148 1;
#X obj 32 41 * -0.05;
#X obj 32 19 inlet;
#X obj 54 193 outlet;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 1 1 0 1;
#X connect 2 0 0 0;
#X connect 3 0 8 0;
#X connect 4 0 5 0;
#X connect 4 1 3 1;
#X connect 5 0 3 0;
#X connect 6 0 1 0;
#X connect 7 0 6 0;
#include "fftease.h" void bloscbank( float *S, float *O, int D, float iD, float *lf, float *la, float *index, float *tab, int len, float synt, int lo, int hi ) { int amp,freq,chan, i; float a,ainc,f,finc,address; for ( chan = lo; chan < hi; chan++ ) { freq = ( amp = ( chan << 1 ) ) + 1; if ( S[amp] > synt ){ finc = ( S[freq] - ( f = lf[chan] ) )* iD; ainc = ( S[amp] - ( a = la[chan] ) )* iD; address = index[chan]; for ( i = 0; i < D ; i++ ) { O[i] += a*tab[ (int) address ]; address += f; while ( address >= len ) address -= len; while ( address < 0 ) address += len; a += ainc; f += finc; } lf[chan] = S[freq]; la[chan] = S[amp]; index[chan] = address; } } }
\ No newline at end of file
#N canvas 609 64 625 468 10;
#N canvas 0 22 478 328 bthresher-block 0;
#X obj 177 189 block~ 256;
#X obj 188 161 outlet~;
#X obj 344 173 outlet;
#X obj 188 40 inlet~;
#X obj 266 65 inlet;
#X obj 344 69 inlet;
#X obj 391 101 inlet;
#X obj 188 117 bthresher~ 0.1 0.97 4 1;
#X connect 3 0 7 0;
#X connect 4 0 7 1;
#X connect 5 0 7 2;
#X connect 6 0 7 0;
#X connect 7 0 1 0;
#X connect 7 1 2 0;
#X restore 154 133 pd bthresher-block;
#X obj 154 206 dac~;
#X obj 154 34 noise~;
#N canvas 613 44 522 372 messages 0;
#X obj 32 248 outlet;
#N canvas 314 293 617 400 individual-bin-control 0;
#X obj 23 363 outlet;
#X obj 220 97 pack f f f;
#X floatatom 220 48 5 0 0 1 bin_number - -;
#X floatatom 252 62 5 0 0 1 damping_factor - -;
#X floatatom 285 78 5 0 0 1 threshold - -;
#X text 23 29 format:;
#X msg 153 241 0 0.968693 0.124173 1 0.968693 0.124173 2 0.968693 0.124173
3 0.968693 0.124173 4 0.968693 0.124173 5 0.93 0.01 6 0.93 0.01 7 0.93
0.01 8 0.93 0.01 9 0.93 0.01 10 0.93 0.01 11 0.93 0.01 12 0.93 0.1
13 0.93 0.1 14 0.93 0.1 15 0.93 0.1 16 0.93 0.1 17 0.968693 0.124173
18 0.968693 0.124173 19 0.968693 0.124173 20 0.968693 0.124173;
#X msg 23 56 bin 5 0.93 0.01;
#X text 23 41 bin # \, damping \, threshold;
#X msg 220 139 bin \$1 \$2 \$3;
#X text 153 223 or send raw data controlling many bins from a list
;
#X text 23 17 affect a single bin;
#X text 219 31 construct bin message from components;
#X connect 1 0 9 0;
#X connect 2 0 1 0;
#X connect 3 0 1 1;
#X connect 4 0 1 2;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 9 0 0 0;
#X restore 32 20 pd individual-bin-control;
#N canvas 0 22 498 348 global-bin-control 0;
#X msg 253 203 alldamp \$1;
#X msg 221 105 allthresh \$1;
#X floatatom 221 73 5 0 0 0 - allthresh -;
#X floatatom 253 181 5 0 0 0 - alldamp -;
#X obj 221 238 outlet;
#X obj 62 90 vsl 15 128 0 0.2 0 0 allthresh allthresh-init allthresh
0 -8 0 8 -117632 -1 -1 6985 1;
#X obj 117 90 vsl 15 128 0 1.1 0 0 alldamp alldamp-init alldamp 0 -8
0 8 -117632 -1 -1 11084 1;
#X connect 0 0 4 0;
#X connect 1 0 4 0;
#X connect 2 0 1 0;
#X connect 3 0 0 0;
#X restore 69 113 pd global-bin-control;
#N canvas 0 22 494 344 random-bin-control 0;
#X obj 8 105 outlet;
#X text 4 33 format: min max;
#X msg 8 50 rthreshold 0.05 0.7;
#X msg 149 49 rdamper 0.8 0.999;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X restore 60 78 pd random-bin-control;
#X text 222 21 <- start here;
#N canvas 444 60 502 352 system 0;
#X obj 26 268 outlet;
#X text 122 87 arg must be power of 2;
#X obj 26 19 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X msg 26 43 mute \$1;
#X msg 124 103 overlap 4;
#X msg 124 122 overlap 2;
#X text 193 124 <- cuts CPU demand in half;
#X text 197 105 <- default;
#X msg 134 252 fftinfo;
#X msg 140 185 winfac 1;
#X text 136 166 relative size of input window to FFT;
#X msg 210 186 winfac 2;
#X connect 2 0 3 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 8 0 0 0;
#X connect 9 0 0 0;
#X connect 11 0 0 0;
#X restore 83 158 pd system;
#X msg 197 189 dump;
#X text 195 172 with a list message;
#X text 195 145 output current state;
#X text 196 159 which can then be reloaded;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X restore 275 97 pd messages;
#X msg 79 242 \; pd dsp \$1;
#X obj 79 221 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X obj 154 163 *~ 0.2;
#X floatatom 194 70 5 0 0 0 - scale-thresh -;
#X floatatom 234 95 5 0 0 0 - scale-damping -;
#X obj 191 268 hsl 128 15 0 2 0 0 scale-thresh slider-init scale-thresh
-2 -6 0 8 -258369 -1 -1 6350 1;
#X obj 191 302 hsl 128 15 0 2 0 0 scale-damping slider-init scale-damping
-2 -6 0 8 -258369 -1 -1 6350 1;
#N canvas 137 230 511 492 capture 0;
#X obj 8 12 inlet;
#X text 20 173 clear;
#X msg 8 237 0 0.960032 0.11 1 0.960032 0.11 2 0.960032 0.11 3 0.960032
0.11 4 0.960032 0.11 5 0.960032 0.11 6 0.960032 0.11 7 0.960032 0.11
8 0.960032 0.11 9 0.960032 0.11 10 0.960032 0.11 11 0.960032 0.11 12
0.960032 0.11 13 0.960032 0.11 14 0.960032 0.11 15 0.960032 0.11 16
0.960032 0.11 17 0.960032 0.11 18 0.960032 0.11 19 0.960032 0.11 0
0.838661 0.383391 1 0.85394 0.349312 2 0.963181 0.277742 3 0.863287
0.111771 4 0.871333 0.331876 5 0.940383 0.510999 6 0.94973 0.125378
7 0.992569 0.100742 8 0.80563 0.290001 9 0.943857 0.0718399 10 0.971641
0.17489 11 0.928632 0.356374 12 0.871212 0.144183 13 0.933891 0.516592
14 0.918071 0.480113 15 0.851894 0.330705 16 0.97568 0.339909 17 0.98587
0.380415 18 0.859807 0.39325 19 0.839784 0.422369 0 0.838661 0.383391
1 0.85394 0.349312 2 0.963181 0.277742 3 0.863287 0.111771 4 0.871333
0.331876 5 0.940383 0.510999 6 0.94973 0.125378 7 0.992569 0.100742
8 0.80563 0.290001 9 0.943857 0.0718399 10 0.971641 0.17489 11 0.928632
0.356374 12 0.871212 0.144183 13 0.933891 0.516592 14 0.918071 0.480113
15 0.851894 0.330705 16 0.97568 0.339909 17 0.98587 0.380415 18 0.859807
0.39325 19 0.839784 0.422369;
#X msg 23 191 set;
#X text 82 15 capture (some) list output from 'dump' message;
#X msg 8 59 add2 \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 \$9 \$10 \$11 \$12
\$13 \$14 \$15 \$16 \$17 \$18 \$19 \$20 \$21 \$22 \$23 \$24 \$25 \$26
\$27 \$28 \$29 \$30 \$31 \$32 \$33 \$34 \$35 \$36 \$37 \$38 \$39 \$40
\$41 \$42 \$43 \$44 \$45 \$46 \$47 \$48 \$49 \$50 \$51 \$52 \$53 \$54
\$55 \$56 \$57 \$58 \$59 \$60;
#X text 86 118 The "dump" message outputs the current state of bthresher~
as a series of triplets [bin# \, damp factor \, threshold]. This data
can be captured as a list and reloaded to itself or any other bthresher~
unit. In this example we only show the first twenty triplets. Since
there are potentially as many as N/2 triplets where N is the FFT size
\, you would need to modify this subpatch to capture all the information
of the current state of bthresher~. (A version of Pd with the "prepend"
object would make your life easier here.);
#X connect 0 0 5 0;
#X connect 3 0 2 0;
#X connect 5 0 2 0;
#X restore 275 159 pd capture;
#N canvas 0 22 470 320 initialize 0;
#X obj 38 150 s slider-init;
#X msg 38 85 1;
#X obj 38 51 loadbang;
#X obj 142 150 s allthresh-init;
#X obj 265 150 s alldamp-init;
#X msg 265 83 0.96;
#X msg 142 83 0.11;
#X obj 142 41 inlet;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 2 0 6 0;
#X connect 2 0 5 0;
#X connect 5 0 4 0;
#X connect 6 0 3 0;
#X connect 7 0 1 0;
#X connect 7 0 6 0;
#X connect 7 0 5 0;
#X restore 399 270 pd initialize;
#X text 364 97 <- click me to learn more;
#X obj 399 245 loadbang;
#X text 50 336 bthresher~ extends the thresher~ model to allow independent
control over the parameters of each individual bin. You can also randomly
set damping and threshold values \, and can dump the current values
(to possibly send as input to another bthresher~ unit). It is recommended
that you familiarize yourself with thresher~ before exploring the more
complicated bthresher~.;
#X text 182 52 threshold scale factor;
#X text 237 80 damping scale factor;
#X text 351 160 <- state captured here;
#X connect 0 0 6 0;
#X connect 0 1 11 0;
#X connect 2 0 0 0;
#X connect 3 0 0 3;
#X connect 5 0 4 0;
#X connect 6 0 1 0;
#X connect 6 0 1 1;
#X connect 7 0 0 1;
#X connect 8 0 0 2;
#X connect 14 0 12 0;
This diff is collapsed.
#N canvas 579 109 517 612 10;
#N canvas 590 312 458 308 burrow-block 0;
#X obj 160 154 burrow~;
#X obj 160 39 inlet~;
#X obj 174 72 inlet~;
#X obj 189 99 inlet;
#X obj 204 120 inlet;
#X obj 160 209 outlet~;
#X obj 270 186 block~ 256;
#X obj 303 124 inlet;
#X connect 0 0 5 0;
#X connect 1 0 0 0;
#X connect 2 0 0 1;
#X connect 3 0 0 2;
#X connect 4 0 0 3;
#X connect 7 0 0 0;
#X restore 93 227 pd burrow-block;
#X obj 93 42 noise~;
#X obj 118 82 noise~;
#X obj 118 129 bp~ 500 50;
#X text 90 25 sound to filter;
#X text 115 66 sound to provide filter shape;
#X obj 93 269 *~ 1;
#X obj 93 304 dac~;
#X msg 352 411 \; pd dsp \$1;
#X obj 352 394 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X floatatom 116 251 5 0 0 0 - burrow-gain -;
#X obj 151 313 hsl 128 15 0 0.2 0 0 burrow-gain empty output_gain -2
-6 0 8 -182539 -1 -1 3175 1;
#X floatatom 143 150 5 0 0 0 - burrow-threshold -;
#X floatatom 168 170 5 0 0 0 - burrow-multiplier -;
#N canvas 0 22 505 427 messages 0;
#X obj 162 351 outlet;
#X msg 162 253 invert \$1;
#X obj 162 227 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X text 59 49 When invert is turned on \, the spectrum of the filter
sound becomes the shape of the filter. Although this might seem more
intuitive \, and thus a better candidate for default behavior \, recall
that the external is called "burrow~" which is what it does.;
#N canvas 380 158 454 304 system 0;
#X obj 201 186 outlet;
#X msg 93 128 overlap \$1;
#X msg 84 96 2;
#X msg 118 96 4;
#X obj 298 44 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X msg 298 70 mute \$1;
#X msg 302 132 fftinfo;
#X msg 145 47 2;
#X msg 179 47 4;
#X msg 154 79 winfac \$1;
#X msg 109 46 1;
#X text 25 235 Try different combos of window factor and overlap. Lower
overlap requires less CPU.;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 1 0;
#X connect 4 0 5 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 9 0;
#X connect 8 0 9 0;
#X connect 9 0 0 0;
#X connect 10 0 9 0;
#X restore 182 305 pd system;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 4 0 0 0;
#X restore 193 197 pd messages;
#X obj 153 348 hsl 128 15 0.0001 0.01 0 0 burrow-threshold empty threshold
-2 -6 0 8 -182539 -1 -1 3720 1;
#X obj 154 381 hsl 128 15 0.001 1 0 0 burrow-multiplier empty multiplier
-2 -6 0 8 -182539 -1 -1 114 1;
#X floatatom 150 103 5 0 0 0 - bp-center-freq -;
#X obj 154 412 hsl 128 15 100 1500 0 0 bp-center-freq empty center-freq
-2 -6 0 8 -182539 -1 -1 8164 1;
#X floatatom 205 103 5 0 0 0 - bp-resonance -;
#X obj 153 442 hsl 128 15 10 100 0 0 bp-resonance empty resonance -2
-6 0 8 -182539 -1 -1 12700 1;
#X text 12 476 The sound in the leftmost inlet gets filtered by the
spectrum of the sound in the next inlet \, except that by default this
spectrum is cut out from (or burrows into) the source sound. We use
noise sources here to highlight the effect but it is recommended to
use much more interesting sounds as one or both of the inputs. In this
example \, with bandpassed noise as the filter sound \, the result
is to create a notch in the source noise \, similar but inverse to
the shape of the bandpass peak band.;
#N canvas 0 22 462 312 init 0;
#X obj 92 140 unpack f f f f f;
#X obj 92 95 loadbang;
#X obj 92 195 outlet;
#X obj 110 234 outlet;
#X obj 131 276 outlet;
#X obj 165 256 outlet;
#X obj 213 246 outlet;
#X obj 197 71 inlet;
#X msg 92 117 0.05 0.003 0.01 100 1000;
#X connect 0 0 2 0;
#X connect 0 1 3 0;
#X connect 0 2 4 0;
#X connect 0 3 5 0;
#X connect 0 4 6 0;
#X connect 1 0 8 0;
#X connect 7 0 8 0;
#X connect 8 0 0 0;
#X restore 94 381 pd init;
#X obj 94 364 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X connect 0 0 6 0;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 3 0 0 1;
#X connect 6 0 7 0;
#X connect 6 0 7 1;
#X connect 9 0 8 0;
#X connect 10 0 6 1;
#X connect 12 0 0 2;
#X connect 13 0 0 3;
#X connect 14 0 0 4;
#X connect 17 0 3 1;
#X connect 19 0 3 2;
#X connect 22 0 11 0;
#X connect 22 1 15 0;
#X connect 22 2 16 0;
#X connect 22 3 20 0;
#X connect 22 4 18 0;
#X connect 23 0 22 0;
This diff is collapsed.
#N canvas 323 304 466 316 10;
#N canvas 0 22 462 312 cavoc27-block 0;
#X obj 141 110 cavoc27~ 0.05 200 4 1;
#X obj 141 61 inlet~;
#X obj 141 156 outlet~;
#X obj 255 78 inlet;
#X obj 142 212 block~ 256;
#X text 89 187 args: density \, holdtime \, overlap \, winfac;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 3 0 0 0;
#X restore 146 109 pd cavoc27-block;
#N canvas 0 22 478 328 messages 0;
#X obj 111 220 outlet;
#N canvas 0 22 466 316 rules 0;
#X obj 15 181 outlet;
#X msg 2 36 rule 1 0 1 0 0 0 1 0 0 1 2 1 0 2 0 2 0 0 1 0 2 0 2 1 2
1 1;
#X msg 9 58 rule 0 2 1 0 0 1 0 0 0 1 1 2 0 1 2 1 1 1 1 0 0 0 1 1 0
1 1;
#X msg 28 88 rule 2 2 0 1 0 2 1 1 0 2 1 2 0 1 1 2 0 2 2 1 2 1 1 2 0
0 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X restore 111 134 pd rules;
#N canvas 520 382 466 316 messages 0;
#X obj 59 290 outlet;
#X msg 308 110 interpolate \$1;
#X obj 308 87 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X msg 199 241 hold_time \$1;
#X floatatom 199 212 5 0 0 0 - - -;
#X floatatom 305 211 5 0 0 0 - - -;
#X msg 305 242 density \$1;
#X msg 61 37 retune 0.5 2;
#X obj 89 68 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X msg 89 92 capture_spectrum \$1;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 0 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 9 0;
#X connect 9 0 0 0;
#X restore 180 134 pd messages;
#X obj 273 135 fftease-system;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X restore 253 81 pd messages;
#X obj 146 208 dac~;
#X msg 287 201 \; pd dsp \$1;
#X obj 287 176 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 200 147 hsl 128 15 0 0.01 0 0 empty empty output_gain -2 -6
0 10 -245150 -1 -1 0 1;
#N canvas 0 22 462 312 example-input-spectrum 0;
#X obj 114 228 outlet~;
#X obj 62 124 phasor~ 100;
#X obj 145 124 phasor~ 125;
#X obj 231 125 phasor~ 150;
#X obj 114 175 *~ 0.333;
#X text 26 89 this gets sampled when "capture_spectrum" is on;
#X connect 1 0 4 0;
#X connect 2 0 4 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X restore 146 48 pd example-input-spectrum;
#X text 341 82 <- info;
#X floatatom 197 168 5 0 0 0 - - -;
#X obj 146 185 *~ 0.001;
#X text 21 256 27 rule cellular automata (CA). New rules lists have
27 values (0 \, 1 \, or 2). Start with VERY low gain. See cavoc~ for
a simpler implementation of CA-generated spectra.;
#X connect 0 0 9 0;
#X connect 1 0 0 1;
#X connect 4 0 3 0;
#X connect 5 0 8 0;
#X connect 6 0 0 0;
#X connect 8 0 9 1;
#X connect 9 0 2 0;
#X connect 9 0 2 1;
This diff is collapsed.
#N canvas 674 329 486 336 10;
#N canvas 172 264 478 328 cavoc-block 0;
#X obj 161 176 block~ 256;
#X obj 167 155 outlet~;
#X obj 292 69 inlet;
#X obj 167 111 cavoc~ 0.05 150 4 1;
#X text 133 127 args: density holdtime \, overlap \, window factor
;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X restore 29 72 pd cavoc-block;
#X obj 29 143 dac~;
#X msg 29 208 \; pd dsp \$1;
#X obj 29 186 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X floatatom 80 96 5 0 0 0 - gain -;
#X obj 32 261 hsl 128 15 0 1 0 0 gain gain-init gain -2 -6 0 8 -261127
-1 -1 0 1;
#N canvas 773 396 486 336 messages 0;
#X obj 120 243 outlet;
#N canvas 321 426 474 324 rules 0;
#X obj 55 273 outlet;
#X msg 59 71 rule 1 1 1 1 0 0 0 0;
#X msg 213 72 rule 1 0 1 0 1 0 1 0;
#X msg 203 122 rule 0 0 0 0 0 1 0 1;
#X msg 203 149 rule 0 1 1 0 1 0 0 1;
#X msg 203 194 rule 0 0 0 0 1 1 1 1;
#X msg 90 34 rule 1 1 0 1 0 1 0 0;
#X msg 265 23 rule 1 1 0 1 0 1 1 0;
#X msg 300 51 rule 1 1 0 0 1 1 0 0;
#X msg 294 94 rule 0 0 1 0 1 0 1 1;
#X msg 204 234 rule 0 0 0 1 1 0 0 0;
#X msg 244 265 rule 1 0 0 1 1 0 0 1;
#X text 38 301 rules define CA evolution of spectrum;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X connect 9 0 0 0;
#X connect 10 0 0 0;
#X connect 11 0 0 0;
#X restore 250 227 pd rules;
#N canvas 687 59 486 336 system 0;
#X obj 209 277 outlet;
#X msg 132 162 fftinfo;
#X msg 64 181 mute \$1;
#X obj 64 154 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X msg 215 121 overlap \$1;
#X msg 249 161 winfac \$1;
#X floatatom 215 91 5 0 0 0 - - -;
#X floatatom 249 142 5 0 0 0 - - -;
#X text 243 240 default: overlap=4 \, winfac=1;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 2 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 4 0;
#X connect 7 0 5 0;
#X restore 41 177 pd system;
#X floatatom 292 77 5 0 0 0 - - -;
#X msg 291 101 density \$1;
#X msg 251 44 0.05;
#X msg 105 126 retune 0.5 2;
#X msg 303 42 0.2;
#X floatatom 316 163 5 0 0 0 - - -;
#X msg 316 181 hold_time \$1;
#X text 311 228 <- CA rules;
#X text 220 149 hold time (in ms) for each step of CA;
#X text 109 21 density is percent of bins turned on at start of CA
;
#X text 96 102 reset phase "tunings";
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X connect 5 0 4 0;
#X connect 6 0 0 0;
#X connect 7 0 3 0;
#X connect 8 0 9 0;
#X connect 9 0 0 0;
#X restore 29 38 pd messages;
#X obj 29 115 *~ 0.025;
#X text 27 290 cavoc~ is an 8 rule cellular automaton that generates
spectra. Start with very low gain.;
#X connect 0 0 7 0;
#X connect 3 0 2 0;
#X connect 4 0 7 1;
#X connect 6 0 0 0;
#X connect 7 0 1 0;
#X connect 7 0 1 1;
This diff is collapsed.
#N canvas 281 24 648 434 10;
#N canvas 376 316 462 312 centerring-block 0;
#X obj 163 128 centerring~;
#X obj 233 219 block~ 256;
#X obj 152 180 outlet~;
#X obj 141 63 inlet~;
#X obj 337 89 inlet;
#X obj 195 67 inlet;
#X obj 242 66 inlet;
#X obj 290 71 inlet;
#X connect 0 0 2 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 1;
#X connect 6 0 0 2;
#X connect 7 0 0 3;
#X restore 167 141 pd centerring-block;
#X obj 167 195 *~ 1;
#X obj 167 230 dac~;
#X floatatom 190 176 5 0 0 0 - centerring-gain -;
#X msg 333 242 \; pd dsp \$1;
#X obj 333 225 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 18 207 hsl 128 15 0 0.1 0 0 centerring-gain empty output_gain
-2 -6 0 8 -79789 -1 -1 800 1;
#X obj 81 51 phasor~ 150;
#N canvas 0 22 474 324 messages 0;
#X obj 159 192 outlet;
#X msg 154 138 zerophases;
#X msg 263 138 randphases;
#X msg 71 101 seed \$1;
#X floatatom 70 71 5 0 0 0 - - -;
#X msg 117 65 1974;
#X obj 320 168 fftease-system;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 3 0;
#X connect 5 0 3 0;
#X connect 6 0 0 0;
#X restore 319 108 pd messages;