That is, I should just be able to use keyboard. I’m not much of a coder, but from what I understand, since iohub has been integrated with Psychopy by default, this should be quite simple. Change the experiment so that the block is shown until a key is pressed. I will appreciate any idea why that is happening and any advice of what I should do to get the time of the keypresses in milliseconds. Hi all, I’m currently designing a task where I need psychopy to register when a key is released, rather than when it is pressed. Use the shuffle function from the Python random module for this. Introductions Getting Started with PsychoPy (Part 1) PsychoPy Overview, Stimuli, Input PsychoPy Help 1 Jason Ozubko 977 subscribers Subscribe 511 24K views 1 year ago PsychoPy Help. keys event.getKeys (keyList 'left','right') if 'left' in keys: rotline.ori + 2.0 elif 'right' in keys: rotline.ori - 2. But even with the position as in the example code I get the list with float type numbers, which are not somehow related to the “()” I set before. However, if I change its position it stops saving data. Keys = (keyList=, timeStamped=Clock)Įxit_keys = (timeStamped = False, keyList = )Īccording to the algorythm it would be correct to place the block Clock = () Stream = p.open(format = p.get_format_from_width(sound_stim.getsampwidth()), Print('Channels: '+ str(sound_stim.getnchannels())) Print('Sample Rate: ' + str(sample_rate) + 's/sec')ĭuration = round(num_samples / sample_rate, 4) Print('Num Samples: ' + str(num_samples)) KEYDOWN): pygame has no keytimeskeys.append(((evts.key),0))elifhavePyglet: for each (pyglet) window, dispatch its events before checking event bufferwindowSystempygletforwinindefaultdisplay.getwindows():try:win. key is, you can use a method like that shown above to find out. Sound_stim = wave.open('stim_audio.wav', 'rb') The key functions in psychopy return a list of strings, where each item in the list is. Output_file = open(results_file, mode = 'w') I try “” function, specifyng the “timeStamped” parameter. The problem is that I can not get the time of the keypresses. Participants are supposed to listen to the audio stimuli and respond with pressing “Space” button while listening. The general idea is to gather responses from the keypresses. Hello there! I am using Python and PsychoPy to write a code for my button-click test.
0 Comments
Leave a Reply. |