Dear Michael
Thanks for your reply. My visual stimuli consist of sinusoidal gratings; I have two types of gratings which differ only by their orientation. The way I run simultaneously these two types of stimuli on two different monitors is:
- I inserted a custom code under the tab “Begin Experiment” to set up the second window and link the second window to the additional (second) monitor. So, this code goes on like this:
# Set up the window
win1 = visual.Window(
size=[800, 600], screen=1,
monitor='3', color=[0,0,0], colorSpace='rgb',
blendMode='avg', units='height')
In this case my first window is:
# Set up the window
win = visual.Window(
size=[800, 600], fullscr=False, screen=0,
winType='pyglet', allowGUI=True, allowStencil=False,
monitor='testMonitor', color=[0,0,0], colorSpace='rgb',
blendMode='avg', useFBO=True, units='height')
- Then under the tab “Begin Routine” I insert few commands like below:
# Initialize components for Routine "novel" (here “novel “is the gratings with 135 deg orientation)
novelClock = core.Clock()
novel_grating = visual.GratingStim(
win=win1, name='novel_grating',
tex='sin', mask=None,
ori=135, pos=(0, 0), size=2, sf=5, phase=2,
color=[-1,-1,-1], colorSpace='rgb', opacity=1,blendmode='avg',
texRes=256, interpolate=True, depth=0.0)
In this way I set up a Builder experiment for familiar (i.e. gratings with 45 deg orientation) and send these gratings to screen “0” that is linked to first monitor and with an addition of few commands I can generate novel (i.e gratings with 135 deg orientation) and send these gratings to screen “1” that is linked to the second monitor. I have a PC with four mini display ports which I can connect to four monitors using a mini disiplay to display cables.
So, I believe I can define the second window (using a code component), that is set to appear on my second monitor - I am happy to attach the whole experiment as I have been repeatedly running the experiment. But my main issue is to randomly drift these two types gratings to two different monitors. Each gratings are repeated 100 times and these 100 repetitions make one block; at the end of each block there is a static grey screen and then second block comes in. I have in total five familiar and five novel blocks of gratings and I want to randomly send these 10 blocks to two different monitors.
I am not sure if the lines below would work for drifting the stimuli to two screens (monitors):
** Create a randomized vector from 1 to 10, (like “randperm” function in MATLAB) which will create a random sequence of values between 1 and 20 (Vector a)
** Create a second vector which consists of 10X “0” and 10X “1” (Vector b)
** Then randomize the binary elements of vector “b” by using the previously randomized floating points of vector a. So I will create a vector “c” which will have elements of vector b in the random order of vector a; c=b(a). Here the binary elements of vector a represent the familiar and novel gratings.
** Then I will create a “for” loop; these would be the lines in MATLAB
i=1:length(c)
if c(i)= 0
screen(drifting, screenA)
screen(gray,screenB)
else if c(i)=1
screen(drifting, screenB)
screen(gray, screenA)
end
I am not sure if this will help as I am currently in the process of finding out Python version of these MATLAB lines as I am not very familiar with the Python language (I am learning though!).
I would be very happy to hear your advice on my thoughts. Thanks again for your help.
Cigdem