Forums > MaxMSP

Thee shall not pass

March 7, 2007 | 1:32 pm

Hi everyone, i tried searching the forum for an answer to my query but couldnt really find anything, its quite specific:

I need an object/series-of-objects that allow only certain values to be passed through it. The values will come from a counter and so will be ints. For example, for a [counter 1 10], something that only lets the numbers 3, 6 and 7 thru. But i need to be able to change the number which are allowed thru (eg. now let 3, 5, 8 and 9 thru) while the patch is locked.

Does anyone know of an object/series-of-objects that could help?



_j
March 7, 2007 | 2:27 pm

funbuff would work. Check the help file. Set whatever you want to pass with a 1 and use a gate.


March 7, 2007 | 2:35 pm

On 7 mars 07, at 14:32, Bill Murray wrote:

> I need an object/series-of-objects that allow only certain values to
> be passed through it. The values will come from a counter and so will
> be ints. For example, for a [counter 1 10], something that only lets
> the numbers 3, 6 and 7 thru. But i need to be able to change the
> number which are allowed thru (eg. now let 3, 5, 8 and 9 thru) while
> the patch is locked.

There are many ways…

A couple of [split n n] for instance.
Now if the number of ints you want to track is variable and can be
high, it may be a little inelegant to do so.

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://users.skynet.be/crfmw/max


March 7, 2007 | 2:47 pm

Wouldn’t it work with just a single ‘zl sect’?


March 7, 2007 | 3:17 pm

This is one of those cases where there is no single object to do what you want because doing so involves the manipulation of some number of very simple Max objects. There are any number of ways to do this, using the split, route, or basic test objects. For one thing, you could go have a look at the tutorial chapter on testing values….


March 7, 2007 | 4:30 pm

Made an example:

#P number 203 43 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 183 133 50 196617 3 6 8;
#P button 81 43 15 0;
#P newex 81 62 40 196617 uzi 10;
#P button 183 43 15 0;
#P newex 183 85 46 196617 zl group;
#B color 5;
#P newex 183 110 62 196617 prepend set;
#P newex 132 43 48 196617 loadbang;
#P newex 27 156 63 196617 print output;
#P number 27 135 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 132 85 43 196617 1 4 5 9;
#P newex 27 112 40 196617 zl sect;
#P toggle 27 43 15 0;
#P newex 27 62 52 196617 metro 50;
#N counter 0 0 10;
#X flags 0 0;
#P newobj 27 83 77 196617 counter 0 0 10;
#P window linecount 2;
#P comment 232 81 100 196617 list of numbers to let through;
#P connect 15 0 10 0;
#P fasten 10 0 4 1 188 106 62 106;
#P connect 10 0 9 0;
#P connect 9 0 14 0;
#P connect 13 0 12 0;
#P connect 12 2 4 0;
#P connect 1 0 4 0;
#P connect 2 0 1 0;
#P connect 11 0 10 0;
#P connect 6 0 7 0;
#P connect 8 0 5 0;
#P connect 3 0 2 0;
#P connect 4 0 6 0;
#P fasten 5 0 4 1 137 106 62 106;


March 7, 2007 | 6:38 pm

thanks guys for your input, but i can’t see how any of those things may work. granted this is probably down to my inexperience but if i describe my problem more specifically, maybe someone can explain.

i have numbers going into a funbuff (right inlet). when each number is sent to funbuff, it triggers a counter (counting from 1 to 5) which sends its value to the left inlet of funbuff and is therfore the address of the number i initially sent. (i use a buddy to make sure things arrive at the right time)

the numbers are retrieved from funbuff using a [random 5] (1 is added to the value coming from random to make it in range) when stored numbers come out of funbuff, they are played as a midi note (there is a similar velocity system)

so if i decide i dont want notes 2 and 3 not to be played when [random] sends their address to funbuff, i need something which allows me to either stop the numbers 2 and 3 going into funbuff or something which catches them on the way out and re-routes them (but because "2" and "3" are addresses, i need something which will know the address of the stored value exiting funbuff)

now i know i could use a route after the random object to route numbers 2 and 3 elsewhere – easy. but i need to be able to change the argument of the route while the patcher is locked – and i need to change the number of arguments. e.g. i may want to turn of notes 2 and 3 for a while, but then i want to turn 2 on again, and have 3, 4, and 5 off.

Sorry if i havent explained myself well, i may be going about this all wrong.

