only thing I can imagine is;
typecasting of (int) whent wrong (in which case you can try converting it using: integer(varName); ).
or, noteTime[i] is not an integer, and thus you're trying to equal a integer value vs a floating value.
Keep in mind a frame only contains 16 updates, so timing it with total_secs might be a bit off at times...
regards,