Here's my point of view:
Theres a million and one ways.
If an array is changed by some pd-internal probably you can track that
down in the "changer patch", thus you can control and know it.
Array comparison (as Jack noticed) is always possible, although slower.
You can hack into the object that you use for arraywriting (tabwrite?)
and make a simple outlet that outputs some information about the last write (such as timestamp or other trick), then by simple comparison of the last know (stored by your patch) timestamp with the value from that outlet you can always know if the array was changed. But honeslty after writing this, it doesn't seem that elegant to me :)
Best of luck, Pedri
On Mon, Dec 27, 2010 at 5:02 PM, Jack jack@rybn.org wrote:
Just output the value store in the array at the desire index (with [tabread]) before to write the new value (at the same index) and compare this new value with the old with [==]. If the result is false (0) then the array change. You get also the index that changed. Or i miss something ? ++
Jack
Le lundi 27 décembre 2010 à 11:44 -0500, Ivica Ico Bukvic a écrit :
Is there anything in the API that offers ability to detect when an array has been changed and then act upon it? This would be quite useful when using array as a multislider to change values. If there isn't I am proposing providing an invisible send from array whenever it is changed with the name <array_name>_changed. It could also send exactly which element has changed.
Likewise, for the same reason, I would like to provide clipping of the drawn items to the visible area but before I do so, is there a reason one would want to keep outside elements visible as well despite their distracting appearance?
Ico
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list