Getting started / Making an experiment

Custom stimuli – New element types

Making/Editing element types

If the element type library doesn’t have the stimuli you need for an experiment, first make sure PsychBench is up to date using pb_update. You can also email us at contact@psychbench.org to request an element type.

Otherwise you can write your own code for stimuli in MATLAB + Psychtoolbox. The approach is to write it as a new element type—this allows you to use the code anywhere in any experiment by making objects of the type, parameterize and get output from it using object properties, and have it work with all core functionality (timing, core visual options, staircasing, results output, etc.). You can make a quick type for a limited number of experiments, or you can make a durable type with more flexibility and a fuller interface for other users. All the element types that come with PsychBench are open source, so you can use them as examples and/or build off them.

See Element type programming manual.pdf for more information. There is a local copy in <><PsychBench folder><>/docs.

Sending/Receiving element types

To share an element type with other people, just zip its folder and email it. To add a type you have received, just copy its folder into your local element types folder, then call pb_addPath to have PsychBench find it.

You can also contribute a type to the library that comes with PsychBench. Please email us at contact@psychbench.org. We would be happy to credit you. And thank-you!