Program or hardware lag?

PaulS:

    prev_t += tMil ;  // advance prev_t for next time.

No. You shouldn't be adding times.

Try reading the OP's code - tMil is the delay in milliseconds per beat - its an
interval, not an absolute time:

long tMil; //space in millis between beat triggers

So I definitely should be adding the interval to prev_t to set up the next time.