Page 1 of 1

Referencing objects using OSC internally in Lemur

Posted: 15 Feb 2015 04:40
by newtfish
Hi,

I'm wondering whether it is possible through scripting to reference/set an object's values using OSC internally within Lemur? e.g. is there an oscin() function??

For instance I have an object called "Knob" with the OSC address:

/Knob/x

I know I can set "Knob" values by using:

Knob.x = 0.456

However, is there any way I can set it's values by it's OSC address?: e.g.

oscin(0,'/Knob/x') = 0.456;

I've tried setting the "OSC Host" address to the same as the iPad/Lemur, but that doesnt seem to work.

It seems the only way to change an object's value is by sending it from an external network.

Re: Referencing objects using OSC internally in Lemur

Posted: 15 Feb 2015 17:11
by ndivuyo
I'm not aware of any oscin() personally, maybe you could elaborate on what you are trying to do and there is another solution?
Also, it's not by it's osc address, but there is setexpression() too

Re: Referencing objects using OSC internally in Lemur

Posted: 15 Feb 2015 19:45
by newtfish
Hi Ndivuo,

Many thanks.

I would like to nest objects many levels deep, but reference them through OSC instead of having to remember where they are nested.

The objects are referenced depending on how they are nested e.g.

Knob1 is inside Container2, which is inside Container1

If I want to set Knob1 I can either use from a script (internally within Lemur):

Container1.Container2.Knob1.x = 0.435;

OR

I can set the Knob from OSC, but I can only do this from another computer on the network (only externally outside Lemur)

e.g.

/Container1/Container2/Knob1/x 0.435;


I would like to be able to set the knob, internally within Lemur, based upon its OSC address

For instance, I could still keep the Knob where it is (nested inside the two containers), but if it's OSC address was /MyEasyKnobAddress/x then I could simply do

oscin(0,'/MyEasyKnobAddress/x', 0.435);

To set it.

It's a shame Lemur cant do this because it would be very useful. We could allow sysex input of the OSC message for instance, decoding inside the template, and then controlling the various objects through OSC messages.

Cheers

Re: Referencing objects using OSC internally in Lemur

Posted: 16 Feb 2015 18:52
by ndivuyo
I see, so you want to be able to refer to the custom address that you can set in the OSC mapping settings of the object. hmm, maybe there is a solution. But yeah, I guess I would try and make all my references local within the containers so that problem wouldn't arise, but sometimes you just can't!
Let me think on it, maybe someone else will chime in

Re: Referencing objects using OSC internally in Lemur

Posted: 21 Feb 2015 04:26
by Macciza
Hi
This is easily achieved, you're just going about it backwards . . .
No OSCIn function is needed though you could write one if needed...
remember Lemur receives OSC locally on port 8000, anything sent there goes to Lemur....
So simply set say OSC 7 to localhost,your local name, 127.0.0.1 or your iPads Ip i.e. localhost, or macciza-ipad.local, or 127.0.0.1, or 192.168.0.10(use your address)
Then send OSC out on OSC 7 which will loopback to the iPad ....
Simple...
MM

Re: Referencing objects using OSC internally in Lemur

Posted: 02 Mar 2015 18:29
by newtfish
There seems to be no way to listen to incoming OSC, other than specifying an address to listen to. e.g. Wild Card.

I have incoming OSC from 127.0.0.1 . However if I want to obtain the OSC, the only way to do it, seems to be to specify an OSC address in an "On OSC" script.

It seems impossible to listen to all incoming OSC. Would be so nice if we could specify a variable like "OSC_VAL" in a "On OSC" script, which would listen on all incoming OSC.

Then we would simply get:

OSC_VAL = /Knob/x;
OSC_ARGS[0] = 0.54654

Seems not possible to do today

Cheers

N

Re: Referencing objects using OSC internally in Lemur

Posted: 03 Mar 2015 03:16
by Macciza
But objects pretty much just listen for there OSC address anyway ...
Just send it out OSC 7 -set as localhost- and it should be picked up . . .
^F-Localhost.jzml
(6.86 KiB) Downloaded 58 times
Is this what you are after?

Re: Referencing objects using OSC internally in Lemur

Posted: 03 Mar 2015 15:28
by newtfish
Hi Macizza,

I'm trying to capture all incoming OSC (rather than specifying an address to capture). I'm guessing this is not possible.

It's possible to listen on a specific address eg '/knob/x'

But it is not possible to listen to all incoming OSC,

Basically, I would like to capture the OSC coming in from the loopback address and then convert it into sysex for sending out through a midi channel. The only way it seems to do this is to forget OSC alltogether and just use sysex in each object. However this is a huge pain to set up for multiple objects.

I noticed your wildcard pattern matching post here. I'm guessing this is exactly what I need - https://forum.liine.net/viewtopic.php?f=28&t=1107 However, not implemented in Lemur :/

Cheers