Using Python to send sequence of pulses from StimTracker

I am trying to use stimtracker to send a sequence of pulses on two lines. They need to be sent with a precise offset. 1ms precision. The pulse on the second line has to be exactly x ms after the pulse on the first line. And this needs to be repeated y number of times. I attached an example pulse that would need to be repeated.
I tried to use for loop in python and time.sleep function:
for i in range(200):
start =
# send pulse to comp2 first
# wait the delay
stop1 =
itime1 = (stop1-start).total_seconds() * 1000 # time in millisec
print("first waited "+str(itime1)+“ms”)
# send pulse to comp1
print(“Trigger to:”,computer1_line_no)
# wait
stop2 =
itime2 = (stop2-stop1).total_seconds() * 1000 # time in millisec
print("then waited "+str(itime2)+“ms”)

Unfortunately, sleep times are reliant on the system time, and there are +/- 20ms differences.
Would it be possible to create a certain series of pulses and load that to the stimtracker, so that the offset and timing would rely on stimtracker’s timer instead of OS time on the PC?
Maybe I could use some lower level commands with _send_command(self, command, expected_bytes) function from pyxid2?

Thank you in advance

Our C++ library has built-in support for the pulse table / pulse sequences feature, but the Python library doesn’t yet.

Can you wait a few days? we can add support for pulse sequences by early next week (or maybe sooner).

Thank you. That would be fantastic! Please let me now, when that support is ready, so I can try it.