1 / 16

3. Playing a stimulus

Basic script commands (1). 1. Simple. 3. Playing a stimulus. RecStandard RecNewPics. DisplayPic / HidePicture PlaySound / StopSound DisplayMsg / HideMessage. 2. Start / stop recording. 4. Waiting for an event. OpenRec CloseRec. WaitForKeyPress WaitForTabZoneAt. Hands on scripts….

edythe
Download Presentation

3. Playing a stimulus

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 1. Simple This is the only script command family that “internally” manages start and stop of recording. 1.1. RecStandard(AddToParticipantName) Launches the Simple acquisition from script. Data will be recorded into files named from the participant’s Id. Replace optional parameters AddToParticipantNamewith something you want to add to the participant’s Id to name data files. The script command RecStandard(_trial) will record data into a file named “testwin7_trial”. 10-12 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: Optional (no value required) The dialog box retrieves the Simple configuration panel options Insert resulting command in the script editor 10-12 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) 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) 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. For each participant, 3 recordings will be performed (3 data files): <ParticipantName>_Trial1 <ParticipantName>_Trial2 <ParticipantName>_Trial3 10-12 April 2012, Mshs, University of Poitiers, France

  5. 2.Start / stop recording These commands can be issued multiple times to perform several successive data acquisition. 2.1. 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. Any command “pausing” script execution will not pause recording: recording is performed in parallel with script execution. Trying to open an acquisition while another is already in progress will close the first one before opening the second. Data will be recorded into files named from the participant’s Id. Replace optional parameters AddToParticipantNamewith something you want to add to the participant’s Id to name data files. 10-12 April 2012, Mshs, University of Poitiers, France

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

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

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

  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” Example: DisplayPic(MyPicture.bmp,-1,-1,-1) Translation: the picture MyPicture.bmpis displayed centered on screen. Script execution will go on, leaving the picture on screen. 3.2. HidePicture Removes pictures previously displayed with DisplayPic. Screen background is restored. 10-12 April 2012, Mshs, University of Poitiers, France

  10. 3.3. PlaySound(WaveFileName,Wait) Plays the sound file WaveFileName. 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. 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. 3.4. StopSound Stops the sound file currently played. 10-12 April 2012, Mshs, University of Poitiers, France

  11. 3.5. DisplayMsg(Message,Duration,X,Y,Transparent) Displays the text Message on screen at locationX,YforDurationmilliseconds. 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. 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. • Peculiarities: • The message is a single line of text. • Only one message can be displayed at a time. 3.6. HideMessage Removes the message previously displayed on screen. 10-12 April 2012, Mshs, University of Poitiers, France

  12. 4. Waiting for an event (participant action) 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. These commands do not pause an acquisition / recording but only the script interpretor. 4.1. WaitForkeypress Stops script execution until a key of the keyboard is pressed. 4.2. 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. 10-12 April 2012, Mshs, University of Poitiers, France Figure: Command | Wait | WaitForTabZoneAt dialog box

  13. Hands on scripts Exercise 1 Write a script such that a dictation takes place. An instruction is given to participant. (S)He’ll 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) Explain exercise DisplayMsg(Press a key when ready to begin…,-1,-1,-1,TRUE) Get ready… WaitForKeyPress Wait until a keyboard key is pressed OpenRec(_dictation) PlaySound(Dictation.wav,FALSE) Start tablet recording, play sound and continue script execution HideMessage 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. WaitForTabZoneAt(35596,21022,44697,27932,TRUE,FALSE) CloseRec Stop tablet recording 10-12 April 2012, Mshs, University of Poitiers, France

  14. 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 don’t want handwriting to be displayed on screen. Tablet data will be recorded for the duration of description writing. 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 you’re 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 10-12 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. 10-12 April 2012, Mshs, University of Poitiers, France

  16. A few advices • 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. 10-12 April 2012, Mshs, University of Poitiers, France

More Related