[PD] how to detect if array has changed

Pedro Lopes pedro.lopes at ist.utl.pt
Mon Dec 27 18:16:32 CET 2010


Here's my point of view:

1) Theres a million and one ways.

2) 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.

3) Array comparison (as Jack noticed) is always possible, although slower.

4) 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 at 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 at iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>



-- 
Pedro Lopes (MSc)
contact: pedro.lopes at ist.utl.pt
website: http://web.ist.utl.pt/Pedro.Lopes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20101227/3ddbc841/attachment.htm>


More information about the Pd-list mailing list