$lt doesn't appear to work

I have the following (simplistic) script:

$set(TEMPO,Prestissimo)
$set(TEMPO,$if($lt(%bpm%,200),Presto))
$set(TEMPO,$if($lt(%bpm%,180),Vivace))
$set(TEMPO,$if($lt(%bpm%,171),Allegro Vivace))
$set(TEMPO,$if($lt(%bpm%,161),Molto Allegro))
$set(TEMPO,$if($lt(%bpm%,140),Allegro con Brio))
$set(TEMPO,$if($lt(%bpm%,130),Allegro))
$set(TEMPO,$if($lt(%bpm%,120),Allegretto))
$set(TEMPO,$if($lt(%bpm%,117),Allegretto Moderato))
$set(TEMPO,$if($lt(%bpm%,116),Moderato))
$set(TEMPO,$if($lt(%bpm%,101),Andante Moderato))
$set(TEMPO,$if($lt(%bpm%,91),Andante))
$set(TEMPO,$if($lt(%bpm%,84),Andantino))
$set(TEMPO,$if($lt(%bpm%,77),Adagio))
$set(TEMPO,$if($lt(%bpm%,61),Larghetto))
$set(TEMPO,$if($lt(%bpm%,51),Largo))
$set(TEMPO,$if($lt(%bpm%,40),Grave))

I’nm trying to set a ‘Tempo’ value for each track. The problem is that the ‘TEMPO’ variable is not being set at all!

What I am trying to do is check the bpm value and set the ‘TEMPO’ accordingly

Any ideas or suggestions would be very much appreciated

The problem is that in each of your $if() cases, you don’t have an “else” condition, so it is setting the value to empty which removes the tag. Instead try changing your lines to something like:

$if($lt(%bpm%,200),$set(TEMPO,Presto))
7 Likes

That did it, many thanks for the quick assist, have a good evening

3 Likes