What's new

Lemur - looping through objects

quickbrownf0x

I had fun once. It was awful.
Hey guys,

Does anyone know how to loop trough a list/tree of objects in Lemur script?
Pretty basic stuff normally, but Lemur is giving me grief. Here's a simple single-level loop (I want to expand it later so it can handle any level);

decl parent_object = findobject('INSTRUMENT_BANK');
decl s, i, child_object, child_expression;

for (i = 0; i < sizeof(parent_object); i++)
{
child_object = findobject(parent_object);
child_expression = getexpression(child_object, 'title');

s += 'current_child_object: ' + child_expression + '<br>';
}

Monitor.value = s;

The Monitor container gives me the value '0' when I run this script.
Here's my fancy object tree:





    • INSTRUMENTS_BANK
      • INSTRUMENTS
        • CUSTOM
        • SYNTHS
          • ART - CS80V3 - BladeRunner
        • PERCUSSION
        • GUITARS
        • BASSES
        • yada, yada...
      • SCORING
        • WOODWINDS
          • HIGH
            • OT - BWW - Solo Flute
          • LOW
          • ENSEMBLE
        • BRASS
          • yada, yada...
Now, to be fair I don't know if this is the best way to store my folder and track data (and to retrieve it for global use), so feel free to give an alternative way.

So I figured if I have this data, I can say, grab all folders and instruments for a specific group, grab their custom properties - all that stuff, using a cool global function. Like a giant JSON file, really, right?

Of course, ideally - this data should just come straight out of Cubase, for instance, on track selection, but you know - Lemur won't let me generate objects on the fly and I don't have a Mac to run, say, OSCulator on.

By the way, am I right to think that Lemur for some silly reason doesn't really support multidimensional arrays OR string values for array keys? So numerical key values only? Because whenever I start using strings those Lemur Editor just goes 'dude, ugh, what are you... - NO!' and crashes.

Am I making any sense here? Anyway, thoughts anybody? Tx!
 
Top Bottom