#N canvas 423 17 468 485 12;
#X declare -lib iemmatrix;
#X obj 122 138 mtx_print;
#X text 43 29 packing signal vectors (usually 64 samples);
#X text 42 52 of multiple inputs into a matrix;
#X obj 77 162 mtx_unpack~ 3;
#X obj 47 115 mtx_rand;
#X obj 47 138 t b a a;
#X obj 292 87 block~ 8;
#X msg 47 93 3 8;
#X obj 5 162 t b b b;
#X obj 192 220 print~ C;
#X obj 133 244 print~ B;
#X obj 77 267 print~ A;
#X obj 19 96 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000;
#X obj 126 115 mtx_ones;
#X msg 126 93 3 8;
#N canvas 460 154 494 183 META 0;
#X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig;
#X text 12 25 LICENSE GPL-2+;
#X text 12 106 AUTHOR Franz Zotter;
#X text 11 43 DESCRIPTION unpack a matrix into signal vectors;
#X text 12 85 OUTLET_n signal;
#X text 12 65 INLET_0 matrix;
#X text 12 5 KEYWORDS signal matrix;
#X obj 13 150 declare -lib iemmatrix;
#X restore 381 6 pd META;
#X obj 310 179 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1;
#X msg 310 204 \; pd dsp \$1;
#N canvas 607 308 574 445 multichannel 0;
#X text 98 22 With Pd>=0.54 \, [mtx_unpack~] has multichannel support \, if requested explicitly with the '-m' flag.;
#X obj 182 120 mtx_print;
#X obj 103 95 mtx_rand;
#X msg 103 73 3 8;
#X obj 242 250 print~ C;
#X obj 183 274 print~ B;
#X obj 127 297 print~ A;
#X obj 126 160 mtx_unpack~ -m 3;
#X obj 127 192 snake~ out 4;
#X obj 252 220 print~ D;
#X obj 103 234 t b b b b;
#X obj 432 63 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1;
#X obj 103 120 t b a a;
#X msg 432 88 \; pd dsp \$1;
#X text 256 160 <-- multi-channel \, 3 channels default;
#N canvas 332 112 1090 795 "dynamically" 0;
#X text 23 68 the number of output channels is determined by the number of rows in the incoming matrix \, and can be changed dynamically by restarting the DSP.;
#X text 24 116 the (optional) channel argument specifies the number of channels even if no matrix has been sent yet.;
#X text 26 158 due to the way Pd works \, it is not possible to change the number of signals while DSP is running. If you send a matrix with a different number of rows \, the channels will change as soon as you restart the DSP (which can happen for a number of reasons \, like saving a patch or connecting a signal object);
#X obj 243 415 mtx_rand;
#X msg 280 390 3 8;
#X obj 329 527 mtx_unpack~ -m 3;
#X obj 75 527 mtx_unpack~ 3;
#X text 62 496 single-channel;
#X text 285 473 multi-channel;
#X obj 330 559 snake~ out 4;
#X msg 325 390 4 8;
#X msg 243 390 2 8;
#X obj 204 464 t a a;
#X obj 75 613 env~;
#X floatatom 75 638 5 0 0 0 - - - 0;
#X obj 118 613 env~;
#X floatatom 118 638 5 0 0 0 - - - 0;
#X obj 162 613 env~;
#X floatatom 162 638 5 0 0 0 - - - 0;
#X obj 329 613 env~;
#X floatatom 329 638 5 0 0 0 - - - 0;
#X obj 369 613 env~;
#X floatatom 369 638 5 0 0 0 - - - 0;
#X obj 409 613 env~;
#X floatatom 409 638 5 0 0 0 - - - 0;
#X obj 449 613 env~;
#X floatatom 449 638 5 0 0 0 - - - 0;
#X obj 204 439 matrix;
#X obj 204 415 bang~;
#X msg 727 107 \; pd dsp 0 \; pd dsp 1;
#X msg 867 60 3;
#X msg 309 438 \$1 8;
#X text 588 61 #1 initialize the number of channels to;
#X text 587 105 #2 restart the DSP;
#X msg 867 210 2;
#X text 588 211 #3 set the number of channels to: 2;
#X msg 727 307 \; pd dsp 0 \; pd dsp 1;
#X text 587 305 #4 restart the DSP;
#X msg 727 547 \; pd dsp 0 \; pd dsp 1;
#X text 587 545 #6 restart the DSP;
#X text 588 431 #5 set the number of channels to: 4;
#X msg 867 430 4;
#X text 617 450 notice that the single-channel variant has payload on all three channels (discarding the 4th) \, whereas the multi-channel variant is still in 2-channel mode, f 35;
#X text 615 159 both variants have payload on the first 3 channels, f 35;
#X text 617 230 notice that both variants output 2 channels of actual data (the rest is muted), f 35;
#X text 615 359 (it looks the same \, but the multi-channel variant is now really in 2-channel mode), f 35;
#X text 617 607 the multi-channel variant is now in 4-channel mode., f 34;
#X obj 867 85 s \$0.channels;
#X obj 867 235 s \$0.channels;
#X obj 867 455 s \$0.channels;
#X obj 309 415 r \$0.channels;
#X connect 3 0 27 1;
#X connect 4 0 3 0;
#X connect 5 0 9 0;
#X connect 6 0 13 0;
#X connect 6 1 15 0;
#X connect 6 2 17 0;
#X connect 9 0 19 0;
#X connect 9 1 21 0;
#X connect 9 2 23 0;
#X connect 9 3 25 0;
#X connect 10 0 3 0;
#X connect 11 0 3 0;
#X connect 12 0 6 0;
#X connect 12 1 5 0;
#X connect 13 0 14 0;
#X connect 15 0 16 0;
#X connect 17 0 18 0;
#X connect 19 0 20 0;
#X connect 21 0 22 0;
#X connect 23 0 24 0;
#X connect 25 0 26 0;
#X connect 27 0 12 0;
#X connect 28 0 27 0;
#X connect 30 0 47 0;
#X connect 31 0 3 0;
#X connect 34 0 48 0;
#X connect 41 0 49 0;
#X connect 50 0 31 0;
#X restore 98 355 pd "dynamically" changing the number of channels;
#X connect 2 0 12 0;
#X connect 3 0 2 0;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 8 1 5 0;
#X connect 8 2 4 0;
#X connect 8 3 9 0;
#X connect 10 0 6 0;
#X connect 10 1 5 0;
#X connect 10 2 4 0;
#X connect 10 3 9 0;
#X connect 11 0 13 0;
#X connect 12 0 10 0;
#X connect 12 1 7 0;
#X connect 12 2 1 0;
#X restore 69 352 pd multichannel;
#X text 238 398 part of iemmatrix;
#X obj 308 428 mtx_pack~;
#X text 232 427 see also:;
#X connect 3 0 11 0;
#X connect 3 1 10 0;
#X connect 3 2 9 0;
#X connect 4 0 5 0;
#X connect 5 0 8 0;
#X connect 5 1 3 0;
#X connect 5 2 0 0;
#X connect 7 0 4 0;
#X connect 8 0 11 0;
#X connect 8 1 10 0;
#X connect 8 2 9 0;
#X connect 12 0 4 0;
#X connect 13 0 5 0;
#X connect 14 0 13 0;
#X connect 16 0 17 0;
