Switch-bug?
Hello peoples (again)
I think i may have found some "irregular" behaviour with the switch-object. In the patch i have to switches, one has 3 inputs, the other 16. They're both connected to exactly the same inputs and only one of them responds. The patch below illustrates this.
This isn't normal, right? Or am i missing something here?
FRid
intel core 2 quad cpu q6600
WinXp.
Looks like a right-to-left ordering problem. Try using a [trigger] after the [unpack] to send the number to the first inlet of the [switch]es before the [select] object.
lh
Ah, thanks man!
But what i don't understand is why the switch with only 3 inputs is working and one containing 16 isn't. Why aren't they both non-responsive? This is why it made me think it was a bug of some sort. Also because i had made similar setups before without problems.
FRid
If an output on a max object is connected to more than one inlet it sends data to them in right-to-left order. You can use [trigger] to choose a specific order. In your example you send the number to set the rightmost [switch] outlet, then you send it to the [select] and then to set the leftmost [switch] outlet. This means the left [switch] is always closed when the next number is sent. I've posted an example of how to use [trigger] and some other methods which might be easier for you to use.
lh
Aah, so thats it. But why the "arabian" approach then or is this programming-logic i have yet to comprehend?
Really like the Zl-approach, thanks for that one!
FRid
That is because generally the leftmost inlet of an object is "hot", other inlets set certain things while the first inlet is usually the only one to cause an output. There has to be some sort of standard for order of execution and this is the one max uses. Learn to love it! To be honest [trigger] is one of my most frequently used objects. When I was just starting with max I hadn't discovered it and sometimes moving an object to a different position in a patch would break it and then it would take ages to figure out what had changed. Now I try to have only one patch cord coming from any outlet.
lh