thanks for reading :)



Anonymous
March 8, 2007 | 10:12 am

if I understand what you want to do, I would use the table object.
Set table size to 5 (if you have 5 notes) and table range to 2 (0 –
no play, 1 – play).

Best,

Juergen

Am 07.03.2007 um 19:38 schrieb Bill Murray:

>
> thanks guys for your input, but i can’t see how any of those things
> may work. granted this is probably down to my inexperience but if i
> describe my problem more specifically, maybe someone can explain.
>
> i have numbers going into a funbuff (right inlet). when each number
> is sent to funbuff, it triggers a counter (counting from 1 to 5)
> which sends its value to the left inlet of funbuff and is therfore
> the address of the number i initially sent. (i use a buddy to make
> sure things arrive at the right time)
>
> the numbers are retrieved from funbuff using a [random 5] (1 is
> added to the value coming from random to make it in range) when
> stored numbers come out of funbuff, they are played as a midi note
> (there is a similar velocity system)
>
> so if i decide i dont want notes 2 and 3 not to be played when
> [random] sends their address to funbuff, i need something which
> allows me to either stop the numbers 2 and 3 going into funbuff or
> something which catches them on the way out and re-routes them (but
> because "2" and "3" are addresses, i need something which will know
> the address of the stored value exiting funbuff)
>
> now i know i could use a route after the random object to route
> numbers 2 and 3 elsewhere – easy. but i need to be able to change
> the argument of the route while the patcher is locked – and i need
> to change the number of arguments. e.g. i may want to turn of notes
> 2 and 3 for a while, but then i want to turn 2 on again, and have
> 3, 4, and 5 off.
>
> Sorry if i havent explained myself well, i may be going about this
> all wrong.
>
> thanks for reading :)


March 8, 2007 | 4:16 pm

[zl sect] is your friend:

#P window setfont "Sans Serif" 9.;
#P number 179 167 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 339 136 50 196617 5 6 7;
#P message 339 167 50 196617 1 2 3 4;
#P message 295 162 14 196617 5;
#P message 231 282 50 196617 4;
#P newex 231 252 79 196617 prepend set;
#P message 237 118 14 196617 1;
#P newex 231 204 79 196617 zl sect 1 2 3 4;
#P window linecount 2;
#P comment 179 81 234 196617 zl sect will pass an int (or list) only
if it is part of a stored list (changed via the right inlet);
#P connect 8 0 1 0;
#P connect 7 0 1 1;
#P connect 6 0 1 1;
#P connect 5 0 1 0;
#P connect 3 0 4 0;
#P connect 1 0 3 0;
#P connect 2 0 1 0;
#P window clipboard copycount 9;

On Mar 7, 2007, at 1:32 PM, Bill Murray wrote:

>
> Hi everyone, i tried searching the forum for an answer to my query
> but couldnt really find anything, its quite specific:
>
> I need an object/series-of-objects that allow only certain values
> to be passed through it. The values will come from a counter and so
> will be ints. For example, for a [counter 1 10], something that
> only lets the numbers 3, 6 and 7 thru. But i need to be able to
> change the number which are allowed thru (eg. now let 3, 5, 8 and 9
> thru) while the patch is locked.
>
> Does anyone know of an object/series-of-objects that could help?


March 8, 2007 | 4:41 pm

ooops… my mail client isn’t properly threading, sorry for the late
(and redundant) reply

On Mar 8, 2007, at 4:16 PM, evan.raskob [lists] wrote:

> [zl sect] is your friend:
>
>

>
>
> #P window setfont "Sans Serif" 9.;
> #P number 179 167 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window linecount 1;
> #P message 339 136 50 196617 5 6 7;
> #P message 339 167 50 196617 1 2 3 4;
> #P message 295 162 14 196617 5;
> #P message 231 282 50 196617 4;
> #P newex 231 252 79 196617 prepend set;
> #P message 237 118 14 196617 1;
> #P newex 231 204 79 196617 zl sect 1 2 3 4;
> #P window linecount 2;
> #P comment 179 81 234 196617 zl sect will pass an int (or list)
> only if it is part of a stored list (changed via the right inlet);
> #P connect 8 0 1 0;
> #P connect 7 0 1 1;
> #P connect 6 0 1 1;
> #P connect 5 0 1 0;
> #P connect 3 0 4 0;
> #P connect 1 0 3 0;
> #P connect 2 0 1 0;
> #P window clipboard copycount 9;
>
>
> On Mar 7, 2007, at 1:32 PM, Bill Murray wrote:
>
>>
>> Hi everyone, i tried searching the forum for an answer to my query
>> but couldnt really find anything, its quite specific:
>>
>> I need an object/series-of-objects that allow only certain values
>> to be passed through it. The values will come from a counter and
>> so will be ints. For example, for a [counter 1 10], something that
>> only lets the numbers 3, 6 and 7 thru. But i need to be able to
>> change the number which are allowed thru (eg. now let 3, 5, 8 and
>> 9 thru) while the patch is locked.
>>
>> Does anyone know of an object/series-of-objects that could help?
>


