
Writing trial by trial info into a text file Tick = sound.Sound(800,secs=0.01,sampleRate=44100, bits=8)#sample rate ignored because already setĪlways save your images as. Sound_1 = sound.SoundPygame(value = u'/home/custine/Desktop/Experiments/tones/tone_400Hz.wav') You can set a Frequency of a sound/tone you want to play or provide a link to the sound you want to play. If possible build your basic Experiment using the Psychopy Builder, compile it as a script and then work from there. Import the sound package from psychopy before beginning. RECOMMENDATION: It is recommended to always build your experiment in the Builder and then "compile", so you have a foundation to work on or tweak in the coder interface.

#Psychopy tutorial code
However YOU CANNOT GO BACK to the Builder view from a code view. :( That is the only drawback! I think! NOTE: When you are satisfied with the experiment you have built in the Builder you can view its script or code in the coder and make changes there and fine tune your experiment. Coder view is far more powerful since you can use various python modules (such as NumPy, a mathematical module comparable to Matlab) to customize your code and go beyond the limitations of the Builder. This is for the user who loves to write hiss/her own scripts. psyexp file) and use Coder to view and edit it (.py file). You can compile the code from Builder (a. Builder makes it easy to visualize the structure of your experiment, create trial loops, integrate code components, add keyboard responses, present visual stimuli, etc. It is completely GUI driven and very user friendly. In Psychopy you can either use the Builder or the Coder Interface to write your stim presentation scripts.Īs their name suggests the Builder Interface is for the user who does not like to write scripts from scratch. It does not have a reliance on Matlab as PTB does, and it has the flexibility to control stimulus presentation by frames based on the screen refresh rate, reducing variability in timing making it much better suited to experiments that rely on timing accuracy (e.g.
#Psychopy tutorial software
PsychoPy is an open-source, python-based stimulus presentation software package that can be used as an alternative to PsychToolBox (PTB).

3.3 Writing trial by trial info into a text file.
