[PD] time, metro, triplets and polyrhythms

Frank Barknecht fbar at footils.org
Thu Mar 23 08:56:43 CET 2006


Hallo,
Damian Stewart hat gesagt: // Damian Stewart wrote:

> So, (apologies for the mammothosity of this email), I'm looking at at 
> least two new objects. The first, we'll call it TimeMachine, will be 
> based around a high-frequency timer triggering at some common multiple 
> of 2, 3, 5, and 7 times every beat. The second, maybe call it 
> LoopingEnvelope, has to decode that raw number and decide based on 
> envelope data whether or not to send out a new message of the form 
> 'float float' that will get passed on to a _line_ object.

I don't see what TimeMachine can do that [metro] wouldn't be able to
do? [metro] is capable of high-frequency triggering, and can fire in
multiples of every (sensible) control frequency or period. 

To really get the full timing resolution of [metro] you will not want
to use the [line~] object however, but the [vline~] object. 

Doing the polyrhythm stuff is quite easy with builtin Pd objects and
it's also more flexible for users, who can directly change the
internals without having to recompile. Pd users often like to do that. 

An example of what I mean is a little polyrhythm-testpatch I did some
time ago using only builtin objects (including [list] so pd-0.39
required as well as [list]-abs). [list-rhythm] simply is a little
counter, that counts in intervals you send to its second inlet. So
sending e.g.  "2   2   1 3"     will make list-rhythm count like this:
"0 1 0 1 0 0 1 2" and repeat that.

