-
Bug
-
Resolution: Fixed
-
Normal
-
None
-
2.6.3
-
None
-
win 10
Have been trying to use the acoustic brainz high level data to calc some variables and for some reason many functions doesn't work as expected once a 2 digit number is retrieved from them
I'm using the latest plugin version 2.2 which fixed scripting, so I think this is another bug. (see https://tickets.metabrainz.org/browse/PICARD-2256)
For ex: (where %ab:hi:mood_happy:happy% is something like 0.044545..) (see image 1)
$noop(Valence tags: Valence -number-) $set(_tempA,%ab:hi:mood_happy:happy%) $set(_tempB,$get(ab:hi:mood_sad:not sad)) $if($eq($substr(%_tempA%,2,3),0),$set(_tempA,$substr(%_tempA%,3,4)),$set(_tempA,$substr(%_tempA%,2,4))) $if($eq($substr(%_tempB%,2,3),0),$set(_tempB,$substr(%_tempB%,3,4)),$set(_tempB,$substr(%_tempB%,2,4))) $set(valenceA,%_tempA%) $set(valenceB,%_tempB%) $set(valenceC,%valenceA% - %valenceB%) $set(valenceD,$add(%valenceA%,%valenceB%))
ValenceD returns nothing, instead of summing the values. Note the other values are right and present (see image 2).
Using num returns nothing too.. (see image 3) although clearly valenceA is an existing number.
$set(valenceE,$num(%valenceA%,0))
Note I had to use first $substr() to check if TempA or TempB had a 0 because using $trim(,0) or regexp didn't work once I extracted the 2 digits (like many other text functions). In other words:
$trim(04,0) -> 4 $trim(%tempA%,0) -> where %tempA% is 04 -> 04
It's like the 2 digits extracted string is not recognized neither as a string nor as an integer number... thus rendering incorrect input for all text/number functions when using the variable.
- duplicates
-
PICARD-1713 Allow functions operating on numbers (mul, div, ....) to be used with floating point numbers
- Open
- is related to
-
PICARD-2200 Copy and pasting function names from inline scripting docs can copy Unicode left-to-right mark
- Closed
-
PICARD-2258 Ignore non visible characters passed value for mathematical functions
- Open