[Dev] 'get' revisited
Stephen Sinclair
sinclair at music.mcgill.ca
Fri Mar 30 14:48:40 BST 2007
Hi Jamie,
I do agree that it's not strictly necessary, except that I think maybe
it's more semantically explicit to use "get".
Personally (in some non-Integra work) I've been using /get with an
argument to specify a timer interval at which the value should be
auto-reported.
So, if I wanted the position of an object every 10 ms, I would send a
message like this:
/object/theobj/position/get 10
And to stop the stream,
/object/theobj/position/get 0
But if I want the object's position just once, I'd send:
/object/theobj/position/get (no argument)
So that's the only use I can see where /get is really necessary. Of
course, there may just as well have been other ways to think about
this.. for example, I could have appended /get to the beginning of the
message instead, so that I could route them early on to some "getter"
object responsible for handling my timer interval:
/get/object/theobj/position
One thing to consider is how this might interact with the OSC-route
object in Max. Of course we shouldn't cater too much to specific
implementations, but OSC-route doesn't make it so easy to differentiate
between messages with different numbers of arguments. The output of
OSC-route would have to go into a "zl len" object to figure out the
number of arguments, which would perhaps control a select object, etc..
No nearly as clean as simply adding an argument to OSC-route.
Also, what would happen for messages with no arguments? These do
exist.. events and such. For example, a granular synth I made takes a
message that causes it to release the sustain on its volume envelope.
Granted, there aren't all that many examples, but it's certainly a
possible case to consider.
Just some thoughts. By the way, did you attach your example? I don't
see it attached to the email.
Cheers,
Steve
Jamie Bullock wrote:
> Hi,
>
> I think this is probably a rather minor issue, but I thought I would
> raise it anyhow because it's bugging me!
>
> Why do we need any kind of 'get' syntax appended to an OSC address to
> get the value that is assigned to a variable? This syntax (or absence of
> syntax) seems much cleaner to me:
>
> /x 20 (sends the integer 20 to the address /x)
> /x (returns the value previously sent to the address /x, in Integra
> terms '/x: 20')
>
> I have attached an example using the canonical integra.linfunc module to
> illustrate this. It uses a simple helper abstraction [getsetf] to do the
> work.
>
> BTW: [integra.linfunc2] also fixes the typos in the .get implementation,
> and replaces the expensive call to sprintf.
>
> Jamie
>
>
>
>
> _______________________________________________
> Dev mailing list
> Dev at integralive.org
> http://integralive.org/mailman/listinfo/dev_integralive.org
>
More information about the Dev
mailing list