• ### Universal logic gate for 2 bang streams

im trying to program an abstraction that takes 2 streams of bangs and

• first converts them to triggers that are a few microseconds long with 1/0
• tests for all possible logic gates AND | OR | XOR | NOT | NAND | NOR | XNOR
• outputs a bang for TRUE and nothing for FALSE for each state

this is for a control voltage sequencer for my modular. it should be fairly simple but somehow im getting all kinds of double bangs and there is something wrong with my approach. see file included ... any help is greatly appreciated.

http://www.pdpatchrepo.info/hurleur/logic-gate.pd

• Posts 13 | Views 9883
• in case thats not clear: the bangs are the beats in the sequencer. i want to generate new beats out of combining two beats so i need to test for 2 beats at the same time. its the old problem of "there is no same time in pd" but somehow i cant figure this one out.

• @lilakmonoke said:

its the old problem of "there is no same time in pd" but somehow i cant figure this one out.

i looked at your patch, and you come from Max? so much weird external stuff there it's like Chinese to Japanese.

but as far as timing goes, the general rule is to delegate it from whatever is doing the timing at the top of the chain. If you set the order correctly there, it will be easy to read in order later

• thanks no not from max. ive just been trying to solve this for hours and tried all kinds of add ons. i know about the timing issue and i can make sure the right bang is before the left but cant figure out the switching logic bangs -> 1/0 ... nobody here has done logic gate for bangs? seems like a very basic unit to me.

• what i would like to know: is the idea to convert bangs into 1/0 messages wrong or is there a simpler approach? ie. with spigot

• I have exactly the same problem.

(3 different sequencer trigger/gate outs to 1 ADSER trigger/gate in)

simultaneous trigger/gates must as 1 trigger/gate at the ADSR arrive

I tinker and just test with your patch.

• dont use that one its really just a desperate sketch ... here is something that actually works. its an and-gate that works with 2 bangs that are within 5 ms, of course you can adjust the time. so this is "at the same time" for all practical purposes. all the other logic states are simpler i think. i have bangs coming from all directions and sometimes in a circular manner so its not easy to schedule a hierarchy. i would still love to know what the professional approach to that problem is ...

on the bright side here is some modular music out of my sequencer ...

http://www.pdpatchrepo.info/hurleur/ANDgate.pd

• here is something that works almost if you want to give it a go. its creating the correct 1/0 statements but outputs double bangs on AND cases. if you pair that with the and-gate from before it should work but dont ask me how

http://www.pdpatchrepo.info/hurleur/logic-gate.pd

• Hello Lilak,

from your very good template, I was able to build this patch.
thank you!

greetings from Tempelhof, Kandy

http://www.pdpatchrepo.info/hurleur/logic-gate-2.pd

• very cool, thanks! (change) is the secret, ive never seen this before. so you are filtering out all multiple 1s with it and then reset the gate with 0. let me see the sequencer when its done, i will upload mine too. regreetings from prenzlberg! florian

• Hi Florian,

[change] is also good to reduce cpu load.

There are also [schange] for symbols.
I've found at Marian Weger
http://www.marianweger.com/public/

http://www.pdpatchrepo.info/hurleur/schange.pd

• Hi Florian,

[change] is also good to reduce cpu load.

There are also [schange] for symbols.
I've found at Marian Weger
http://www.marianweger.com/public/

http://www.pdpatchrepo.info/hurleur/schange.pd

• hi kandy ... amazing stuff, especially the 3d video projections. (pipe) is also really useful for delaying bangs. (pipe) with no time parameter seems to be delaying 0 ms but moves everything at the end of the event queue. it solved many other problems i had. thanks again!

Posts 13 | Views 9883
Internal error.

Oops! Looks like something went wrong!