Foolproof way to gate node output?

Hi so I’m amazingly stuck on just one issue and I can’t get my head around it.

Imagine there’s a node sending sporadic signals. For example keyboard input.

How do I simply gate all output from that node??!!! Obviously I can use a select output - but the problem is that when I open the gate (ie send the switch a “true”) this event also runs out through the gate giving me an unwanted signal. I’m sure there must be an easy way of doing this, but I can’t figure it out.

Could you provide a simple composition that demonstrates the problem? I want to make sure I understand what you’re trying to do.

Hi, I copied this text out of the documentation for “Select Output” and it represents the problem pretty well:

Events that come in through the In port or Which port are passed on through the selected output port (and no other output port).

So the act of opening the gate sends a rogue event into the composition… I only want genuine events that are being sent from the source (whatever this may be).

Here’s a composition I made trying to figure out a way to do it, I set it so that it would play a sound when the gate sends an event. Obviously the audio file is not included, I don’t know how to do that.

making gates urgh.vuo (4.5 KB)

It’s probably an easy node to program, I haven’t tried programming my own nodes but I feel like this would be a pretty quick one to make. If there’s no existing node maybe I’ll have a go.

thanks for your quick response!!!

You can solve it by inserting a Hold Value node — which is very often the one to use if you need to block events. Your case is similar to the Reuse the output of a node without re-executing the node case in the manual, which provides more explanation.

making gates - Hold Value.vuo (6.1 KB)

Thanks for the response!

I knew it would be a simple solution but I just couldn’t figure this out on my own. I tried dozens of approaches lol for example adding spinoff events and select latest. I tried using hold event more than once but I think I kept putting it on main channel rather than the switch lol.

My limited background in programming etc is mostly with modular audio type stuff, and there would always be way to perfectly gate an input. So when there wasn’t any node like that I struggled to think outside the box. I think I have some votes left so maybe I’ll vote for a perfect gate node, it might help newbies and it would be nice to do it with just one node rather than three.

thanks again

Hi @video_piglet

Is the joined composition what you’re looking for ?

Just added a wall to the “which” input port on the node code.
If yes, you can copy-paste the node in your modules folder.

Hope this helps.

making gates urgh (5.8 KB)


Amazing!!! Looks good, I can imagine using this node a lot.

1 Like