--- On Sun, 1/17/10, Rich E rich.eakin@gmail.com wrote:
From: Rich E rich.eakin@gmail.com Subject: Re: [PD] 'synced' number and slider To: "Jonathan Wilkes" jancsika@yahoo.com Cc: "Lorenzo" lsutton@libero.it, "IOhannes zmölnig" zmoelnig@iem.at, pd-list@iem.at Date: Sunday, January 17, 2010, 7:31 PM Ah that is nice, you just don't need the set messages. :) I always looked at the iem gui objects as more sophisticated and better for GUI front ends, not meant for writing a self-documenting patch. They save time and look/act better, but everyone I have met using pd for educational purposes uses the more simple numberbox.
I don't think writing a self-documenting patch and the use of iem gui objects are mutually exclusive; after all, I use iem guis in the example patch you are referring to.
It's just that for the particular behavior of linking two iem guis, I wouldn't rely on whatever it is that happens when you make all the send/receive names the same. Instead, I would use something like the "explicitly patched" version and shove it all in a gop. Then if you decide after many months that you want to send a value to one of the iem guis, for example, and have all the linked iem guis update their values, it will work (and you can easily check for bugs by opening the gop window). If you try the same thing with the send/receive name trick, it will fail, and if you're like me and have a hard time reading the source code, then there's (currently) no quick way to figure out why it doesn't work because it's not documented in the help patches for the iem guis.
-Jonathan
rich
On Sun, Jan 17, 2010 at 12:23 AM, Jonathan Wilkes jancsika@yahoo.com wrote:
I attached a modified version of your patch to show what I mean. On the
right, you can look at the patch and figure out the behavior before you
scroll the gatom box (important if you want to make sure you're avoiding
a buffer overflow).
On the left, you have to read the source code for those GUI objects to
figure out what's going to happen. Judging from your original patch,
I think you assumed that sending a float straight to the [nbx] would
update the value in the slider (so did I). This turns out not to be the
case: the two GUIs are only bound together if you change the values on one
of them using the mouse.
If someone who reads and understands c better than me can explain why
the iemgui magic works as it does, I'll be happy to document it.
-Jonathan
--- On Sat, 1/16/10, Rich E rich.eakin@gmail.com wrote:
From: Rich E rich.eakin@gmail.com
Subject: Re: [PD] 'synced'
number and slider
To: "Jonathan Wilkes" jancsika@yahoo.com
Cc: "Lorenzo" lsutton@libero.it,
"IOhannes zmölnig" zmoelnig@iem.at, pd-list@iem.at
Date: Saturday, January 16, 2010, 8:38 PM
You can still send the
set message directly
to the inlet of the numberbox2 or slider and it
won't
effect the other. See patch.
2010/1/16 Jonathan Wilkes jancsika@yahoo.com
--- On Sat, 1/16/10, IOhannes zmölnig zmoelnig@iem.at
wrote:
From: IOhannes zmölnig zmoelnig@iem.at
Subject: Re: [PD] 'synced'
number and slider
To: "Lorenzo" lsutton@libero.it
Cc: pd-list@iem.at
Date: Saturday, January 16, 2010, 11:36 AM
Lorenzo wrote:
This seems trivial but I've never
managed to
figure
out how to do it in
a non-trivial way:
Have a number (atom) and a slider (be it
horizontal or
vertical) which
are 'synced', that is if one changes
the
number the
slider changes and
vice-versa.
if you use numberbox2 as the numberbox, you can
give
both
the nbx and
the slider the same send/receive names
(that is:
numberbox2.sendname=numberbox2.receivename=slider.sendname=slider.receivename)
and they will be magically linked to each other.
to use the value in the patch add another
receiver
[r <samereceivename>]
Except if you need to send a value to the inlet
of the numbox2 or the slider. Then this method
magically
doesn't work, whereas the [set $1(
idiom does.
gfmadr
IOhannes
-----Inline Attachment Follows-----
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