psychopy.org | Reference | Downloads | Github

'Moving' an envelope stimulus

Hi.

I’m new to PsychoPy and am currently building an experiment which uses the envelope grating stimulus. However, when I use the ‘Phase’ input box to add movement to the stimulus, whatever value I use, the stimulus does not move. This is for both the carrier phase and the envelope phase.

I have tried adding a ‘+’ to the value (e.g. ‘‘0.5,’+’" in the Phase input box) but this also does not work.

It seems like I would have to use ‘setPhase’ and add a loop to iteratate over each frame using a custom bit of code but I’m not sure where I would put this code (Begin experiment/begin routine/ begin frame etc.), or even how I go about writing it.

What I believe may make the matter more complex is that I would need the stimulus to move for the entire duration that it is displayed. The duration of the stimulus in each trial is also variable (the purpose of the experiment) and the duration values are currently taken from a conditions file.

Hope the question makes sense and thanks for any help.

I’ve not tried this stimulus type but when you tried 0.5,’+’ I’m left wondering plus what.

You could try 0.5+t which is the number of seconds since the start of the routine. It’s possible that this needs to be added as $(0.5+t)

Thanks for the reply!

I should have said the stimulus is one of the grating style stimuli. The ‘+’, looking at the tutorial for generating stimuli customly, advances the grating by the value before it. So inthe case of my question, the grating would advance by 0.5 each iteration.

I tried your solution but I it flags an error in the builder creation menu stating: “Looks like your variable ‘(0.5+t)’ in ‘phase’ should be set to update.”
When I alter this so the error is removed using something like (0.5,’+t’) my experiment crashes with the error being it cannot convert the string to a float value.

Is there normally a way to create, in builder alone if possible, a way to generate movement in the grating style stimuli? This issue I am having occurs whether I use the standard grating or the envelope grating. Whatever I set the phase value to, it is as though the stimuli do not update and so stay static rather than dynamic.

Again, thanks for any help.

Which is the phase input box?

I just tried the grating stimulus (for the first time) using defaults apart from having a duration of 10 seconds and t/10 in the envelope phase (set to Set Every Frame). It displayed a grating that gradually moved to the right.

That looks to be it!

Thanks very much for your help.