#N canvas 0 0 1037 526 10;
#X msg 507 68 retrograde;
#X msg 507 233 retro-inversion;
#X msg 507 39 bang;
#X obj 624 343 loadbang;
#X floatatom 515 177 5 0 0 0 - - -;
#X msg 507 196 transpose \$1;
#X msg 507 100 inversion;
#X msg 507 153 inversion \$1;
#X floatatom 515 133 5 0 0 0 - - -;
#X msg 624 365 1 2 3 4 5;
#X msg 507 316 rotate \$1;
#X floatatom 517 296 5 0 0 0 - - -;
#X msg 507 274 retro-inversion \$1;
#X floatatom 517 255 5 0 0 0 - - -;
#X obj 507 364 c_patternchange;
#N canvas 0 0 450 300 show 0;
#X obj 41 39 inlet;
#X obj 186 36 inlet;
#X obj 41 124 outlet;
#X msg 186 76 set;
#X obj 41 59 list prepend set;
#X obj 41 83 list trim;
#X connect 0 0 4 0;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X restore 609 397 pd show;
#N canvas 0 0 450 300 show 0;
#X obj 41 39 inlet;
#X obj 186 36 inlet;
#X obj 41 124 outlet;
#X msg 186 76 set;
#X obj 41 59 list prepend set;
#X obj 41 83 list trim;
#X connect 0 0 4 0;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X restore 507 425 pd show;
#X text 602 153 invert the pattern around an arbitrary axis.;
#X text 596 98 invert the pattern melodically using its first element
as inversion axis.;
#X text 595 67 reverse the pattern.;
#X text 595 36 original \, no change.;
#X text 603 196 transpose the pattern up or down;
#X text 629 223 reverse and inverse the pattern around its last (i.e.
the reversed first) element (= retrograde + inversion);
#X text 653 273 reverse and inverse around arbitrary axis.;
#X text 610 318 rotate by <num> - move <num> elements from front to
back.;
#N canvas 318 165 674 724 interactive-example 0;
#X obj 312 284 hradio 15 1 0 12 empty empty empty 0 -8 0 10 -262144
-1 -1 6;
#X obj 312 307 m_majorscale 60;
#X obj 393 376 t a;
#X obj 312 351 list prepend;
#X obj 143 387 metro 300;
#X obj 143 627 s_rhodey;
#X obj 143 577 makenote 50 250;
#X obj 143 602 pack 0 0;
#X obj 143 364 tgl 15 0 empty empty empty 17 7 0 10 -4034 -1 -1 0 1
;
#X floatatom 158 546 5 0 0 0 - - -;
#X obj 143 652 soundoutput;
#N canvas 0 0 450 300 show 0;
#X obj 41 39 inlet;
#X obj 186 36 inlet;
#X obj 41 124 outlet;
#X msg 186 76 set;
#X obj 41 59 list prepend set;
#X obj 41 83 list trim;
#X connect 0 0 4 0;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X restore 327 376 pd show;
#X msg 327 401 65 71 72 67 64 74 69 71;
#N canvas 0 0 450 300 show 0;
#X obj 41 39 inlet;
#X obj 186 36 inlet;
#X obj 41 124 outlet;
#X msg 186 76 set;
#X obj 41 59 list prepend set;
#X obj 41 83 list trim;
#X connect 0 0 4 0;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X restore 252 496 pd show;
#X msg 210 99 retrograde;
#X msg 210 220 retro-inversion;
#X msg 210 74 bang;
#X floatatom 167 192 5 0 0 0 - - -;
#X msg 210 195 transpose \$1;
#X msg 210 124 inversion;
#X msg 210 170 inversion \$1;
#X floatatom 167 170 5 0 0 0 - - -;
#X msg 210 285 rotate \$1;
#X floatatom 164 282 5 0 0 0 - - -;
#X msg 210 260 retro-inversion \$1;
#X floatatom 164 260 5 0 0 0 - - -;
#X obj 210 420 c_patternchange;
#X obj 481 224 s \$0-reset;
#X msg 481 199 bang;
#X obj 408 351 r \$0-reset;
#X obj 327 426 r \$0-reset;
#X text 56 36 This is a little interactive example of changing patterns.
;
#X text 505 283 record pitches;
#X obj 143 521 u_listloop;
#X obj 272 622 s_drumelectro;
#X obj 272 572 select 0;
#X msg 272 597 bd 100;
#X msg 252 521;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 2 0 3 1;
#X connect 3 0 2 0;
#X connect 3 0 11 0;
#X connect 3 0 26 1;
#X connect 4 0 33 0;
#X connect 5 0 10 0;
#X connect 5 0 10 1;
#X connect 6 0 7 0;
#X connect 6 1 7 1;
#X connect 7 0 5 0;
#X connect 8 0 4 0;
#X connect 11 0 12 0;
#X connect 13 0 37 0;
#X connect 14 0 26 0;
#X connect 15 0 26 0;
#X connect 16 0 26 0;
#X connect 17 0 18 0;
#X connect 18 0 26 0;
#X connect 19 0 26 0;
#X connect 20 0 26 0;
#X connect 21 0 20 0;
#X connect 22 0 26 0;
#X connect 23 0 22 0;
#X connect 24 0 26 0;
#X connect 25 0 24 0;
#X connect 26 0 13 0;
#X connect 26 0 33 1;
#X connect 28 0 27 0;
#X connect 29 0 3 1;
#X connect 29 0 11 1;
#X connect 30 0 26 1;
#X connect 30 0 13 1;
#X connect 30 0 33 1;
#X connect 33 0 9 0;
#X connect 33 0 6 0;
#X connect 33 1 35 0;
#X connect 34 0 10 1;
#X connect 34 0 10 0;
#X connect 35 0 36 0;
#X connect 36 0 34 0;
#X restore 732 396 pd interactive-example;
#X text 4 10 c_patternchange - transform melodic patterns;
#N canvas 0 0 889 655 REFERENCE 0;
#X text 114 121 Name: c_patternchange;
#X text 114 144 Summary: transform melodic patterns;
#X text 115 334 Inlet 1: float list: set the pattern.;
#X text 115 357 Outlet 0: transformed pattern list;
#X text 115 380 Outlet 1: transformation used (as in Inlet 0);
#X text 113 174 Inlet 0: message to output the stored pattern using
the following transformations. bang -> original. retrograde -> reverse
the pattern. inversion -> invert the pattern melodically using its
first element as inversion axis. inversion <num> -> invert the pattern
around an arbitrary axis. transpose <num> -> transpose the pattern
up or down. retro-inversion -> reverse and inverse the pattern around
its last (i.e. the reversed first) element (= retrograde + inversion).
retro-inversion <num> -> reverse and inverse around arbitrary axis.
rotate <num> -> move <num> elements from front to back.;
#X text 115 478 Tags: transformation \, sequencing;
#X text 115 403 Description: Transform a pattern. A pattern to c_patternchange
is any list of numbers. The pattern to transform is set through the
second inlet. Then you can send the following messages to get the transformed
pattern out:;
#X coords 0 -1 1 1 450 450 1 100 100;
#X restore 7 36 pd REFERENCE;
#X msg 609 431;
#X msg 507 448;
#X connect 0 0 14 0;
#X connect 1 0 14 0;
#X connect 2 0 14 0;
#X connect 3 0 9 0;
#X connect 4 0 5 0;
#X connect 5 0 14 0;
#X connect 6 0 14 0;
#X connect 7 0 14 0;
#X connect 8 0 7 0;
#X connect 9 0 14 1;
#X connect 10 0 14 0;
#X connect 11 0 10 0;
#X connect 12 0 14 0;
#X connect 13 0 12 0;
#X connect 14 0 16 0;
#X connect 14 1 15 0;
#X connect 15 0 28 0;
#X connect 16 0 29 0;
