Referencing objects with strings

Discuss Lemur and share techniques.
Post Reply
RufusWhite
Newbie
Posts: 2
Joined: 17 Sep 2012 19:08

Referencing objects with strings

Post by RufusWhite »

Is there a way when scripting in Lemur to reference an object with a string?

For example if I have a grid of buttons:

container.button1
container.button2
container.button3

how can I reference them programmatically based on an input from another control/midi cc, eg:

container.button(MIDI_ARGS[0])

There doesn't seem to be any mention of this in the manual, and I've tried everything I can think of!

Many thanks!
Rufus
nick_liine
Liine Staff
Posts: 285
Joined: 01 Oct 2010 11:06

Re: Referencing objects with strings

Post by nick_liine »

Hi Rufus,

Lemur can't combine strings like that. What you could do to reference objects programmatically is to use the findobject() function.

Code: Select all

decl foo={'Knob1','Knob2','Knob3'};
decl bar=findobject(foo[2]);
setexpression(bar,'x',0.1);
See attached JZML.

Hope this helps,
NB
Attachments
foobar.jzml
(6.37 KiB) Downloaded 57 times
Post Reply