Changing Contrast in an Element Array stimulus

Hello everyone,

I am trying to change the contrast in an ElementArray function.
I tried many commands to change it such as “contrasts” or “contrs” in the function parameters and also “stim.set contrasts” or “stim.setContrs” on a line apart.

I just think I don’t know the exact code to do this, do you have any idea ?

It’s a multigabor stimulus, here’s my code :


        gabor = psychopy.visual.ElementArrayStim(
            win=win,
            units="pix",
            nElements=n,
         
            elementTex="sin",
            elementMask="gauss",
            sfs= 2,
            phases = phaser,
            oris = ori,
            xys=xy_arr,
            sizes=50,
            contrs = 0.004,
            depths=1
        )

Thank you !

This was an issue recently solved:

The fix is pulled into the release branch on GitHub, but it was very recent so may not have made it into version 2021.2.3. If not, it’ll definitely be in 2021.2.4!

In the meantime, you can use:

gabor._colors.contrast = 0.004

which should achieve the same thing.

Thank you so much for your response, this instruction works perfectly