Presentation is loading. Please wait.

Presentation is loading. Please wait.

3. Playing a stimulus 4. Waiting for an event2. Start / stop recording DisplayPic / HidePicture PlaySound / StopSound DisplayMsg / HideMessage WaitForKeyPress.

Similar presentations


Presentation on theme: "3. Playing a stimulus 4. Waiting for an event2. Start / stop recording DisplayPic / HidePicture PlaySound / StopSound DisplayMsg / HideMessage WaitForKeyPress."— Presentation transcript:

1 3. Playing a stimulus 4. Waiting for an event2. Start / stop recording DisplayPic / HidePicture PlaySound / StopSound DisplayMsg / HideMessage WaitForKeyPress WaitForTabZoneAt OpenRec CloseRec 1. Simple RecStandard RecNewPics Basic script commands (1) April 2012, Mshs, University of Poitiers, France Hands on scripts…

2 1. Simple 1.1. RecStandard (AddToParticipantName) Launches the Simple acquisition from script. Data will be recorded into files named from the participants Id. Replace optional parameters AddToParticipantName with something you want to add to the participants Id to name data files. This is the only script command family that internally manages start and stop of recording. The script command RecStandard(_trial) will record data into a file named testwin7_trial April 2012, Mshs, University of Poitiers, France

3 1.2. RecNewPics (AddToParticipantName, BackPic, Pic1, Pic2) Launches the Simple acquisition, specifying the background picture, pictures associated with the first and second trigger zones. Command example: RecNewPics(_P2,YellowBack.bmp,Capsela.bmp,car.bmp) The editor Command | Simple acquisition | RecNewPics menu opens this dialog box: The dialog box retrieves the Simple configuration panel options Insert resulting command in the script editor Optional (no value required) April 2012, Mshs, University of Poitiers, France

4 Example of use: Launching the Simple recording many times (same task), only changing pictures used. Script example: RecNewPics(_Trial1,BackGnd.bmp,Stimulus1.bmp,nothing.bmp) RecNewPics(_Trial2,BackGnd.bmp,Stimulus2.bmp,nothing.bmp) RecNewPics(_Trial3,BackGnd.bmp,Stimulus3.bmp,nothing.bmp) In this example, only picture associated with trigger zone 1 is changed. Background picture and picture associated with trigger zone 2 is always the same April 2012, Mshs, University of Poitiers, France Script example: RecNewPics(_Trial1,BackGnd.bmp,Stimulus1.bmp,nothing.bmp) RecNewPics(_Trial2,BackGnd.bmp,Stimulus2.bmp,nothing.bmp) RecNewPics(_Trial3,BackGnd.bmp,Stimulus3.bmp,nothing.bmp) For each participant, 3 recordings will be performed (3 data files): _Trial1 _Trial2 _Trial3 Script example: RecNewPics(_Trial1,BackGnd.bmp,Stimulus1.bmp,nothing.bmp) RecNewPics(_Trial2,BackGnd.bmp,Stimulus2.bmp,nothing.bmp) RecNewPics(_Trial3,BackGnd.bmp,Stimulus3.bmp,nothing.bmp)

5 Trying to open an acquisition while another is already in progress will close the first one before opening the second. Any command pausing script execution will not pause recording: recording is performed in parallel with script execution. 2. Start / stop recording These commands can be issued multiple times to perform several successive data acquisition OpenRec (AddToParticipantName) Launches the acquisition: starts tablet (and optionally eye tracker) data recording. The recording will go on until a command explicitly stop it or script is over. Data will be recorded into files named from the participants Id. Replace optional parameters AddToParticipantName with something you want to add to the participants Id to name data files April 2012, Mshs, University of Poitiers, France

6 2.2. CloseRec Stops the acquisition and closes data file. The script command OpenRec(_trial) will record data into files named testwin7_trial. Example: April 2012, Mshs, University of Poitiers, France

7 (Pre-writing pause) Script OpenRec command CloseRec command … Acquisition starts Tablet is activated Eye-tracker is activated Recording starts … Recording stops Script ends Acquisition stops … Tablet is deactivated Eye-tracker is deactivated Session log file is opened Log file is closed … (do something) …… OPenRec / CloseRec and the acquisition sequence… April 2012, Mshs, University of Poitiers, France

8 The recording timer starts immediately when the command OpenRec is activated or when the Simple acquisition (RecStandard, etc.) is executed. Time Data files (Acquisition starts) Go OpenRec 0 0 CloseRec 7814 CloseRec 4898 OPenRec/CloseRec and timing … April 2012, Mshs, University of Poitiers, France Each new data file (i.e. recording) starts at hour zero.

9 3. Playing a stimulus 3.1. DisplayPic (PictureFileName,Duration,X,Y) Displays the picture PictureFileName on screen at location X,Y for Duration milliseconds. Example: DisplayPic(MyPicture.bmp,5000,0,0) Translation: the picture MyPicture.bmp is displayed on screen in the upper left hand corner of the screen (coordinates 0,0) for 5 seconds. Magic values Script accepts the magic value -1 as a parameter value for: Duration : -1 means forever Screen coordinates: -1 means auto-center in screen Magic values Script accepts the magic value -1 as a parameter value for: Duration : -1 means forever Screen coordinates: -1 means auto-center in screen 3.2. HidePicture Removes pictures previously displayed with DisplayPic. Screen background is restored. Example : DisplayPic(MyPicture.bmp,-1,-1,-1) Translation: the picture MyPicture.bmp is displayed centered on screen. Script execution will go on, leaving the picture on screen April 2012, Mshs, University of Poitiers, France

