Forums > MaxMSP

More elegant way to send messages through a gate?

July 12, 2009 | 3:50 pm

I need to extract the first element of a list and use it to open a gate, then send through a message.

I’m currently using (zil rot -1) to put the number at the end, then (zl ecils 1) to spit out the number first, and then the rest.

Is there a more elegant way to do this? I’m sure there is, but my brain doesn’t seem to be working.

– Pasted Max Patch, click to expand. –

July 12, 2009 | 4:32 pm

[trigger] can do it… mmmm, trigger.

– Pasted Max Patch, click to expand. –

July 13, 2009 | 2:27 am

thats what [route 2 3 4 5] does when you send it "3 info".


July 13, 2009 | 5:09 am

@seejayjames:

that’s what I thought at first, but then you need to have two patch cords from the sources of your message to the gate. The (zl rot) followed by (zl ecils) maneuver only has to be set up once, right before the gate.

@Roman:

route works well for this, but there are circumstances in which I need to keep the gate open for subsequent messages, which are not prefixed with a number.

But thanks for your comments – I learn a lot this way (and hope it is useful for you too)


July 14, 2009 | 8:51 am

Doesn’t this kinda show the inlets of [gate] are the wrong way around? I’ve always had less than average love for this object , because it feels odd. Never really thought about the why, does anyone know? Seems logical to me the main data goes though left inlet, left outlet by default.



jml
July 15, 2009 | 2:13 am

would this work?

– Pasted Max Patch, click to expand. –

jml


July 15, 2009 | 12:24 pm
Bas van der Graaff wrote on Tue, 14 July 2009 10:51
Doesn’t this kinda show the inlets of [gate] are the wrong way around? I’ve always had less than average love for this object , because it feels odd. Never really thought about the why, does anyone know? Seems logical to me the main data goes though left inlet, left outlet by default.

i know exactly what you mean, and this is why my custom gate
abstractions all take the data in their left inlet.

the guy who invented the [gate] object in 1861 was probably
left-handed? there is no other logical explanation for that.

-110


July 15, 2009 | 12:32 pm

[quote title=Roman Thilenius wrote on Wed, 15 July 2009 14:24]

Bas van der Graaff wrote on Tue, 14 July 2009 10:51
Doesn’t this kinda show the inlets of [gate] are the wrong way around? I’ve always had less than average love for this object , because it feels odd. Never really thought about the why, does anyone know? Seems logical to me the main data goes though left inlet, left outlet by default.

i know exactly what you mean, and this is why my custom gate
abstractions all take the data in their left inlet.

it still happens to me after 8 years that i connect a [gate]
wrong and need 10 minutes to find it.

the guy who invented the [gate] object in 1861 was probably
left-handed? there is no other logical explanation for that.

but back to the original question:

[zl slice 1]+[buddy] could replace your [zl rot][zl ecils 1]
but thats two objects, too, and it won´t work with less.

-110


July 15, 2009 | 12:59 pm

I would format all those messages so they have the ID first and simply use route.

Designing patches in the most logical (and simple) way helped me a lot when they got complex.

Keynames in messages -> [route] is very handy to not loose track of what is going where (and keep patches readable for the future).

My 0.02€…

_y


July 15, 2009 | 9:07 pm

sounds to me like you need to filter a number in certain circumstances but not in others. you could just use a select object for that.


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