1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
#N canvas 706 40 693 917 10;
#X obj 225 768 osc~ 444;
#X msg 169 742 bang;
#X text 203 741 print the current state of the model in the console;
#X text 281 767 interaction with the simulation at audio rate;
#X text 113 807 arg1 : number of audio inlets (default: 1);
#X text 113 821 arg2 : number of audio outlets (default: 1);
#X text 113 849 arg4 : max. number of masses (default: 10000);
#X msg 30 74 reset;
#X text 70 74 clear everything;
#X msg 181 565 setD \$1 \$2;
#X msg 108 565 setK \$1 \$2;
#X msg 103 530 setM \$1 \$2;
#X msg 93 401 outSpeed \$1 \$2 \$3;
#X msg 64 177 NLlink \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8;
#X text 19 38 all these messages need to be sent only once to create the structure of a physical model:;
#X text 256 176 like the link message \, but with extra arguments :;
#X text 277 191 \$5 is the exponent for the non-linear rigidity;
#X text 277 205 \$6 is the length of the link;
#X text 277 219 \$7 and \$8 are the min and max length of the link;
#X text 98 328 the same inlet can be used to move several masses and send forces to them through multiple inForce and inPos messages for this inlet, f 90;
#X text 89 272 you can send many forces to a single mass \, the resulting force will be the sum of all forces, f 92;
#X text 113 420 the output of an outlet is the sum of the contributions of all out* messages, f 76;
#X text 93 454 these messages interact with the simulation in real time:;
#X text 173 497 send force \$2 to mass \$1;
#X text 163 6 pmpd~ : 1d particle-based physical modeling for audio synthesis, f 66;
#X msg 74 253 inForce \$1 \$2 \$3;
#X text 184 252 signal on inlet \$1 sends force to mass \$2 with amplitude \$3;
#X msg 79 309 inPos \$1 \$2 \$3;
#X text 177 303 signal on inlet \$1 controls position of mass \$2 with amplitude \$3, f 41;
#X text 185 371 connect the position of mass \$2 to outlet \$1 with amplitude \$3, f 62;
#X msg 83 372 outPos \$1 \$2 \$3;
#X text 205 400 connect the velocity of mass \$2 to outlet \$1 with amplitude \$3, f 62;
#X text 157 473 change the position \$2 of a fixed mass \$1;
#X text 113 101 create a mass with arguments : weight of the mass (\$1) \, initial position (\$2). A mass with weight 0 will not move., f 65;
#X msg 121 627 setNLKPow \$1 \$2;
#X msg 116 605 setNLK \$1 \$2 (\$3);
#X text 227 604 change NLlink settings: rigidity and (optional) rigidity exponent, f 65;
#X text 219 626 change rigidity exponent (similar to third argument above);
#X text 252 565 change link settings: rigidity \, damping;
#X text 173 529 change weight \$2 of mass \$1;
#X msg 93 474 pos \$1 \$2;
#X msg 98 497 force \$1 \$2;
#X msg 52 146 link \$1 \$2 \$3 \$4;
#X msg 41 108 mass \$1 \$2;
#X text 161 146 connect two masses (\$1 and \$2) with link rigidity \$3 and damping \$4, f 68;
#X msg 130 671 setNLL \$1 \$2;
#X msg 216 671 setNLLMin \$1 \$2;
#X msg 321 671 setNLLMax \$1 \$2;
#X msg 134 693 setNLLCurrent \$1 (\$2);
#X text 272 689 mix between set length and current length (0..1) (defaults to 1 if no second argument given), f 49;
#X text 421 671 change length \, min length and max length;
#X msg 124 649 setNLD \$1 \$2;
#X text 205 649 change NLlink damping;
#X obj 30 831 dac~;
#X text 113 863 arg5 : max. number of links (default: 10000);
#X text 113 835 arg3 : oversample factor (useful to run the simulation faster than audio rate - default: 1), f 91;
#X text 113 877 arg6 : max. number inlet assignments (default: 1000);
#X text 113 891 arg7 : max. number outlet assignments (default: 1000);
#X text 113 793 optional leading -m flag to switch inputs and outputs to multichannel mode, f 74;
#X obj 30 793 pmpd~ -m 1 2;
#X msg 189 715 max \$1;
#X msg 140 715 min \$1;
#X text 234 715 set minimimum and maximum position of all masses;
#X connect 0 0 59 0;
#X connect 1 0 59 0;
#X connect 7 0 59 0;
#X connect 10 0 59 0;
#X connect 11 0 59 0;
#X connect 12 0 59 0;
#X connect 13 0 59 0;
#X connect 25 0 59 0;
#X connect 27 0 59 0;
#X connect 30 0 59 0;
#X connect 34 0 59 0;
#X connect 35 0 59 0;
#X connect 40 0 59 0;
#X connect 41 0 59 0;
#X connect 42 0 59 0;
#X connect 43 0 59 0;
#X connect 45 0 59 0;
#X connect 48 0 59 0;
#X connect 51 0 59 0;
#X connect 59 0 53 0;
#X connect 59 0 53 1;
#X connect 61 0 59 0;
|