March 9, 2007 | 11:58 pm

Bill Murray schrieb:
> I need an object/series-of-objects that allow only certain values to
> be passed through it. The values will come from a counter and so will
> be ints. For example, for a [counter 1 10], something that only lets
> the numbers 3, 6 and 7 thru. But i need to be able to change the
> number which are allowed thru (eg. now let 3, 5, 8 and 9 thru) while
> the patch is locked.

My humble attempt:

#P window setfont "Sans Serif" 9.;
#P number 135 122 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 169 91 50 196617 3 6 7;
#P message 195 114 50 196617 3 5 8 9;
#P newex 135 177 50 196617 print;
#N vpatcher 50 119 650 519;
#P window setfont "Sans Serif" 9.;
#P newex 150 116 55 196617 t l clear;
#P outlet 131 216 15 0;
#P inlet 131 95 15 0;
#P inlet 150 95 15 0;
#P newex 150 160 44 196617 pack i i;
#P newex 150 136 33 196617 iter;
#P newex 167 95 76 196617 patcherargs;
#N coll ;
#P newobj 131 193 49 196617 coll;
#P connect 5 0 0 0;
#P fasten 3 0 0 0 155 184 136 184;
#P fasten 7 1 0 0 200 184 136 184;
#P connect 0 0 6 0;
#P connect 4 0 7 0;
#P connect 1 0 7 0;
#P connect 7 0 2 0;
#P connect 2 0 3 0;
#P fasten 2 0 3 1 155 156 189 156;
#P pop;
#P newobj 135 151 70 196617 p ass;
#P connect 4 0 0 0;
#P connect 3 0 0 1;
#P connect 2 0 0 1;
#P connect 0 0 1 0;
#P window clipboard copycount 5;


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


March 12, 2007 | 11:32 am

Hehe, seems to me Stefan your ‘p ass’ is an exact remake of ‘zl sect’ for int inputs??

Both these examples allow only certain values though. To block certain numbers from going into funbuff, I’d make a list that includes all numbers in your range except the numbers to be blocked.
This isn’t beautiful, but as long as your list isn’t very long it’s ok:

#P window linecount 1;
#P message 84 60 34 196617 2 5 7;
#P newex 84 126 50 196617 print list;
#N vpatcher 278 327 460 571;
#P inlet 62 33 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 62 94 40 196617 t i i 1;
#P newex 17 183 46 196617 zl group;
#P newex 77 136 21 196617 t 0;
#P newex 32 74 40 196617 uzi 10;
#P window linecount 1;
#P newex 43 160 29 196617 gate;
#P window linecount 0;
#P newex 17 53 40 196617 t b b l;
#P newex 77 115 40 196617 zl sect;
#P outlet 17 204 15 0;
#P inlet 17 33 15 0;
#P connect 0 0 3 0;
#P connect 3 0 7 0;
#P fasten 4 0 7 0 48 180 22 180;
#P connect 7 0 1 0;
#P connect 3 1 5 0;
#P connect 8 2 4 0;
#P fasten 6 0 4 0 82 156 48 156;
#P connect 9 0 5 1;
#P connect 5 2 8 0;
#P connect 8 0 4 1;
#P connect 8 1 2 0;
#P connect 2 0 6 0;
#P connect 3 2 2 1;
#P pop;
#P newobj 84 96 92 196617 p inverselistitems;
#P number 38 102 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 38 166 63 196617 print output;
#P number 38 146 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 120 60 43 196617 1 4 5 9;
#P newex 38 126 40 196617 zl sect;
#P fasten 5 0 0 1 89 120 73 120;
#P connect 5 0 6 0;
#P connect 4 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 7 0 5 0;
#P connect 1 0 5 0;


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