New release 3.2.0

Happy days!! PsychoPy 3.2.0 is out!
https://github.com/psychopy/psychopy/releases

As with all major releases you should check carefully that your experiment still runs as expected. In particular for this release check the timings of your Builder experiment (they should be better than they were before but do check).

Faster audio with PTB backend

This is the first version to provide the Psychtoolbox audio backend. To test that out you need to change your settings. e.g.: ['PTB', 'pyo', 'sounddevice'] but this engine is considerably faster than all the other options, supporting sub-ms precision on most hardware, so if you care at all about audio latencies then you should give it a try. In future versions this will become the default audio option.

Better stimulus timing in Builder scripts

The other big change (and beware this will probably alter the timing of your existing studies) is that experiements setting the start/stop of components using Time (s) settings will have different timing. PsychoPy has a new function Window.getFutureFlip() allowing us to find out the time of the next screen refresh, which allows more accurate timing tests for your visual stimulus components. Rather than basing a decision (should we draw that stimulus?) on the current time the decision is now based on what the time will be when the flip occurs. This should mean that the previous advice to use Frames for timing of short stimuli will no longer be needed.

Many fixes

There were also a lot of bug fixes in this release and hopefully it will be a smoother experience for all!

And here’s a pretty picture of the new audio lib in a few repetitions of a sound under Win10 with standard built-in audio hardware. The yellow trace(s) represent a simple tone, the cyan trace is a labjack trigger. Note that the gridlines represent 1ms.

To get this precision you do need to pre-schedule the sound using snd.play(when)

1 Like

Amazing news, Jon! Thanks!

Existing experiments will use the Window.getFutureFlip() function when re compiled? Or just run? Or this will apply only to new built experiments. I am asking for experiments made on Builder, of course.

Thanks for the attention!

Existing scripts won’t change. You need to generate the script from Builder for this to occur, but that typically occurs on every run (or are you running your study from coder instead?)

This is great news, Jon! Thanks a lot.

On another note, I seem to be having some issues with the new version: it doesn’t run any of my experiments that were created with the previous version. As a matter of fact, it doesn’t even open the Demos. I keep getting an error. Any idea why this is happening?

Thank you.

I had a similar experience with psychopy 3.2 on Ubuntu 18.04, and I found it cannot deal with directories containing a space in their names. For example when I chose “unpack demos” in the builder app, psychopy created a directory named “psychopy3 demos” or similar and could not open the demo scripts afterwards because of the space in the name. You seem to have placed something in “c:\program files”, but because of the space psychopy only sees “c:\program”.
A related problem occured for me with scripts that had brackets in their names, which ran in the previous version of psychopy and were “not found” by the current version.
So it seems a workaround is not to use certain characters in file and directory names.

Strangely, I can’t replicate the effect on my machine (must have different settings in my terminal) but I know what that will be and I’m sure we can have a fix very quickly

1 Like

This issue is fixed in

Hi @jon,

thanks for this new updated version of PsychoPy! I have some questions regarding the following item:

Can you clarify whether this is also true for PsychoJS? I have been collecting data with PsychoJS (PsychoPy ver. 3.1.1) for the whole summer and I have noticed that stimulus timing for short routines (~34 ms) is very unstable (see this topic). This has forced us to collect data from more subjects than usual so to ensure a reasonable amount to data to analyze after trimming trials with the exceeding prime durations. It would be great if you guys had figured out how to make durations of short routines more stable in PsychoJS because it would allow us to save time and money.

Thanks!
-roberto

The timing structure hasn’t yet changed for the PsychoJS lib. We will look into whether this can be done but it isn’t the first priorit right now. The timing improvments are about making better decisions, given a specification in seconds, about whether we can fit in one more frame.

For brief presentations like that on any platform we would really recommend that you specify stimulus duration in nFrames and that IS available on PsychoJS, and it sounds from your other post as if you’re doing that.

I’ll respond in the other thread with some explanations about the data you’ve recorded on timing and about a) why timing is worse under a browser b) what parts of the fluctuation you’re seeing are “real” in terms of stimulus duration

1 Like

I just updated my version of psychopy to the newest one (I think) using

pip install psychopy

It gave me an error about not having the correct version of python despite having version 3.6 installed. So I went into /usr/bin and edited the psychopy file to point it directly at python3.6. Now when I try to launch the app, I get the message

File “/usr/bin/psychopy”, line 10, in
from psychopy.app._psychopyApp import PsychoPyApp, version
ModuleNotFoundError: No module named ‘psychopy’

What have I done wrong? Im on Lubuntu 18.04 32bit.

Most likely pip has installed PsychoPy to a different Python installation. Rather than doing simple
pip install....
you could do
python -m pip install psychopy
so that you can decide more clearly which pip/python is used in the installation