Difference between 'get' and 'observe'

Learn about building and using Max for Live devices.
Post Reply
intellijel
Posts: 103
Joined: Wed Aug 10, 2005 10:13 pm

Difference between 'get' and 'observe'

Post by intellijel » Sat Jan 09, 2010 6:41 pm

Just trying to figure out what the difference between "get" and "observe" is in the LOM?

I know that the former is for live.object and the latter for live.observer but don't they both return the same info?

monohusche
Posts: 190
Joined: Thu Jan 22, 2009 4:28 pm
Location: Hongkong

Re: Difference between 'get' and 'observe'

Post by monohusche » Sat Jan 09, 2010 6:55 pm

get means you request the current value just once. just like a normal function call.

observe means that internally, an "observer" is installed which delivers the new value whenever it changes ("call back"). that's called notification within M4L. The only issue with observer calls is that you can't do any changes to the Live set based on a notification (unless you get a little bit creative).

technog0d
Posts: 265
Joined: Mon May 26, 2008 1:14 pm
Location: Philly
Contact:

Re: Difference between 'get' and 'observe'

Post by technog0d » Sat Jan 09, 2010 9:42 pm

I usually send the observer to the left inlet of a message box and then bang down the message, That seems to work pretty good.

Mike
Websites:
Max For Live Community site:
http://www.max4live.info
http://www.noisemakers.info

Controllers: Lemur, Ohm 64, Monome, APC40, Launchpad
Daw: Live 8 Suite
Audio Interfaces: Apogee Ensemble & Duet
Monitors: JBL LSR 4300

monohusche
Posts: 190
Joined: Thu Jan 22, 2009 4:28 pm
Location: Hongkong

Re: Difference between 'get' and 'observe'

Post by monohusche » Sat Jan 09, 2010 10:05 pm

haven't tried that yet, but I thought that if the bang originated from the observer as well (such as "trigger b float"), that would be prohibited by the Live API in order to avoid endless loops.

Post Reply