Page 1 of 1

Loudness, string values and conditional handling

Posted: Mon May 06, 2019 7:49 am
by rholm
Hi,

I am trying to do some conditional processing based on Loudness data but am running into problems most likely based on variable types.

stage one = Loudness analyzer - saves into styring variables
stage two = Conditional, based on the loudness data I would like to move files to different folders

I think the problem is that loudness analyzer is writing to string variables, and the conditional is looking for integers to compare values (above below certain values). Can this be solved in some way?

Regards
Robert

Re: Loudness, string values and conditional handling

Posted: Mon May 06, 2019 9:00 am
by emcodem
Hi Robert,

congrats, you were already on a good way assuming Problems with the string!
The string variable for a loudness value Looks like this after it was filled by the loudness analyzer processor:

Code: Select all

[-70.0,-70.0]
To use the conditial node e.g. for a ">" comparison to a value on the right side like "-21" (without the quotes), you can use functions like that:

Code: Select all

$readarray($jsonencode("%s_loudness_levels%"),1)
Note that the "1" on the Right side means that we compare to the first number in the Array of numbers.
compareloudness.png
compareloudness.png (15.09 KiB) Viewed 4958 times

Re: Loudness, string values and conditional handling

Posted: Mon May 06, 2019 9:44 am
by rholm
This is great, thanks, will try this!!!