Gating problem

Sep 19, 2013 at 12:55pm

Gating problem

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

#265752
Sep 19, 2013 at 1:30pm

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.

#265754
Sep 19, 2013 at 1:41pm

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]

#265755
Sep 19, 2013 at 1:47pm

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
#265756
Sep 19, 2013 at 2:16pm

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>

#265760
Sep 19, 2013 at 2:33pm

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

– Pasted Max Patch, click to expand. –

:)

#265762
Sep 19, 2013 at 10:14pm

Do you really need a gate?

<code>

– Pasted Max Patch, click to expand. –

</code>

#265773
Sep 19, 2013 at 11:58pm

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!

#265777
Sep 20, 2013 at 2:41am

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>

#265781

You must be logged in to reply to this topic.