5.2 Allocating Stimuli and Attributes
In factor format scripts, an event with multiple sub-stimuli has a "Stimuli" attribute, with a list of references to entries which define the sub-stimuli. Events with a single stimulus have a "stimulus" attribute, and the entire content of the attribute is taken as the value of a single stimulus.
PsyScope's built-in PasteBoard event type is an example of this kind of composite type. A PasteBoard stimulus is really a composition of several other screen-based stimuli of other types, each with its own attributes.
PBoardEvent:: EventType: PasteBoard Stimuli: TextStim PICTStim PBoardPort: PortName(port1) Duration: 500 TextStim:: StimType: Text Stimulus: "Hello" Port: PortName(port2) PICTStim:: StimType: PICT Stimulus: world.pict Port: PortName(port3)The three entries above specify a single event of type PasteBoard, which contains two sub-stimuli, the word "Hello", and a picture contained in the file
world.pict
. Here, PBoardEvent has two stimulus which are the text "Hello" and the pict file name world.pict
. It also has an attribute, namely the "PBoardPort" attribute.
The parameters of the OAlloc
message, described below, tell how many stimulus values the stimulus to be allocated has. Most ODEVs do not allow multiple stimuli for their Event/Stimulus types, and simply return an error if they are passed more than one stimulus value to OAlloc
.
The PsyScope Toolbox functions get_stim_value() and get_attribs(), extract stimulus values and attributes from the script using the pointers to stimulus information provided in the parameters to OAlloc
. With them is a family of related functions for extracting sub-attributes and information necessary for implementing composite stimulus types. See "5.3.9 OAlloc" and "11.5.3 Event Stimuli and Attributes" for more information.
Generated with CERN WebMaker