10 3.3. PlaySound (WaveFileName,Wait) Plays the sound file WaveFileName StopSound Stops the sound file currently played April 2012, Mshs, University of Poitiers, France Example: PlaySound(dictation.wav,FALSE) Translation: the sound file Dictation.wav is played and script execution will immediately continue. Example of use: a (previously recorded) dictation is played, while tablet data is being recorded. If the parameter Wait is replaced with TRUE, the script interpretor will wait until the sound is finished. Otherwise (FALSE), it will resume script execution.

11 3.5. DisplayMsg (Message,Duration,X,Y,Transparent) Displays the text Message on screen at location X,Y for Duration milliseconds HideMessage Removes the message previously displayed on screen. Peculiarities: The message is a single line of text. Only one message can be displayed at a time April 2012, Mshs, University of Poitiers, France Example: DisplayMsg(Welcome to my lab !,4000,-1-1,FALSE) Translation: the message Welcome to my lab ! will be displayed centered on screen for 4 seconds. If the parameter Transparent is replaced with FALSE, the message will be displayed on a stripe colored with the font background color, otherwise (FALSE), only the characters will be displayed on screen.

12 These commands do not pause an acquisition / recording but only the script interpretor. Some commands tells the script interpretor to stop reading script (pause) until a certain event happens. These commands are mainly grouped into the Wait category. 4. Waiting for an event (participant action) 4.1. WaitForkeypress Stops script execution until a key of the keyboard is pressed WaitForTabZoneAt (x1,y1,x2,y2,CanDraw,MustLeave) Stops script execution until the pentip is pressed into the area located at tablet coordinates X1,y1,x2,y2. If the parameter CanDraw is set to TRUE, the participant's writing is displayed on screen. If the parameter CanDraw is set to TRUE, the pentip must be removed from the area before the script execution can resume. Figure: Command | Wait | WaitForTabZoneAt dialog box April 2012, Mshs, University of Poitiers, France

13 Exercise 1 Write a script such that a dictation takes place. An instruction is given to participant. (S)Hell press a key when ready to write. The dictation (pre-recorded sound file dictation.wav) will start and tablet data will be recorded. Handwriting will be displayed on screen. DisplayMsg(This is a dictation exercise.,4000,-1,-1,TRUE) April 2012, Mshs, University of Poitiers, France DisplayMsg(Press a key when ready to begin…,-1,-1,-1,TRUE) WaitForKeyPress OpenRec(_dictation) PlaySound(Dictation.wav,FALSE) HideMessage WaitForTabZoneAt(35596,21022,44697,27932,TRUE,FALSE) CloseRec Explain exercise Get ready… Wait until a keyboard key is pressed Start tablet recording, play sound and continue script execution Remove message from screen Script execution is suspended until the pen is pressed into the area mentioned. During this time, writing is displayed on screen. Stop tablet recording Hands on scripts

14 DisplayMsg(A picture will be displayed for 5 seconds.,4000,-1,-1,TRUE) DisplayMsg(As soon as this picture will disappear\, you will write down a description.,5000,-1,-1,TRUE) DisplayMsg(When youre finished\, press the pentip in the area labeled End,4000,-1,-1,TRUE) DisplayMsg(Press a key when ready to begin…,-1,-1,-1,TRUE) WaitForKeypress HideMessage OpenRec(_island) DisplayPic(ile.bmp,5000,0,0) WaitForTabZoneAt(35596,21022,44697,27932,TRUE,FALSE) CloseRec Exercise 2 Write a script such that a picture is displayed for 5 seconds, then the participant writes a description of the picture. An instruction should be given to the participant to explain what (s)he has to do. We dont want handwriting to be displayed on screen. Tablet data will be recorded for the duration of description writing April 2012, Mshs, University of Poitiers, France

15 Other commands of the Wait category (not presented here) are convenient mixtures of basic commands. For example, WaitForKeyPressPic is a combination of WaitForKeypress and DisplayPic April 2012, Mshs, University of Poitiers, France

16 Simple is better: complex script is prone to errors and participant may misunderstand the task. Dirty-and-effective: sometimes, a good old cut-and-paste of blocs of script is more effective and secure than spending hours building complex loops. Do not wait until whole script is written to test it. Probing for errors will be easier. Carefully check what data will be recorded. For example, should time spend to watch a picture be included in pre-writing pause or not (it may also depend whether eye movements are recorded or not). This will determine where OpenRec command will be inserted in script. Displaying writing on screen is not always desirable. This is resources and time consuming for the computer and it may perturb participant April 2012, Mshs, University of Poitiers, France A few advices


Download ppt "3. Playing a stimulus 4. Waiting for an event2. Start / stop recording DisplayPic / HidePicture PlaySound / StopSound DisplayMsg / HideMessage WaitForKeyPress."

Similar presentations


Ads by Google