In the meantime, I thought to share my little workaround abstraction.
The [pack] construct at the end of the line isn't necessary and could be
replaced by a second outlet. But I found it very practical for my
purposes - especially with the reversal of elements allowing to [route]
by CC number.
Hallo,
Urs Liska hat gesagt: // Urs Liska wrote:
I'm feeling a little bit dumb, but is it really not possible to restrict
the output of [ctlin] to input from a specific channel (but all CC#s)?
As far as I can see it is only possible to filter by a CC number (on all
channels) or a channel _and_ a CC number.
You're right, it is not possible. Reason is, that [ctlin] uses
positional arguments and the first argument always is the CC number,
while the second is the midi channel.
I see two ways out, if ctlin should change:
One is keyword arguments or attributes as made popular by flext
externals. Then it could look like this [ctlin @chan=7 @cc=3] and you
could exchange @chan and @cc.
The other solution would be a wildcard as in using [ctlin * 10] to get
all controllers from midi channel 10.
For simplicity I'd prefer the second solution actually. It could also
be used for [ctlout]
Ciao
--
Urs Liska
Glümerstr. 5
D-79102 Freiburg
www.graft-music.com
www.suono-mobile.de
[Pd 0.39.0, WinXP]
#N canvas 394 174 458 347 12;
#X obj 47 114 ctlinCh 4;
#X text 15 6 Abstraction ctlinCh;
#X text 15 21 Outputs midi information from a specific channel;
#X text 16 42 Output is packed as a message with;
#X text 16 56 controller number and value.;
#X text 17 74 This order makes it possible to [route] the result;
#X obj 116 147 unpack 1 1;
#X floatatom 116 171 5 0 0 0 - - -;
#X floatatom 191 173 5 0 0 0 - - -;
#X obj 47 202 route 7 11 34 99;
#X floatatom 47 229 5 0 0 0 - - -;
#X floatatom 77 252 5 0 0 0 - - -;
#X floatatom 108 277 5 0 0 0 - - -;
#X floatatom 139 301 5 0 0 0 - - -;
#X text 211 240 specific controller numbers;
#X text 139 114 Creation argument is channel number;
#X text 215 143 Option 1: unpack the msg;
#X text 194 223 Option 2: check for;
#X connect 0 0 6 0;
#X connect 0 0 9 0;
#X connect 6 0 7 0;
#X connect 6 1 8 0;
#X connect 9 0 10 0;
#X connect 9 1 11 0;
#X connect 9 2 12 0;
#X connect 9 3 13 0;
#N canvas 380 102 334 343 12;
#X obj 124 92 ctlin;
#X obj 109 179 spigot;
#X obj 177 180 spigot;
#X msg 159 143 1;
#X msg 202 142 0;
#X obj 159 118 sel $1;
#X obj 109 305 outlet;
#X text 2 8 abstraction ctlinCh;
#X obj 109 274 pack 1 1;
#X obj 109 243 int;
#X obj 109 204 t b f;
#X text 5 24 Restricts ctlin to specified channel;
#X text 5 46 and packs CC# Value message;
#X connect 0 0 1 0;
#X connect 0 1 2 0;
#X connect 0 2 5 0;
#X connect 1 0 10 0;
#X connect 2 0 9 1;
#X connect 3 0 1 1;
#X connect 3 0 2 1;
#X connect 4 0 2 1;
#X connect 4 0 1 1;
#X connect 5 0 3 0;
#X connect 5 1 4 0;
#X connect 8 0 6 0;
#X connect 9 0 8 0;
#X connect 10 0 9 0;
#X connect 10 1 8 1;