[Next] [Previous] [Up] [Top] [Contents] [Index]

5.2 Allocating Stimuli and Attributes

5.2.2 Multiple Stimulus Values


You have probably noticed by now the use of both "stimulus value" and "stimulus values" in describing the content of a stimulus. This is because it is possible to have an ODEV which defines an stimulus type which is a composite of a number of sub-stimuli. This kind of stimulus type would have multiple stimulus values, one for each sub-stimulus. Each stimulus value could have its own attribute set, or inherit attributes from the super-stimulus.

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.


PSYX Programmer's Manual - 24 AUG 95
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with CERN WebMaker