Custom node vararg

Is there any way to make custom node with vararg inputs, pulse output and custom implementation in c++?

Hello! Nope. The only way to have the adjustable number of inputs currently is variadic nodes which clear away the variadity on the road to C++. However, in their current form, they implement the well-known reduce pattern also known as folding, so it should be easy enough to implement whatever you want with the current features.

The only down-side of the current implementation is that code has to conform to a cascading layout. Works great for add and even FIFO queues. Not so good for stacks where data needs to flow backward as well as forward. Things like #lines for an LCD display can also be difficult.

Would be nice if there was some way to create a not-implemented-in-xod node with variadic inputs that you could reference as an array with “constants” for determining # of pins. Instead of the cascade model, you would have to hard-code the implementation with loops or other appropriate code. Maybe a new variadic node representing one input pin-group with an output pin for # of pins currently expanded to? You might need to make a rule that current variadic nodes cannot exist in same patch as this new variadic input. variadic-hardcode? variadic-manual? variadic-i-am-in-deep-now?

Closely related, a nice feature would be to have output pins on existing variadic-# nodes that would provide current level being processed and total # pins so you don’t need to add an extra input/output pin to nodes to pass level to the next iteration.

1 Like

I understand what you are talking about. Having a quite rich programming background I’m almost sure that when we have variadic pins pass/forwarding implemented, almost all complex cases will become possible. Although a small mindset change is required, it should be easy if we provide enough examples.

So, I suggest to wait for the forwarding and to try it. A further extension should be based upon the new experience.