I’m working in a university research lab on a kinematic adaptaion experiment that requires very minimal lag between pen motion on a graphics tablet and visual feedback on the monitor for accurate data results. Currently I am writing the experiment in Python (through the coder window of Psychopy), but I know Python can be a pretty slow language, and others that have tried to create similar experiments have run into issues with this lag (>100ms).
The advice I was given was that these labs use WinTabMex (which to my understanding is a a Matlab-executable written in C that works with grapgics tablets) and that this was able to significantly decrease this lag, however this would mean I would have to completely rewrite my experiment in a different language.
In my research, I came across ctypes as a foreign function library for Python that provides C-compatible data types and allows calling functions in DLLs or shared libraries. I am pretty new to all of this, so I was wondering if using ctypes would be a good way to reduce the issue of the lag, while still sticking to Python? If not, is there any other advice on other approaches? I would prefer to stick to Python if possible
Dusty Fox is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.