Compare four values at once and other complicated logic (to me at least).
Nov 23 2022 | 11:20 pm
I would like to make buttons that control multiple things at once. Incase all the elements that they control are in the same state (on/off) I would like to get a different behaviour out of the buttons than if the receiving elements they are going into are in different states.
So: 1 1 1 1 --> Instantly turn all elements off and then on again, repeat. But: 1 0 1 0, 1 1 0 0, etc.. --> Only turn off elements on, and after that have all 4 elements behave normally (turn all off, all on, repeat).
Is there a way to compare all 4 elements at once? And only if all are on 1 or 0 change their state immediately. But if they are different, i.e. 1 0 1 0 only change the state of the 0s first to get them all to the same state (1) first?
I wonder if there is a good list comment. With a little help I could also get into more programming territory, but I am not experienced with that at all.
To complicate things further I also want to gate which of the four elements the buttons control (I'm building a special type of sequencer). I have installed four gates which can be triggered via toggle. These gate off the control to the four elements. So I can choose to control only elements 1, 2, and 4 or any combination. That would mean, that I don't want to always compare all four elements. Ideally I only compare what ever elements are "selected" to be controlled. Elements which are not selected should be dynamically left out of the comparison.
I would be very thankful for any pointers to useful commands or objects. If someone could maybe build a little example patch that would be absolutely incredible.
(If someone is interested I will try to share an example, but my file is very big and reliant on Push. So it would probably be better to make a whole new testing patch to share with you.)