Combining many list-rhythms can create interesting polyrhythms, whose
patterns can change on the fly. See simple-test.pd for an example.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 502 345 459 338 10;
#X obj 255 122 list-rhythm;
#X msg 98 50 2 2 1 2 2 2 1;
#X msg 203 43 2 1 2 2 1 2 1 1;
#N canvas 0 0 450 300 clk 0;
#X obj 101 167 phasor~ 220;
#X msg 84 113 1 10 \, 0.5 20 10 \, 0 100 30;
#X obj 86 191 *~;
#X obj 82 150 vline~;
#X obj 88 217 outlet~;
#X obj 90 75 inlet;
#X connect 0 0 2 1;
#X connect 1 0 3 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 5 0 1 0;
#X restore 79 220 pd clk;
#N canvas 0 0 450 300 clk 0;
#X msg 84 113 1 10 \, 0.5 20 10 \, 0 100 30;
#X obj 86 191 *~;
#X obj 82 150 vline~;
#X obj 88 217 outlet~;
#X obj 90 75 inlet;
#X obj 138 153 phasor~ 500;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X connect 4 0 0 0;
#X connect 5 0 1 1;
#X restore 131 220 pd clk;
#N canvas 0 0 450 300 clk 0;
#X msg 84 113 1 10 \, 0.5 20 10 \, 0 100 30;
#X obj 86 191 *~;
#X obj 82 150 vline~;
#X obj 88 217 outlet~;
#X obj 90 75 inlet;
#X obj 101 167 phasor~ 1000;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X connect 4 0 0 0;
#X connect 5 0 1 1;
#X restore 209 221 pd clk;
#X obj 108 255 *~ 0.2;
#X obj 157 255 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 2800 1;
#X obj 109 283 dac~;
#X obj 74 180 select 0;
#X obj 143 179 select 0;
#X obj 209 181 select 0;
#X msg 285 85 6 6;
#X obj 368 87 metro 200;
#X obj 370 70 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X floatatom 174 144 5 0 0 0 - - -;
#X msg 197 21 3 3 4 1;
#X msg 87 26 1 3 2 4 1 5;
#X msg 316 82 4 4 4;
#X msg 257 62 3 3 3 3;
#X floatatom 259 153 5 0 0 0 - - -;
#X floatatom 89 150 5 0 0 0 - - -;
#X obj 329 147 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 226 141 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 142 145 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 73 121 list-rhythm;
#X obj 159 121 list-rhythm;
#X connect 0 0 11 0;
#X connect 0 0 20 0;
#X connect 0 3 22 0;
#X connect 1 0 25 1;
#X connect 2 0 26 1;
#X connect 3 0 6 0;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 6 0 8 0;
#X connect 6 0 8 1;
#X connect 7 0 6 1;
#X connect 9 0 3 0;
#X connect 10 0 4 0;
#X connect 11 0 5 0;
#X connect 12 0 0 1;
#X connect 13 0 0 0;
#X connect 13 0 25 0;
#X connect 13 0 26 0;
#X connect 14 0 13 0;
#X connect 16 0 26 1;
#X connect 17 0 25 1;
#X connect 18 0 0 1;
#X connect 19 0 0 1;
#X connect 25 0 9 0;
#X connect 25 0 21 0;
#X connect 25 3 24 0;
#X connect 26 0 10 0;
#X connect 26 0 15 0;
#X connect 26 3 23 0;
-------------- next part --------------
#N canvas 322 131 786 661 10;
#X obj 406 43 inlet;
#X obj 99 54 inlet;
#X obj 390 494 list;
#X obj 604 67 inlet;
#X obj 99 424 outlet;
#X obj 478 146 outlet;
#X obj 664 566 outlet;
#X obj 477 397 list-len;
#X obj 99 207 f 0;
#X obj 130 207 + 1;
#X obj 159 207 mod 9;
#X obj 390 425 f 0;
#X obj 418 425 + 1;
#X obj 447 425 mod 9;
#X obj 129 302 select 0;
#X msg 604 90 0;
#X obj 99 244 t a a;
#X obj 406 70 t b b a a a;
#X obj 664 536 select 0;
#X obj 390 462 t b f f;
#X text 205 209 Count up to current interval;
#X obj 422 587 s \$0-next-interval;
#X obj 189 169 r \$0-next-interval;
#X text 190 308 the next stored interval;
#X text 191 294 when interval was played \, select;
#X text 491 425 wrap around at end of list;
#X obj 422 553 list split 1;
#X obj 390 516 list split;
#X obj 314 513 outlet;
#N canvas 127 288 450 300 accum 0;
#X obj 212 193 f 0;
#X obj 182 192 + 1;
#X obj 212 168 0;
#X obj 182 53 inlet;
#X obj 182 81 t a b;
#X obj 182 140 route float;
#X obj 166 245 outlet;
#X obj 166 220 f;
#X text 116 23 list-accum: add all floats in a list;
#N canvas 0 0 533 407 drip 0;
#X obj 64 206 list split 1;
#X obj 64 123 until;
#X obj 64 181 list append;
#X obj 194 206 bang;
#X text 146 90 First store list \, then start the loop;
#X text 163 118 "until" bangs its output until told to stop by a "bang"
to its right inlet.;
#X text 182 160 Store the remaining list.;
#X text 239 205 third outlet of "split" tells us to stop.;
#X obj 64 243 outlet;
#X obj 64 57 inlet;
#X text 237 44 From list-help.pd;
#X obj 143 243 outlet;
#X obj 64 86 t b a;
#X connect 0 0 8 0;
#X connect 0 1 2 1;
#X connect 0 2 3 0;
#X connect 0 2 11 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 1 1;
#X connect 9 0 12 0;
#X connect 12 0 1 0;
#X connect 12 1 2 1;
#X restore 182 109 pd drip;
#X connect 0 0 1 1;
#X connect 1 0 0 0;
#X connect 1 0 7 1;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 4 0 9 0;
#X connect 4 1 2 0;
#X connect 5 0 1 0;
#X connect 7 0 6 0;
#X connect 9 0 5 0;
#X connect 9 1 7 0;
#X restore 478 122 pd accum;
#X connect 0 0 17 0;
#X connect 1 0 8 0;
#X connect 2 0 27 0;
#X connect 3 0 15 0;
#X connect 7 0 13 1;
#X connect 8 0 16 0;
#X connect 9 0 10 0;
#X connect 10 0 8 1;
#X connect 11 0 12 0;
#X connect 11 0 19 0;
#X connect 12 0 13 0;
#X connect 13 0 11 1;
#X connect 14 0 11 0;
#X connect 15 0 8 1;
#X connect 15 0 11 1;
#X connect 16 0 9 0;
#X connect 16 0 4 0;
#X connect 16 1 14 0;
#X connect 17 2 2 1;
#X connect 17 3 7 0;
#X connect 17 4 29 0;
#X connect 18 0 6 0;
#X connect 19 0 2 0;
#X connect 19 1 27 1;
#X connect 19 1 28 0;
#X connect 19 2 18 0;
#X connect 22 0 10 1;
#X connect 26 0 21 0;
#X connect 27 1 26 0;
#X connect 29 0 5 0;
-------------- next part --------------
#N canvas 0 0 534 321 10;
#X obj 126 70 inlet;
#X obj 82 144 list-drip;
#X obj 161 209 + 1;
#X obj 82 172 b;
#X obj 116 249 f;
#X obj 116 276 outlet;
#X obj 148 183 1;
#X obj 132 211 f 1;
#X obj 206 213 0;
#X obj 126 104 t a b b;
#X text 37 37 list-len: calculate length of a list.;
#X connect 0 0 9 0;
#X connect 1 0 3 0;
#X connect 1 1 4 0;
#X connect 2 0 7 1;
#X connect 3 0 7 0;
#X connect 4 0 5 0;
#X connect 6 0 7 1;
#X connect 7 0 2 0;
#X connect 7 0 4 1;
#X connect 8 0 4 1;
#X connect 9 0 1 0;
#X connect 9 1 6 0;
#X connect 9 2 8 0;
-------------- next part --------------
#N canvas 0 0 450 300 10;
#N canvas 0 0 533 407 drip 1;
#X obj 64 206 list split 1;
#X obj 64 123 until;
#X obj 64 181 list append;
#X obj 194 206 bang;
#X text 146 90 First store list \, then start the loop;
#X text 163 118 "until" bangs its output until told to stop by a "bang"
to its right inlet.;
#X text 182 160 Store the remaining list.;
#X text 239 205 third outlet of "split" tells us to stop.;
#X obj 64 243 outlet;
#X obj 64 57 inlet;
#X text 237 44 From list-help.pd;
#X obj 143 243 outlet;
#X obj 64 86 t b a;
#X connect 0 0 8 0;
#X connect 0 1 2 1;
#X connect 0 2 3 0;
#X connect 0 2 11 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 1 1;
#X connect 9 0 12 0;
#X connect 12 0 1 0;
#X connect 12 1 2 1;
#X restore 133 139 pd drip;
#X obj 133 90 inlet;
#X obj 133 212 outlet;
#X obj 177 181 outlet;
#X connect 0 0 2 0;
#X connect 0 1 3 0;
#X connect 1 0 0 0;


More information about the Pd-list mailing list