Loudness, string values and conditional handling

Questions and answers on how to get the most out of FFAStrans
Post Reply
rholm
Posts: 27
Joined: Wed Jun 01, 2016 10:23 am

Loudness, string values and conditional handling

Post 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
emcodem
Posts: 1752
Joined: Wed Sep 19, 2018 8:11 am

Re: Loudness, string values and conditional handling

Post 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 4957 times
emcodem, wrapping since 2009 you got the rhyme?
rholm
Posts: 27
Joined: Wed Jun 01, 2016 10:23 am

Re: Loudness, string values and conditional handling

Post by rholm »

This is great, thanks, will try this!!!
Post Reply