MOLE Modifiable Language Experiments

Author Archives: Sarah Creel

I'm an Associate Professor of Cognitive Science at UC San Diego.

PsychoPy and Typing

I had some trouble getting Matlab PTB3 to allow users to fluently type sentences for transcription. I found a function to do it in PsychoPy (, and I modified it to allow capital letters and a few symbols. Download this here: PsychoPyTyping

Run this by clicking the green running-man figure in the PsychoPy toolbar. It will prompt you to fill in subject information and to transcribe three words. (Make sure to leave the list name “shortlist” intact!)

Try typing some full sentences.

This is the function that actually takes in keystrokes and displays them on the screen. It supports a single backspace at a time, but doesn’t do

This collection of functions allows you to prompt participants to provide potentially relevant information. However, there’s currently nothing to stop them from just hitting Enter or clicking OK without filling anything out.

fancywavread Instructions


This function adds on to the built-in MATLAB function wavread by converting the input sound file to the correct format  (2 channel, stereo sound) instead of crashing the program.


This function will read in the sound file specified and will transform the direction of the vector if it is in a format that PsychPortAudio is unfamiliar with.  This function also allows for the optional argument ‘side’ to be specified, which will play the sound to one specified ear (one side of the headphones).

If the optional argument is specified, the function is able to format a stereo sound to act as a mono sound by overwriting one sound channel with no sound.

The function will return your correctly formatted sound, along with the sampling rate of the sound.



Ex. fancywavread(‘ExpASound’)
Ex. fancywavread(‘ExpASound’,’L’)


soundfile:  String input that specifies the name of the sound file (.wav format) to be played.
Ex.  ‘ExpASound’

side:  Optional string input that specifies which ear the mono sound should be played to.  Input takes the form of either ‘L’ for left, or ‘R’ for right.
Ex. ‘L’


All string inputs must be surrounded by single quotation marks ( ‘ ‘ ).

All string inputs are case sensitive.

If you feed this function a stereo sound but then specify the ‘side’ argument, the non-specified channel will be overwritten with blanksound to create a mono sound.  This means you do not have to feed this function a mono sound if you want it to only be played to one side of the head.


If you would like to download this read-me to your computer, you can do so below (right-click and ‘Save As’).