[visionegg] Re: RT accuracy

I once wrote a custom presentation loop that drew once every 10 or so iterations, but polled at each iteration. It worked pretty well. I also used some utility that boosted my USB polling rate to like 500hz or something totally unnecessary.


I've got it pasted below.
it worked for me last time I opened this file last october.
hope it helps
-a

#!/usr/bin/env python
import VisionEgg
VisionEgg.start_default_logging(); VisionEgg.watch_exceptions()
import VisionEgg
from VisionEgg.Core import *
import pygame
from pygame.locals import *

screen = get_default_screen()
screen.set( bgcolor = (0.0,0.0,0.0) ) # black (RGB)


frame_timer = FrameTimer() # start frame counter/timer
count = 0
quit_now = 0
tt = 0



#the alternative loop
while not quit_now:

    for event in pygame.event.get():
        if event.type in (QUIT,KEYDOWN,MOUSEBUTTONDOWN):
            quit_now = 1
    screen.clear()
    tt =tt + 1
    thePosition = (pygame.mouse.get_pos())
    #print thePosition





if tt % 4 ==0: #gives us empty frames to evaluate mouse position without waiting for the monitor
        #this is the only time when the screen actually gets updated
                
                        swap_buffers() # display what we've drawn
                        frame_timer.tick() # register frame draw with timer
frame_timer.log_histogram()



On Sep 24, 2007, at 8:12 PM, Andrew Straw wrote:

Hi John,

It seems to me that you want to poll your response as often as possible
but draw frames only once per vertical refresh. Do I get that right?

In this case, one option is to write to a multi-threaded (or
multi-process) application where these two tasks are de-coupled.

John Christie wrote:
    As some of you may have deduced from recent messages, I'm just
learning VisionEgg.
    I've got my stimuli coming up and the timing looks good but I've
got one issue. I can't seem to be able to assess the current state of
my buttons to find out RT more than once per presentation frame.  How
can I have frame by frame presentation accuracy and RTs that are
better than that (on average)?

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

The information contained in this message may be privileged and confidential. If you are NOT the intended recipient, please notify the sender immediately with a copy to hipaa.security@xxxxxxxx and destroy this message.

Please be aware that email communication can be intercepted in transmission or misdirected. Your use of email to communicate protected health information to us indicates that you acknowledge and accept the possible risks associated with such communication. Please consider communicating any sensitive information by telephone, fax or mail. If you do not wish to have your information sent by email, please contact the sender immediately.



Other related posts: