If you have many if-thens,Ors,Ands,Equals,… actually a complex logical situation my favourite choice is automata.node, which is a finite state machine.
Tonfilm found a cool graphical tool and made a patch, for creating easily automata states and conditions. Check his page for its usage.
With automata.node you get both a bang, if state changed, and an event-long state, which you can transfer by sift.string or equal.string in a toggle on/off. It has just bangs as inputs.
Im always doing the “logic” or “brain” of my programs with this one. Something like: only if user hit this first, they will see this and can hit this and that now. If they hit this first, than nothing happens.
adding a reset bang to get to the initial state was on my todo list. but i would make two iputs more, one boolean to enable the reset bang, and one string to give it a custom name (default is Reset) because if someone uses the “Reset” input already to get to another state in it could lead to a error.
Hey, thank you for all the answers, this is clearing up how vvvv manages data.
I was wondering, is it possible to script on vvvv?, maybe it would be an easier way to uses these operators.
@tonfilm: Good point. I just did it in a way I use it often. Keeping it more customizable is good style. Already uploaded ;) Btw thanks for your cool, time and nerves saving workflow. @efe: Im at a point, where I use it as soon as Im going to need more than three logical operators (And,Or,Not) to get some bangs. Often it wont be limited to three only and then the mess starts, instead of having started with automata directly.
in all of my latest projects automata was the main control unit. the patch structure was like this:
user inputs -> logic -> graphical elements
it is always best to do a strict destinction between the logic and the graphics in a big patch. that means you hava one complicated patch with an automata, which has all states your patch can be in. from this patch you have many outputs that fade, enable or move in all of your graphical elementes.
have a look at the first picture on the graphical automata site, to get an idea of the state logic.