Forums > MaxMSP

Gating problem

September 19, 2013 | 12:55 pm

Hello all,

I have a certain situation:
Say I have 10 open gates, but only gate 5 is closed. When I want to close gate 4, I need to open gate 5 first.

In other words: how can I store numbers and recall them so that I know which gate was last closed? (something like: opengate(lastgate) && set lastgate(4))

I hope I’ve explained this well enough, thanks for reading!

Greets Rowan


September 19, 2013 | 1:30 pm

You could send two messages at the same time. The first message would open all gates and the second would close the gate of your choice.


September 19, 2013 | 1:41 pm

for only 10 gates i would write the states in a list, for example by storing them using

[pak 0 0 0 0 0 0 0 0 0 0]
[zl reg]


September 19, 2013 | 1:47 pm

You sir, are a hero. I now have it like this:

– Pasted Max Patch, click to expand. –

EDIT: also thanks to you Roman!

Attachments:
  1. gates.maxpat

September 19, 2013 | 2:16 pm

I agree with Roman that storing the states of all gates is better. However, here’s a very literal answer to your question:

<code>

– Pasted Max Patch, click to expand. –

</code>


September 19, 2013 | 2:33 pm

Thanks a lot guys! I managed to create this little jem:

– Pasted Max Patch, click to expand. –

:)


September 19, 2013 | 10:14 pm

Do you really need a gate?

<code>

– Pasted Max Patch, click to expand. –

</code>


September 19, 2013 | 11:58 pm

Hey MZED, I’m using a gate so I can reuse the message coming through, instead of with a select that would only output a bang. Though I do need the part you did not include in your previous post, which checks if the new message coming through is different from the previous stored one.

Thanks!


September 20, 2013 | 2:41 am

then [routepass] !

<code>

– Pasted Max Patch, click to expand. –

</code>

edit : hm, were you also looking for [change] ?
<code>

– Pasted Max Patch, click to expand. –

</code>


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