Solving logical queries

dears,

i can’t come up with a solution for a recursive logic part of a patch i’m currently working on.

this part of the patch receives bangs by two external buttons using a boolean or (in the initial idle state, it’s unimportant which button is hit first). the first bang always triggers playing file1, but the next bang must only be accepted by the other switch, which would trigger file2. after this sequence, we’re back in an idle state and both buttons shall be queried again. as long as none of the two buttons were hit, all is idle.

the tricky part is that either buttons could send bangs any time. the importance is, that once a button is hit, it becomes #1 and then only #2 can trigger an action, as #1 already had it’s shot. only after #2 had it’s shot, the order of the buttons gets reset and the systems gets back to idle.

this could be something for Automata (Animation) but i can’t solve the different states part of it’s code.

any help appreciated!
pat

i would use this to build a state graph: graphicalautomata

so you have state Idle at first, then button 1 leads to state Button1File1 and button 2 leads to Button2File1 from this two states only the other button can lead to a state with file2 and so on…

hi patrick ,

probably FlipFlop (Animation) , OR and AND nodes helps you to achive what you need

hey tf, i installed qfsm and tried to set something up. connecting states and getting it all together failed me, thus i tried to write the automata code myself, which also failed as i couldn’t get my head to work this out in quadruples.

colorsound, seems i gotta crunch time it all over using those nodes. maybe it’s one of these illogical days where logic is a tougher one than usual …

thx to you so far!

meanwhile, @kalle got it sorted very nicely and i’m especially happy for that (THX!). getting there only halfway before, his patch might help others confronting similar issues to come up with a solution.

still, if there were a workshop on Automata (Animation) and qfsm, i’d be in :)

First Come, First Served. Second Come, Second Served. (12.7 kB)