Adjusting sampling rate of continuously rated data

PsychoPy version (e.g. 1.84.x):

I have made an experiment in PsychoPy builder to continuously collect urge to move data when listening to a track. Is it possible to adjust the sampling rate/how many times per second data is collected (Ex. making it 4 Hz/per second)?

Hi @Ksab22, it’s not as straightforward as just lowering the sampling frequency. But you can start a timer in the beginning of the routine, continuously check whether it has passed .25 seconds and if so, take a sample and reset the timer. This would work like this:

Begin routine

rating = []
timestamp = []

timer = core.Clock()

Each frame

if timer.getTime() >= .25:
    rating.append(slider.getMarkerPos())
    timestamp.append(t)
    timer.reset()