#N canvas 11 85 454 460 10; #X text 116 168 Data comes in as:; #X text 115 187 Parameter MSB: Ctl 99; #X text 115 199 Parameter LSB: Ctl 98; #X text 114 212 Value MSB: Ctl 6; #X text 114 224 Value LSB: Ctl 38; #X text 156 337 value; #X text 214 316 parameter; #X obj 110 335 outlet; #X obj 167 313 outlet; #X obj 224 290 outlet; #X text 273 289 channel; #N canvas 458 0 656 592 1001-nrpnin_guts 0; #X obj 120 26 ctlin; #X text 166 530 value; #X text 220 499 parameter; #X obj 120 49 pack f f f; #X msg 120 72 \$3 \$2 \$1; #X obj 120 97 route \$2; #X obj 171 120 spigot; #X obj 208 28 loadbang; #X obj 208 49 f \$2; #X obj 208 70 sel 0; #X msg 208 92 1; #X text 257 60 if no midi channel specified \, omni; #X obj 171 363 spigot; #X obj 208 275 loadbang; #X obj 208 317 sel 0; #X msg 208 339 1; #X obj 120 249 route \$1; #X msg 171 147 \$2 \$3; #X obj 208 296 f \$1; #X obj 120 528 outlet; #X obj 171 496 outlet; #X msg 220 147 \$1; #X obj 171 386 unpack f f; #X obj 221 463 outlet; #X text 270 462 channel; #X text 265 305 since Pd defaults lack of argument to 0 I can't think of a way to get this to separate parameter 0 properly. So 0 becomes omni. Sorry!; #N canvas 518 368 751 539 1001-filter_proper_input 0; #X obj 37 19 inlet; #X obj 37 419 outlet; #X obj 37 294 glue; #X obj 85 292 nop; #X obj 37 42 route 99; #X obj 37 72 t f b; #X obj 37 330 route 38; #X msg 67 207 list; #X obj 37 376 route 6; #X obj 37 397 route 98; #X msg 37 353 \$2 \$4 \$6 \$5 \$3 \$1; #X text 251 10 Okay \, cleaner than before.; #X text 239 358 Reorder them with controllers followed by values; #X text 239 386 If the controllers route properly \, it's an NRPN! ; #X obj 213 241 sel; #X obj 127 192 route list float; #X obj 127 216 route 98 6 38; #X obj 229 262 bang; #X text 243 43 When CC 99 comes in \, append the next four CC controllers. [glue]; #X text 274 206 Um \, this part made more sense before \, basically make sure the [glue] doesn't fill up with crap if the CCs aren't NRPN. ; #X connect 0 0 4 0; #X connect 2 0 3 0; #X connect 2 0 6 0; #X connect 2 0 15 0; #X connect 3 0 2 1; #X connect 4 0 5 0; #X connect 4 1 2 0; #X connect 5 0 2 0; #X connect 5 1 7 0; #X connect 6 0 10 0; #X connect 7 0 2 1; #X connect 8 0 9 0; #X connect 9 0 1 0; #X connect 10 0 8 0; #X connect 14 1 17 0; #X connect 15 0 16 0; #X connect 15 1 14 1; #X connect 16 3 14 0; #X connect 17 0 7 0; #X restore 120 186 pd \$0-filter_proper_input; #N canvas 0 0 568 312 1001-MSB_and_LSB 0; #X obj 79 78 unpack f f f f; #X obj 131 149 +; #X obj 79 148 +; #X obj 79 114 * 128; #X obj 131 113 * 128; #X obj 79 180 pack f f; #X obj 79 47 inlet; #X obj 79 250 outlet; #X text 218 82 All that's left is the MSB and LSB values for the parameter \, and the parameter value. These are used to calculate the parameter and parameter value; #X connect 0 0 3 0; #X connect 0 1 2 1; #X connect 0 2 4 0; #X connect 0 3 1 1; #X connect 1 0 5 1; #X connect 2 0 5 0; #X connect 3 0 2 0; #X connect 4 0 1 0; #X connect 5 0 7 0; #X connect 6 0 0 0; #X restore 120 214 pd \$0-MSB_and_LSB; #X text 192 247 pick the right NRPN controller; #X connect 0 0 3 0; #X connect 0 1 3 1; #X connect 0 2 3 2; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 26 0; #X connect 5 1 6 0; #X connect 6 0 17 0; #X connect 6 0 21 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 6 1; #X connect 12 0 22 0; #X connect 13 0 18 0; #X connect 14 0 15 0; #X connect 15 0 12 1; #X connect 16 0 19 0; #X connect 16 1 12 0; #X connect 17 0 26 0; #X connect 18 0 14 0; #X connect 21 0 23 0; #X connect 22 0 20 0; #X connect 22 1 19 0; #X connect 26 0 27 0; #X connect 27 0 16 0; #X restore 110 264 pd \$0-nrpnin_guts; #X text 18 95 Notes: Parameter 0 will make the object omni. This has to do with Pd defaulting absent arguments to 0 Sorry!; #X text 17 71 Arguments: NRPN parameter \, MIDI channel - just like [ctlin]; #X obj 147 19 cnv 15 15 15 empty empty nrpnin 0 8 1 14 -262144 -99865 0; #X text 28 394 David McCallum \, 2004 - sintheta.org; #X connect 11 0 7 0; #X connect 11 1 8 0; #X connect 11 2 9 0;