logic circuit

Jun 23, 2010 at 8:21pm

logic circuit

I have a dual system running. At a certain moment the two toggles can be on zero and the system stops. What can I use to send a bang in case of two toggles arrive at zero?

#48007
Jun 23, 2010 at 8:32pm

If you add the output of 2 toggles together, and the result of that addition is 0, then you know both toggles will be on 0…….

– Pasted Max Patch, click to expand. –
#172618
Jun 23, 2010 at 8:45pm

wouldn’t the following modification of Tim’s solution be more intention revealing:

– Pasted Max Patch, click to expand. –

?

#172619
Jun 23, 2010 at 8:50pm

Yes, but then you have to know what the bitwise && and ! mean…….and if the OP did they would probably have been able to work out how to do it :P

and I also didn’t think of doing it like that in the if object……. :P

#172620
Jun 23, 2010 at 8:52pm

that’s logical &&, not bitwise, otherwise point taken :-)

#172621
Jun 23, 2010 at 8:53pm

haha right you are

#172622
Jun 24, 2010 at 9:28am

Thank you very much for your brain power!! This patch integrated and the system keeps going!
Well done!

#172623
Jun 24, 2010 at 10:09am

of course the funny thing now is that I can’t switch it off anymore…

#172624
Jun 24, 2010 at 11:05am

could use a gate to interrupt the triggering to turn it off

#172625
Jun 24, 2010 at 11:25am

what do you mean “can’t switch it off”?

#172626
Jun 24, 2010 at 11:38am

one toggle is the master qmetro for the system. The other a sub toggle metro object. When the two are zero they receive a bang now and therefore I can’t turn it off anymore.

#172627
Jun 24, 2010 at 12:41pm

Gate is a good solution. Thanks.

#172628
Jul 1, 2010 at 5:10pm

Could you help me once more with your logic please?
What do we write if we want this to be for three toggles?
I tried this but it does not work.

– Pasted Max Patch, click to expand. –
#172629
Jul 1, 2010 at 5:40pm

In that patch you’re only really checking for 4 conditions:

0 0 0 – 1 (bang)
1 0 0 – 0
0 1 1 – 0 (because you’re sending 1 toggle to 2 inlets)
1 1 1 – 0

It needs to be checking for:

0 0 0 – 1 (bang)
1 0 0 – 0
0 1 0 – 0
0 0 1 – 0
1 1 1 – 0

Like this:

– Pasted Max Patch, click to expand. –
#172630
Jul 1, 2010 at 6:24pm

Thank you Tim!!
That’s very well done.

#172631
Jul 1, 2010 at 7:37pm

You’ll have to take those truth tables with a pinch of salt, they’re incomplete :)

#172632
Jul 2, 2010 at 1:04pm

Here’s how I’d do it:

– Pasted Max Patch, click to expand. –
#172633
Jul 2, 2010 at 5:24pm

Thanks Tim and Psycho!
Tim, I use your suggestion at the moment. Now, I need it the other way around. What do I write when I want bang when all the toggles are on?!

#172634
Jul 2, 2010 at 5:56pm

In general, I’d use pak instead of triggers:

– Pasted Max Patch, click to expand. –
#172635
Jul 2, 2010 at 6:12pm

Now that ^^ is a much neater way of doing it! Like in Ben’s example, you just need to remove ! from the if statement. ! means logical “not”, so using ! in the if object is like using a NAND gate, and you remove it if you just want an AND…..which is what && means.

#172636
Jul 2, 2010 at 6:36pm

Many thanks to everyone!! This way I can keep the CPU away from 100%….

#172637
Jul 4, 2010 at 6:39pm

hello logic circuit minds!
Thanks to your help, I can prevent the system from stopping or from cpu overload.
Listening to my patch made me want to do one more thing with the logic circuit.
Here is the situation:
I have connected the following circuit to five vst instrument to prevent them to stop

– Pasted Max Patch, click to expand. –

Listening to the patch made me want to add one more circuit. I would like to build a second one which in case of only one instrument is playing will give a bang. So “if only one of five is on->bang.
I want to send the bang to a random object with argument 5 attached to a gate of five attached to the five vst’s.

Now the catch is that it can happen to send the band to the one which is on and would turn it off. That is the worst case, but how can I tell gate, or any other object which of the five is on and in that case to send the bang to one which is off?
It needs something that updates the state of the five vst’s…..

#172638
Jul 4, 2010 at 9:08pm

I’ve had a go so hopefully I understood what you need. It’s not the best way of doing it either, I know that; but someone else will chip in with a better solution which I look forward to! I’ve not got enough time to patch about for a while till it works.

– Pasted Max Patch, click to expand. –
#172639
Jul 5, 2010 at 11:00am

Hi Tim,
you are a real wizzard! It is exactly what I was thinking of. Thanks.
This gives a very high probability that another instrument will be turned on.
Maybe there is one more logical step to be done to say ‘if the random output equals the sending output take another one’
This way it would always work.

#172640
Jul 5, 2010 at 11:20am

Tim,
two more things came to my mind.
I could live without a random object too. As long as a second instrument will be switched on avoiding to switch off the remaining, it will be fine.

What interests me a lot about this patch is the fact that it seems to ‘be conscious’ about it’s own state and I would like to explore that a little bit more. Maybe building a sort of ‘consciousness object’……

#172641

You must be logged in to reply to this topic.