Solved casting error

Must round before casting to real (without decimals)->
set the_bpm to (round the_bpm_raw rounding down) as real