Commit 52dca0f9 authored by Miller Puckette's avatar Miller Puckette
Browse files

set up git repository

parents
# This is a qlist for patch number 68, which demonstrates an oscillator
bank.
;
# comments start with a "#" which must be followed by a space. The comment
is terminated by a semicolon like this: ;
# first an arpeggio. You can group them in lines as you please. The 100s at
the beginnings of lines are delay times. ;
pit1 89; amp1 80;
100 pit2 72; amp2 80;
100 pit3 57; amp3 90;
100 pit4 84; amp4 78;
100 pit5 74; amp5 74;
100 pit6 73; amp6 74;
100 pit7 100; amp7 78;
100 pit8 37; amp8 95;
# after a 600-msec rest, gliss four of the oscillators to new frequencies. ;
600 pit1 70 1000;
300 pit8 40 1000;
300 pit4 89 1000;
300 pit7 95 1000;
# a second later, turn them off with decay time 1500 ;
1000
amp1 0 1500;
amp2 0 1500;
amp3 0 1500;
amp4 0 1500;
amp5 0 1500;
amp6 0 1500;
amp7 0 1500;
amp8 0 1500;
# and re-attack them.. ;
1000
amp1 85 5;
amp2 85 5;
amp3 85 5;
amp4 90 5;
amp5 85 5;
amp6 85 5;
amp7 90 5;
amp8 85 5;
# this time, try varying decay times. ;
10
amp1 0 2000;
amp2 0 2000;
amp3 0 2000;
amp4 0 500;
amp5 0 1000;
amp6 0 1000;
amp7 0 500;
amp8 0 4000;
note 36;
1000 note 34;
1000 note 33;
1000 note 31;
1000 qlist bang;
#N canvas 118 224 600 492 12;
#X obj 66 95 inlet~;
#X obj 130 96 inlet~;
#X obj 68 216 outlet~;
#X obj 141 215 outlet~;
#X obj 67 143 +~;
#X obj 140 141 -~;
#X obj 141 165 delwrite~ \$1 \$2;
#X obj 140 191 delread~ \$1 \$2;
#X text 48 14 This appears as an abstraction in patch G08.reverb.pd
;
#X text 27 267 This network makes two copies of the (stereo) input
\, one in phase \, the other out of phase and delayed. The total frequency
response is flat. The total signal power out is exactly twice that
of the input \, no matter what freqiencies the input contains. This
is used to increase echo density \, by stacking several of these units
with different delay times. Each stage doubles the echo density.;
#X connect 0 0 4 0;
#X connect 0 0 5 0;
#X connect 1 0 4 1;
#X connect 1 0 5 1;
#X connect 4 0 2 0;
#X connect 5 0 6 0;
#X connect 7 0 3 0;
#N canvas 231 67 705 628 12;
#X obj 278 476 *~;
#X obj 177 604 outlet~;
#X obj 104 396 makefilename sample%d;
#X msg 104 419 set \$1;
#X obj 104 442 tabread4~ sample1;
#X obj 360 419 dbtorms;
#X obj 381 395 unpack;
#X obj 360 442 sqrt;
#X obj 360 465 sqrt;
#X obj 338 559 *~;
#X obj 406 513 *~;
#X obj 406 536 *~;
#X msg 201 42 bang;
#X obj 201 72 delay 5;
#X obj 289 95 unpack 0 0 0 0 0 0 0;
#X obj 426 184 f;
#X obj 367 161 f;
#X obj 309 161 f;
#X obj 278 161 f;
#X obj 247 161 f;
#X obj 156 159 f;
#X obj 156 182 mtof;
#X obj 156 205 / 261.62;
#X obj 156 228 * 4.41e+08;
#X obj 156 251 +;
#X obj 399 161 delay;
#X obj 247 303 pack 0 0 0 0 0;
#X obj 201 95 t b b b;
#X obj 309 207 + 1;
#X obj 309 184 * 44.1;
#X msg 55 338 0 5;
#X msg 289 337 1 5;
#X msg 325 337 0 \, \$1 \$2;
#X msg 128 338 \$3 \, \$4 1e+07;
#X msg 253 337 \$5;
#X msg 405 337 0 \$1;
#X obj 289 72 inlet;
#X obj 177 553 inlet~;
#X obj 177 579 +~;
#X text 44 15 This is an abstraction used by the polyphonic sampler.
;
#X text 505 67 ARGUMENTS FOR NOTES:;
#X text 505 89 pitch in halftones;
#X text 505 113 amplitude (dB);
#X text 505 161 sample number;
#X text 505 137 duration (msec);
#X text 505 185 start location (msec);
#X text 505 209 rise time (msec);
#X text 505 233 decay time (msec);
#X obj 45 396 vline~;
#X obj 301 396 vline~;
#X obj 406 490 vline~;
#X connect 0 0 9 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 6 1 50 1;
#X connect 7 0 8 0;
#X connect 8 0 50 0;
#X connect 9 0 38 1;
#X connect 10 0 11 0;
#X connect 10 0 11 1;
#X connect 11 0 9 1;
#X connect 12 0 13 0;
#X connect 12 0 30 0;
#X connect 13 0 27 0;
#X connect 14 0 20 1;
#X connect 14 0 12 0;
#X connect 14 1 19 1;
#X connect 14 2 25 1;
#X connect 14 3 18 1;
#X connect 14 4 17 1;
#X connect 14 5 16 1;
#X connect 14 6 15 1;
#X connect 15 0 35 0;
#X connect 16 0 26 1;
#X connect 17 0 29 0;
#X connect 18 0 26 4;
#X connect 19 0 26 0;
#X connect 20 0 21 0;
#X connect 21 0 22 0;
#X connect 22 0 23 0;
#X connect 23 0 24 0;
#X connect 24 0 26 3;
#X connect 25 0 15 0;
#X connect 26 0 31 0;
#X connect 26 0 32 0;
#X connect 26 0 33 0;
#X connect 26 0 34 0;
#X connect 27 0 19 0;
#X connect 27 1 20 0;
#X connect 27 2 16 0;
#X connect 27 2 17 0;
#X connect 27 2 18 0;
#X connect 27 2 25 0;
#X connect 28 0 26 2;
#X connect 28 0 24 1;
#X connect 29 0 28 0;
#X connect 30 0 49 0;
#X connect 31 0 49 0;
#X connect 32 0 6 0;
#X connect 33 0 48 0;
#X connect 34 0 2 0;
#X connect 35 0 6 0;
#X connect 36 0 14 0;
#X connect 37 0 38 0;
#X connect 38 0 1 0;
#X connect 48 0 4 0;
#X connect 49 0 0 1;
#X connect 50 0 10 0;
#X connect 50 0 10 1;
#N canvas 231 67 770 791 12;
#X obj 284 616 *~;
#X obj 183 744 outlet~;
#X obj 110 536 makefilename sample%d;
#X msg 110 559 set \$1;
#X obj 110 582 tabread4~ sample1;
#X obj 367 559 dbtorms;
#X obj 367 536 unpack;
#X obj 367 582 sqrt;
#X obj 367 605 sqrt;
#X obj 367 628 line~;
#X obj 344 699 *~;
#X obj 367 651 *~;
#X obj 367 674 *~;
#X msg 122 184 bang;
#X obj 130 207 delay 5;
#X obj 437 275 f;
#X obj 399 276 f;
#X obj 322 276 f;
#X obj 283 276 f;
#X obj 252 276 f;
#X obj 159 263 f;
#X obj 159 286 mtof;
#X obj 159 309 / 261.62;
#X obj 159 332 * 4.41e+08;
#X obj 159 363 +;
#X obj 253 443 pack 0 0 0 0 0;
#X obj 130 230 t b b b;
#X obj 322 322 + 1;
#X obj 322 299 * 44.1;
#X msg 85 478 0 5;
#X msg 295 477 1 5;
#X msg 331 477 0 \, \$1 \$2;
#X msg 134 478 \$3 \, \$4 1e+07;
#X msg 259 477 \$5;
#X msg 411 477 0 \$1;
#X obj 230 119 inlet;
#X obj 183 693 inlet~;
#X obj 183 719 +~;
#X text 498 181 pitch in halftones;
#X text 499 158 amplitude (dB);
#X text 499 206 sample number;
#X text 499 230 start location (msec);
#X text 499 254 rise time (msec);
#X text 499 278 decay time (msec);
#X text 498 133 ARGUMENTS FOR NOTE ON:;
#X text 460 317 (Zero amplitude means note off \;;
#X text 481 338 other parameters are ignored.);
#X obj 230 144 route 0;
#X obj 288 175 unpack 0 0 0 0 0 0;
#X text 35 5 This is an abstraction used by the polyphonic sampler
\, version 2 \, which takes separate note-on and note-off messages.
Unlike "sampvoice" (the first version) \, there is no "duration" field
\, and the amplitude and pitch fields are reversed to make it easy
to separate note-on from note-off messages (which have amplitude zero.)
;
#X text 299 153 note-on;
#X text 155 153 note-off;
#X obj 50 536 vline~;
#X obj 307 536 vline~;
#X msg 230 166 bang;
#X connect 0 0 10 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 6 1 9 1;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 11 0;
#X connect 9 0 11 1;
#X connect 10 0 37 1;
#X connect 11 0 12 0;
#X connect 11 0 12 1;
#X connect 12 0 10 1;
#X connect 13 0 14 0;
#X connect 13 0 29 0;
#X connect 14 0 26 0;
#X connect 15 0 34 0;
#X connect 16 0 25 1;
#X connect 17 0 28 0;
#X connect 18 0 25 4;
#X connect 19 0 25 0;
#X connect 20 0 21 0;
#X connect 21 0 22 0;
#X connect 22 0 23 0;
#X connect 23 0 24 0;
#X connect 24 0 25 3;
#X connect 25 0 30 0;
#X connect 25 0 31 0;
#X connect 25 0 32 0;
#X connect 25 0 33 0;
#X connect 26 0 19 0;
#X connect 26 1 20 0;
#X connect 26 2 16 0;
#X connect 26 2 17 0;
#X connect 26 2 18 0;
#X connect 27 0 25 2;
#X connect 27 0 24 1;
#X connect 28 0 27 0;
#X connect 29 0 53 0;
#X connect 30 0 53 0;
#X connect 31 0 6 0;
#X connect 32 0 52 0;
#X connect 33 0 2 0;
#X connect 34 0 6 0;
#X connect 35 0 47 0;
#X connect 36 0 37 0;
#X connect 37 0 1 0;
#X connect 47 0 54 0;
#X connect 47 1 48 0;
#X connect 48 0 13 0;
#X connect 48 0 19 1;
#X connect 48 1 20 1;
#X connect 48 2 18 1;
#X connect 48 3 17 1;
#X connect 48 4 16 1;
#X connect 48 5 15 1;
#X connect 52 0 4 0;
#X connect 53 0 0 1;
#X connect 54 0 15 0;
#N canvas 471 146 638 403 12;
#X obj 156 262 pack 0 50;
#X obj 98 216 pack 0 50;
#X obj 29 298 inlet~;
#X obj 98 242 line~;
#X obj 156 288 line~;
#X obj 99 306 *~;
#X obj 29 324 +~;
#X obj 29 350 outlet~;
#X obj 285 165 r pitch+;
#X obj 185 139 r interval+;
#X obj 98 164 expr $f1 * $f2 + $f3;
#X obj 481 137 r dropoff+;
#X obj 297 63 expr ($i1% 10000) * 0.0002 - 1;
#X obj 297 11 r phase;
#X obj 297 37 + \$1;
#X obj 376 165 expr exp(-$f1*$f1*$f2);
#X obj 98 190 mtof;
#X obj 98 268 osc~;
#X text 64 8 our local phase =;
#X text 61 26 overall phase + our;
#X text 60 45 relative phase;
#X text 57 64 (modulo 10000);
#X text 59 81 normalized from -1 to 1;
#X text 349 36 \$1: relative phase;
#X text 9 110 pitch is center pitch;
#X text 16 125 + interval*phase;
#X text 373 194 amplitude is Gaussian \, with;
#X text 321 215 peak width controlled by "dropoff";
#X connect 0 0 4 0;
#X connect 1 0 3 0;
#X connect 2 0 6 0;
#X connect 3 0 17 0;
#X connect 4 0 5 1;
#X connect 5 0 6 1;
#X connect 6 0 7 0;
#X connect 8 0 10 2;
#X connect 9 0 10 1;
#X connect 10 0 16 0;
#X connect 11 0 15 1;
#X connect 12 0 10 0;
#X connect 12 0 15 0;
#X connect 13 0 14 0;
#X connect 14 0 12 0;
#X connect 15 0 0 0;
#X connect 16 0 1 0;
#X connect 17 0 5 0;
#N canvas 621 65 547 441 12;
#X obj 120 299 line~;
#X obj 120 323 *~;
#X obj 120 346 *~;
#X obj 125 232 sqrt;
#X obj 96 39 inlet;
#X obj 125 253 sqrt;
#X obj 51 360 inlet~;
#X obj 51 413 outlet~;
#X obj 120 370 *~;
#X obj 206 351 osc~;
#X obj 51 388 +~;
#X obj 261 210 pack;
#X text 142 40 inlet: volume \, pitch \, duration;
#X obj 96 88 unpack 0 0 0;
#X text 12 2 arguments: \$1 = relative amplitude \, \$2 = pitch multiplier
\, \$3 = detune \, \$4 = time multiplier;
#X obj 157 117 dbtorms;
#X obj 157 139 * \$1;
#X obj 125 211 f;
#X obj 206 216 f;
#X obj 228 117 mtof;
#X obj 228 142 * \$2;
#X obj 228 164 + \$3;
#X obj 273 118 * \$4;
#X msg 8 148 0 5;
#X msg 99 118 bang;
#X obj 42 148 del 5;
#X obj 106 65 outlet;
#X msg 99 161 0;
#X obj 125 272 pack 0 5;
#X obj 99 139 del 10;
#X connect 0 0 1 0;
#X connect 0 0 1 1;
#X connect 1 0 2 0;
#X connect 1 0 2 1;
#X connect 2 0 8 0;
#X connect 3 0 5 0;
#X connect 4 0 13 0;
#X connect 4 0 26 0;
#X connect 5 0 28 0;
#X connect 6 0 10 0;
#X connect 8 0 10 1;
#X connect 9 0 8 1;
#X connect 10 0 7 0;
#X connect 11 0 0 0;
#X connect 13 0 15 0;
#X connect 13 0 23 0;
#X connect 13 0 24 0;
#X connect 13 1 19 0;
#X connect 13 2 22 0;
#X connect 15 0 16 0;
#X connect 16 0 17 1;
#X connect 17 0 3 0;
#X connect 18 0 9 0;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 18 1;
#X connect 22 0 11 1;
#X connect 23 0 0 0;
#X connect 24 0 25 0;
#X connect 24 0 29 0;
#X connect 25 0 17 0;
#X connect 25 0 18 0;
#X connect 27 0 11 0;
#X connect 28 0 0 0;
#X connect 29 0 27 0;
#N canvas 211 116 826 530 12;
#X obj 28 412 osc~;
#X obj 94 197 r poll-table;
#X obj 129 337 + 50;
#X obj 129 363 dbtorms;
#X msg 78 339 0;
#X obj 78 392 pack 0 30;
#X obj 78 422 line~;
#X obj 28 471 throw~ sum-bus;
#X obj 28 442 *~;
#X obj 28 87 r pitch;
#X obj 28 114 mtof;
#X obj 78 230 f;
#X obj 28 142 * \$1;
#X obj 37 168 ftom;
#X obj 79 256 -;
#X obj 121 255 r whammybar;
#X text 28 9 This abstraction is used by the spectrum drawing example
\, number 16...;
#X text 61 46 \$1 is the partial number.;
#X text 79 114 pitch to frequency;
#X text 78 141 then get the frequency of this specific partial;
#X text 81 167 ... and then convert back to pitch.;
#X text 115 230 ... at which time we get the pitch back...;
#X text 233 249 ... and transpose \, effectively shifting the spectral
envelope left and right.;
#X text 203 341 The vertical scale is dB from 1 to 50 \, but we want
true zero when the table value is 0 or less.;
#X text 172 398 Amplitude control via pack \, line~ \, and *~.;
#X text 171 444 Finally \, add to a summing bus via throw~. All the
throw~s in the instantiations of this abstraction will add into the
one "catch~ sum-bus" at the output.;
#X text 216 195 the calling patch bangs "poll-table" every 30 msec.
;
#X obj 78 284 tabread4 spectrum-tab;
#X text 285 288 Finally get the strength from the table. Note that
we use the control object \, tabread4 \, not tabread4~.;
#X obj 78 311 moses 1;
#X connect 0 0 8 0;
#X connect 1 0 11 0;
#X connect 2 0 3 0;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 6 0 8 1;
#X connect 8 0 7 0;
#X connect 9 0 10 0;
#X connect 10 0 12 0;
#X connect 11 0 14 0;
#X connect 12 0 13 0;
#X connect 12 0 0 0;
#X connect 13 0 11 1;
#X connect 14 0 27 0;
#X connect 15 0 14 1;
#X connect 27 0 29 0;
#X connect 29 0 4 0;
#X connect 29 1 2 0;
Pd release 0.23 and onward include objects for managing lists of data. The
objects allow you to describe data structures and how they are viewed
("template objects") and to traverse lists ("traversal objects.")
The rest of this file gives a highly condensed summary of what's there; the
patches, starting with "1.scalars.pd", act as a tutorial.
1. TEMPLATE OBJECTS.
templates describe data structures. You can add an item to a data structure
using "field" or ask for a shape to be drawn using a "display command."
1.1. "template" -- data structure.
usage, "template <field1> <field2> ..."
where the fields are either "float <name>", "symbol <name>", "list <name>"
(don't try that yet); or "array <name> <template-for-elements>.
1.2. DISPLAY COMMANDS.
These are objects which ask Pd to draw a shape corresponding to some fields
of the datum.
1.2.1. POLYGONS and CURVES.
polygons: polygon <outline-color> <line-width> <x, y> ...
filled polygons: fpolygon <fill-color> <outline-color> <line-width> <x, y> ...
curves: curve <outline-color> <line-width> <x, y> ...
filled curves: fcurve <fill-color> <outline-color> <line-width> <x, y> ...
Each argument can either be a number or a symbol. If a symbol, it's the
name of a field (which must be a "float) which specifies the vaiue.
So for instance in the "1.scalar.pd" example, in the template "template1",
the object "fpolygon 244 q 5 0 0 20 z 40 0" draws a filled polygon whose
interior color is 244 (red 2, green 4, blue 4) but whose outline color
depends on the value of the field "q". Its coordinates describe a triangle
whose altitude is given by "z."
1.2.2 PLOT.
The "plot" objects plots an array field as shown in 5_array.pd.
2. TRAVERSAL.
In this release of Pd, you can only traverse lists all of whose elements
belong to the same template; this restriction will be relaxed in a future
release. You "traverse" a list either to build it, to get its elements,
or to change their values.
2.1. POINTER.
The "pointer" object can be used to refer to an element of a list. Its
methods are:
2.1.1. traverse <symbol>.
Point to the "head" of a list. The symbol should match the name of a Pd
window holding the list. The pointer is output, but you can't set or get the
fields of the "head" pointer; you can only get the "next" element or "append"
to the list.
2.1.2. next. Goes to the next element of the list. Either the pointer
is output on the left side, or else a "bang" at right tells you that no
more objects are forthcoming.
2.1.3. bang.
outputs the current pointer.
2.2. APPEND. Adds an element of the specified template to the list. You
specify what fields you want to supply and the last inlet takes a pointer to
the element you want to "append" after.
2.3. GET.
get <template> <field...>
send it a pointer to an object belonging to the <template> and it outputs
the (floating-point) fields.
2.4. SET.
set <template> <field...>
send it a pointer (at the rightmost inlet) and values for the specified
fields, and their values are changed accordingly.
2.5. GETSIZE.
getsize <template> <array-field>
outputs the size of the named field, which must be an array, when it receives
a pointer to the owner as input.
2.6. SETSIZE.
setsize <template> <array-field>
Send it a pointer to the owner (right inlet) and then the desired size
(left inlet) and the array is resized. If a template contains an array,
each scalar belonging to the template can have its own size for the array.
2.7. ELEMENT.
element <template> <array-field>
Pass it an index and a pointer and it outputs a pointer to an element of the
array.
#N struct template1 float x float y float z float q;
#N canvas 363 11 579 461 12;
#N canvas 13 22 297 180 data 1;
#X scalar template1 50 100 30 9 \;;
#X scalar template1 150 100 -20 900 \;;
#X restore 60 347 pd data;
#N canvas 10 274 550 324 template1 1;
#X obj 60 46 filledpolygon 244 q 5 0 0 20 z 40 0;
#X text 4 164 The filledpolygon's arguments are interior color \, border
color \, border width \, and then the points of the polygon. Arguments
which are symbols ("q" and "z" in this case) mean to take the values
from the data structure. Other values are constant. The position of
the object is automatically controlled by fields named "x" and "y".
;
#X obj 60 21 struct template1 float x float y float z float q;
#X text 3 67 This subpatch acts as a template which describes the data
structure. The "struct" specifies four floating point values named
x \, y \, z \, and q. The "filledpolygon" is a drawing instruction.
Templates should have only one template object but may have any number
of drawing instructions.;
#X restore 60 371 pd template1;
#N canvas 0 0 440 292 stuff 0;
#X obj 235 185 pointer;
#X obj 28 187 append template1 x y z q;