Fix TR determination
When finding which part of the sequence to play out, occasionally the start time and end time were considered to be in different TRs (due to rounding errors), which led to weird results. This fixed it by determining the TR index once for both the start and end time.