Why zl.change is not working for me?
Hi! I have this patcher... I want to avoid to send the same message more then once.
I need to compare both of inputs and if one of the two inputs changes than send a new message.
I tried with change before the sprintf function but I have some issues, I want to compare the output of sprintf and send it only if is changed.
Why zl.change does not work? look at the console, input is the same (also the other one, but not shown) but zl.change does not filter it out.
how can I achieve this?
Thanks
You need to apply your text formatting (the comma) after the zl change.
It's hard to see from the rest of the patch what you're trying to do, but you generally need to filter the output before you set it up for the next part of your processing chain.
Commas, in Max have a reserved function where it will execute the comments after each other (so [2, 68] will send [2] then [68])
thanks,
unfortunately I need to keep the comma.
I tried to make a compare before the sprintf using this:
[join] --> [zl.change] --> [unpack] --> [sprintf] but unfortunately the data is messed up, If i receive 1 and 33 and later 2 and 120 in the sprintf I get 1 120 and 2 33.
Is there another function to compare two numbers? change works only with one input so if I get 1 33 and 2 33 it will output only the first one and lose the second.
If you post the actual bit of the patch (using copy compressed) it will be easier to diagnose.
You don't need to unpack before sprintf, most objects that multiple inputs will take a list input if you sent it to the first inlet.
Like Rodrigo, I'm not entirely clear on what you are trying to do. However, if you need to keep the comma in the sprintf object, you need to put two backslashes in front of it because, as Rodrigo mentioned, the comma has a special meaning in Max. If the inputs will always be numbers, you can also use the %ld argument instead of the %s, I hope this is what you have in mind.
double \\! that's why it wasn't working... thanks guys!