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
Referencing objects with strings
-
- Liine Staff
- Posts: 285
- Joined: 01 Oct 2010 11:06
Re: Referencing objects with strings
Hi Rufus,
Lemur can't combine strings like that. What you could do to reference objects programmatically is to use the findobject() function.
See attached JZML.
Hope this helps,
NB
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);
Hope this helps,
NB
- Attachments
-
- foobar.jzml
- (6.37 KiB) Downloaded 57 times