Getting started / Making an experiment

Custom code – 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 in MATLAB + Psychtoolbox. The approach is to write it as a new element type in your library—this allows you to use and reuse the code anywhere in the form of objects, parameterize and get outputs from it in the form of properties, and have it click with all core functionality (e.g. timing, core visual options, results output, working with staircases, etc.). A specialized programming framework and offloading core functionality to PsychBench makes this process efficient. You can make a quick type for just your experiments, or you can make a durable type with more flexibility and a fuller interface for other users. All the standard 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. A copy is also included in PsychBench 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 an object 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!