Forums > MaxMSP

using ctlin to control different elements from the same control numbers

February 8, 2006 | 6:36 pm

I’m using [ctlin], [select] and [match] to control different processes based
on the control number and/or the control value. Is there any way that when
one controller number and value match given numbers, all the already
specified values and numbers when selected and/or matched, control entirely
different processes? Here’s an example. How do get max to perform
‘function two’ when ctlin matches 2 2 2? Also, it should be considered that
these controllers are sensors. Thanks.

max v2;
#N vpatcher 15 55 792 556;
#P window setfont "Sans Serif" 9.;
#P comment 230 355 51 9109513 Function 2;
#P comment 357 321 51 9109513 Function 2;
#P comment 299 322 51 9109513 Function 1;
#P newex 628 349 40 9109513 change;
#P button 520 283 15 0;
#P newex 520 230 42 9109513 pack i i i;
#P newex 520 155 40 9109513 ctlin a;
#P newex 520 258 54 9109513 match 2 2 2;
#P button 366 300 15 0;
#P button 329 299 15 0;
#P number 235 329 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 171 329 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 441 262 15 0;
#P button 349 254 15 0;
#P number 441 237 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 349 229 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 441 207 27 9109513 int;
#P newex 349 200 27 9109513 int;
#P newex 392 177 48 9109513 select 7 1;
#P number 432 139 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 392 139 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 349 142 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 368 113 40 9109513 ctlin a;
#P number 206 274 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 206 244 27 9109513 int;
#P number 166 132 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 206 212 15 0;
#P newex 206 159 34 9109513 pack i i;
#P newex 206 84 40 9109513 ctlin a;
#P newex 206 187 49 9109513 match 1 1;
#P comment 165 357 51 9109513 Function 1;
#P connect 2 0 5 0;
#P connect 7 0 19 0;
#P fasten 2 1 3 0 226 143 211 143;
#P connect 3 0 1 0;
#P connect 1 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 7 0;
#P fasten 5 0 6 1 171 236 228 236;
#P fasten 2 2 3 1 241 161;
#P connect 7 0 20 0;
#P connect 17 0 21 0;
#P connect 8 0 9 0;
#P fasten 12 0 13 0 354 196;
#P connect 13 0 15 0;
#P connect 15 0 17 0;
#P fasten 9 0 13 1 354 186 371 186;
#P connect 17 0 22 0;
#P connect 8 1 10 0;
#P connect 10 0 12 0;
#P connect 8 2 11 0;
#P fasten 12 1 14 0 416 200 446 200;
#P connect 14 0 16 0;
#P connect 16 0 18 0;
#P fasten 9 0 14 1 354 171 463 171;
#P connect 24 0 25 0;
#P connect 25 0 23 0;
#P connect 23 0 26 0;
#P connect 24 1 25 1;
#P fasten 24 2 25 1 555 232;
#P pop;


February 8, 2006 | 8:26 pm

Haven’t had a chance to look at your patch in detail, but usually the
best way to do this is to use separate ctlin objects. Then you don’t
have to do as much selection logic. ie define each possible
controller/channel combination and use a separate ctlin for each one.
Then you only need to select on controller value for your result.

Hope that helps

L

Lawrence Casserley – lawrence@lcasserley.co.uk
Lawrence Electronic Operations – http://www.lcasserley.co.uk
Colourscape Music Festivals – http://www.colourscape.org.uk


February 8, 2006 | 9:14 pm

I’m sorry if i didn’t explain myself well, but I need a way to get a
different result out of the same selected numbers based on a different
ctlin, i’m thinking in terms of a gate, bucket, or route?


February 8, 2006 | 9:41 pm

On 8 Feb, 2006, at 21:14, baby.squirrel wrote:

> I’m sorry if i didn’t explain myself well, but I need a way to get a
> different result out of the same selected numbers based on a different
> ctlin, i’m thinking in terms of a gate, bucket, or route?
>
OK – two strategies

1 – use separate ctlins – select the numbers you want from each and use
those to trigger different things.

2 – use one ctlin – remember that the data will emerge R to L – ie
first the MIDI channel, second the controller number, third the data.
The first two are used to determine a value to gate, which determines
where the data will go – is that what you want?

Lawrence Casserley – lawrence@lcasserley.co.uk
Lawrence Electronic Operations – http://www.lcasserley.co.uk
Colourscape Music Festivals – http://www.colourscape.org.uk


Viewing 4 posts - 1 through 4 (of 4 total)