Page 1 of 1

Functions in Populate Variable Node

Posted: Sun Jun 11, 2023 6:22 pm
by novalis
Hi there,
I'm stuck here a little with the following problem:
The loudness analyzer gives me an array of numbers to work with and to be able to do some further logic (compare them to target values etc) and log them out, I want to set the first item of each array as a new variable via the populate variable node.
This does not work however: If I set it to a string user var, I get the command once I log the vars out but not its output, like so:

Code: Select all

$readarray($jsonencode([-5.086133,-5.086133]),1)
If I use a float or int user var, I just get 0.
What am I missing here?
Thanks and best,
Lukas

Re: Functions in Populate Variable Node

Posted: Mon Jun 12, 2023 7:24 am
by momocampo
Hi Lukas,
I think you forgot quotes for values, you should try like this :

Code: Select all

$readarray("[-5.086133,-5.086133]", 1)
And the "1" behind values isn't necessary for you cause it's the default behaviour.So without, it will return the first value.


Cheers.

Re: Functions in Populate Variable Node

Posted: Mon Jun 12, 2023 9:53 pm
by novalis
Hi Momocampo,
thanks a lot! That fixed it