[PD] fun with nqpoly4

Frank Barknecht fbar at footils.org
Wed Jul 12 00:17:06 CEST 2006


Hallo,
Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:

> I just wrote a quick test of what happens when you play hundreds of  
> oscillators.  Thanks to nqpoly4, its quite easy.  

Okay, this inspired me to finally do something I wanted to do for a
loooong time: I think, nqpoly4 is a very useful patch, however I
always found it hard to see what's going on, I didn't like the use of
the non-deprecated namecanvas, where a subpatch would be enough, and
most of all I found the editing restrictions awkward to say the least. 

Attached is a reworked version of nqpoly4, which should be compatible
but I only tested it with your many-osc.pd so far. 

Changes besides cleanup include an additional inlet that lets you
change the degree of polyphony on the fly. Further editing of nqpoly4
does not need to follow the old instructions about counting object
indices and creating connections in a certain order etc. You can edit
the patch without such hassles now just like any other Pd patch.

A final change I didn't do yet is to change the name to something
other than "nqpoly4", which I find a bit hard to type and to memorize.
Suggestions welcome.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 366 494 450 300 10;
#X obj 45 26 inlet;
#X obj 45 117 spigot;
#X obj 75 244 spigot;
#X obj 45 204 \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 \$9;
#X obj 75 271 outlet;
#X obj 260 23 inlet;
#X text 12 5 nqpwrap (v4) - pix.test.at;
#X text 252 126 this object is used by nqpoly;
#X obj 45 64 t a a;
#X obj 45 157 t a b;
#X obj 82 93 unpack 0 0;
#X msg 96 64 0 1;
#X msg 134 65 1 0;
#X connect 0 0 8 0;
#X connect 1 0 9 0;
#X connect 2 0 4 0;
#X connect 3 0 12 0;
#X connect 5 0 3 1;
#X connect 5 0 12 0;
#X connect 8 0 1 0;
#X connect 8 1 2 0;
#X connect 9 0 3 0;
#X connect 9 1 11 0;
#X connect 10 0 1 1;
#X connect 10 1 2 1;
#X connect 11 0 10 0;
#X connect 12 0 10 0;
-------------- next part --------------
#N canvas 293 125 864 653 10;
#X obj 36 31 inlet;
#X obj 36 338 outlet;
#X obj 248 208 until;
#X obj 322 335 symbol \$2;
#X obj 157 130 moses 1;
#X obj 283 235 + 1;
#X text 425 27 usage: nqpoly <number of objects> <abstraction name>
<up to 4 creation args>;
#X text 427 68 your abstraction is ultimately called with the parameters:
<index> <number of objects> <arg1> <arg2> <arg3> <arg4>;
#N canvas 7 455 362 318 1002-poly 0;
#X restore 36 256 pd \$0-poly;
#X obj 36 227 s \$0-in1;
#X obj 121 228 s \$0-in2;
#X obj 36 283 r \$0-out;
#N canvas 220 112 751 428 init 0;
#X obj 197 139 symbol \$0-poly;
#X obj 197 163 makefilename pd-%s;
#X obj 197 187 pack s \$0;
#X msg 204 118 bang;
#X text 154 317 This will clear the subpatch and create fake "in/outlets"
as senders and receivers.;
#X msg 197 230 \; \$1 clear \; \$1 obj 50 60 r \$2-in1 \; \$1 obj 199
60 r \$2-in2 \; \$1 obj 50 200 s \$2-out;
#X obj 103 206 s \$0-subname;
#X obj 197 92 b;
#X obj 197 69 r \$0-init;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 0 6 0;
#X connect 2 0 5 0;
#X connect 3 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 7 0;
#X restore 243 28 pd init;
#X obj 248 235 f;
#X obj 121 26 inlet;
#X obj 173 28 loadbang;
#X obj 121 60 f \$1;
#X obj 349 216 f \$1;
#X obj 295 208 0;
#X floatatom 178 59 5 0 0 0 - - -;
#X msg 216 58 bang;
#X obj 248 494 + 3;
#N canvas 0 0 692 559 last-two 0;
#X obj 153 175 cnv 15 150 80 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 378 110 first reset (b) \, then set new length (f).;
#X text 311 195 Right outlet is responsible to first fill the list
;
#X text 312 211 Left outlet then only lets the smaller list pass.;
#X obj 180 183 list;
#X obj 228 113 inlet;
#X obj 180 149 inlet;
#X obj 180 302 outlet;
#X obj 180 228 list split 2;
#X obj 228 149 b;
#X connect 4 0 8 0;
#X connect 5 0 9 0;
#X connect 6 0 4 0;
#X connect 8 0 4 1;
#X connect 8 0 7 0;
#X connect 8 2 4 1;
#X connect 9 0 4 1;
#X restore 248 516 pd last-two;
#X obj 248 562 list prepend;
#X msg 248 590 \; \$1 connect \$3 0 \$2 0 \;;
#X obj 296 359 r \$0-subname;
#X obj 327 541 r \$0-subname;
#N canvas 0 0 1005 687 finish 0;
#X obj 432 273 list prepend;
#X obj 432 235 + 2;
#X msg 432 304 \; \$1 connect 0 0 3 0 \; \$1 connect \$2 0 2 0 \;;
#X obj 136 256 until;
#X obj 171 283 + 1;
#X obj 136 355 list prepend;
#X obj 136 233 t a b;
#X msg 136 389 \; \$1 connect 1 0 \$2 1 \;;
#X obj 136 282 f 3;
#X obj 183 256 3;
#X obj 215 326 r \$0-subname;
#X obj 513 249 r \$0-subname;
#X text 182 234 first 3 objects are xlets;
#X obj 92 102 inlet;
#X obj 92 138 moses 1;
#X obj 136 169 t a a;
#X text 419 358 Connect final object to [s \$0-out];
#X text 69 439 Connect all wrapper object's right inlet to [r \$0-in2]
;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 3 0 8 0;
#X connect 4 0 8 1;
#X connect 5 0 7 0;
#X connect 6 0 3 0;
#X connect 6 1 9 0;
#X connect 8 0 4 0;
#X connect 8 0 5 0;
#X connect 9 0 8 1;
#X connect 10 0 5 1;
#X connect 11 0 0 1;
#X connect 13 0 14 0;
#X connect 14 1 15 0;
#X connect 15 0 6 0;
#X connect 15 1 1 0;
#X restore 139 198 pd finish;
#X text 568 154 based on: nqpoly (v4) - pix.test.at;
#X obj 248 188 t a b;
#X obj 231 116 s \$0-init;
#X obj 320 494 r \$0-init;
#X text 567 178 changes: fbar at footils.org 2006;
#X msg 388 298 symbol many-osc;
#X obj 270 390 pack f s s f;
#X msg 270 441 \; \$2 obj 50 100 nqpwrap4 \$3 \$1 \$4 \$5 \$6 \$7 \$8
\;;
#X obj 270 414 list append \$3 \$4 \$5 \$6;
#X obj 121 85 t b a a a b;
#X obj 248 271 t a a b;
#X connect 0 0 9 0;
#X connect 2 0 13 0;
#X connect 3 0 34 2;
#X connect 4 1 29 0;
#X connect 5 0 13 1;
#X connect 11 0 1 0;
#X connect 13 0 5 0;
#X connect 13 0 38 0;
#X connect 14 0 16 0;
#X connect 15 0 16 0;
#X connect 16 0 37 0;
#X connect 17 0 34 3;
#X connect 18 0 13 1;
#X connect 19 0 16 0;
#X connect 20 0 19 0;
#X connect 21 0 22 0;
#X connect 22 0 23 0;
#X connect 23 0 24 0;
#X connect 25 0 34 1;
#X connect 26 0 23 1;
#X connect 29 0 2 0;
#X connect 29 1 18 0;
#X connect 31 0 22 1;
#X connect 33 0 3 0;
#X connect 34 0 36 0;
#X connect 36 0 35 0;
#X connect 37 0 10 0;
#X connect 37 1 27 0;
#X connect 37 2 4 0;
#X connect 37 3 17 0;
#X connect 37 4 30 0;
#X connect 38 0 21 0;
#X connect 38 1 34 0;
#X connect 38 2 3 0;


More information about the Pd-list mailing list