Emotional dynamic


Author
Message
Igor Iarrobino
Igor Iarrobino
New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)
Group: Forum Members
Posts: 19, Visits: 49
I made a code for dynamic emotional stimuli (faces): the experiment is built to show a series of morphing videos of faces going from one expression to another. The total length of the stimuli is of 5000 ms. The subject has to press the spacebar to detect the the coming of the new expression on the face.

Here, I made some changes to adapt the script to two features that I need.
I need the following characteristics:
-  the response erase the stimulus;
- the stimulus disappear after 5000ms if no response is coming;
- to add a fixation cross before each stimulus (after clearscreen).

I have this error in <trial practice> and in <trial video> in one try, saying this: 'Missing ',' or '-' before '1 = clearscreen, 2 = fixation_trial, 3 = video.

In another try I put:
**************************************************************************************************************
*** PRACTICE TRIAL
**************************************************************************************************************
<trial practice>
/ ontrialbegin = [
  values.ITI = expressions.iti
]
/ stimulusframes = [
  1 = clearscreen,
  2-30 = fixation, // La croce di fissazione dura 500 ms (30 frame se refresh = 60Hz)
  31 = practicevideo
]
/ validresponse = (parameters.spacekey)
/ correctresponse = (parameters.responsekey)
/ response = correct
/ timeout = 5000 // Definito un timeout per gestire l'assenza di risposte
/ posttrialpause = values.ITI
/ ontrialend = [
  list.practiceRTvideo.appendItem(trial.practice.latency)
]
</trial>

**************************************************************************************************************
*** VIDEO TRIAL
**************************************************************************************************************
<trial video>
/ ontrialbegin = [
  values.ITI = expressions.iti
]
/ stimulusframes = [
  1 = clearscreen,
  2-30 = fixation, // La croce di fissazione dura 500 ms
  31 = video
]
/ validresponse = (parameters.spacekey)
/ correctresponse = (parameters.responsekey)
/ response = correct
/ timeout = 5000 // Definito un timeout per gestire l'assenza di risposte
/ posttrialpause = values.ITI
/ ontrialend = [
  list.RTvideo.appendItem(trial.video.latency)
]
</trial>

But it didn't work anyway.

I past the entire code here:

<usermanual>
___________________________________________________________________________________________________________________    

                                        EMOTIONAL MORPHING                                 
___________________________________________________________________________________________________________________    

Script Author: IGOR IARROBINO, Research Fellow (igor.iarrobino@unimore.it/igor.iarrobino@gmail.com) for UNIMORE
Date: July 2024.

Script Copyright © 02-17-2022 Millisecond Software

___________________________________________________________________________________________________________________
TASK DESCRIPTION    
___________________________________________________________________________________________________________________    

Participants undergo an emotional dynamic task in which emotional faces switching from one of three emotions, i.e. happiness, anger and fear, to sadness are depicted.
Participants are asked to press a certain response key (here: SPACEBAR) whenever the emotion appearing in the videoclip is recognized according to the block purpose.
___________________________________________________________________________________________________________________    
DURATION
___________________________________________________________________________________________________________________    
The set-up of the script takes appr. 15 minutes to complete

Note: the test can easily be aborted by pressing "Ctrl+Alt+A"
__________________________________________________________________________________________________________________    
DATA FILE INFORMATION
___________________________________________________________________________________________________________________        
The default data stored in the data files are:

(1) Raw data file: 'simplereactiontime_cogdras_raw*.iqdat' (a separate file for each participant)*


build:                                The specific Inquisit version used (the 'build') that was run
computer.platform:                    the platform the script was run on (win/mac/ios/android)
date, time:                         date and time script was run
subject, group:                     with the current subject/groupnumber
session:                            with the current session id

blockcode, blocknum:                the name and number of the current block (built-in Inquisit variable)
trialcode, trialnum:                 the name and number of the currently recorded trial (built-in Inquisit variable)
                                        Note: trialnum is a built-in Inquisit variable; it counts all trials run; even those
                                        that do not store data to the data file.
                                        
stimulusitem:                        the presented stimuli in order of trial presentation
response:                            the participant's response (scancode of response buttons)                                

latency:                             the response latency (in ms); measured from: onset of videoclip

iti:                                the intertrial interval (in ms) run at the end of the current trial

(2) Summary data file: 'simplereactiontime_emomorph_summary*.iqdat' (a separate file for each participant)*

inquisit.version:                     the Inquisit build/version run
computer.platform:                    the platform the script was run on (win/mac/ios/android)
startDate:                            date script was run
startTime:                            time script was started
subjectid:                            assigned subject id number
groupid:                            assigned group id number
sessionid:                            assigned session id number
elapsedTime:                        time it took to run script (in ms); measured from onset to offset of script
completed:                            0 = script was not completed (prematurely aborted)
                                    1 = script was completed (all conditions run)
                                    video_RT
                                    (measured from onset of videos in the center of the screen)
                            
                            
* separate data files: to change to one data file for all participants (on Inquisit Lab only), go to section
"DATA" and follow further instructions

___________________________________________________________________________________________________________________    
EXPERIMENTAL SET-UP
___________________________________________________________________________________________________________________    

1. 1 Test blocks with 3 conditions:
- 20 trials da Felicità a Tristezza
- 20 trials da rabbia a Tristezza
- 20 trials da Paura a Tristezza

Trial sequence:
- videoclip (5000ms; wait for response) -> iti (1500ms) -> videoclip....

___________________________________________________________________________________________________________________
STIMULI
___________________________________________________________________________________________________________________
K-DEF videoclip and morphed mixed emotions made ad-hoc

_________________________________________________________________________________________________________________    
INSTRUCTIONS
___________________________________________________________________________________________________________________    
provided by Millisecond Software - edited by IGOR IARROBINO
___________________________________________________________________________________________________________________    
EDITABLE CODE
___________________________________________________________________________________________________________________    
check below for (relatively) easily editable parameters, stimuli, instructions etc.
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code
to further customize your experiment.

The parameters you can change are:
</usermanual>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE PARAMETERS: change editable parameters here
**************************************************************************************************************
**************************************************************************************************************

<parameters>
/spacekey = " "     //the space-response key (here: SPACEBAR)
/responsekey = parameters.spacekey                //the assignment of space to responsekey (here SPACEBAR)
</parameters>

<expressions>
/iti = 1500
</expressions>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI
**************************************************************************************************************
**************************************************************************************************************
<list practice_itemnumbers>
/items = (1, 2, 3, 4, 5, 6)
/replace = false
/resetinterval = 0
</list>

<item practicevideo>
/1="F01_FtoT.avi"
/2="M03_FtoT.avi"
/3="F01_RtoT.avi"
/4="M03_RtoT.avi"
/5="F01_PtoT.avi"
/6="M03_PtoT.avi"
</item>

<video practicevideo>
/items = item.practicevideo
/position = (50%, 50%)
/size = (80%, 80%)
</video>

//main stimulus that appreas in the middle of the screen
<list video_itemnumbers>
/items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60)
/replace = false
/resetinterval = 0
</list>

<item video>
/1="F01_FtoT.avi"
/2="F02_FtoT.avi"
/3="F03_FtoT.avi"
/4="F04_FtoT.avi"
/5="F05_FtoT.avi"
/6="M01_FtoT.avi"
/7="M02_FtoT.avi"
/8="M03_FtoT.avi"
/9="M04_FtoT.avi"
/10="M05_FtoT.avi"
/11="F01_FtoT.avi"
/12="F02_FtoT.avi"
/13="F03_FtoT.avi"
/14="F04_FtoT.avi"
/15="F05_FtoT.avi"
/16="M01_FtoT.avi"
/17="M02_FtoT.avi"
/18="M03_FtoT.avi"
/19="M04_FtoT.avi"
/20="M05_FtoT.avi"
/21="F01_RtoT.avi"
/22="F02_RtoT.avi"
/23="F03_RtoT.avi"
/24="F04_RtoT.avi"
/25="F05_RtoT.avi"
/26="M01_RtoT.avi"
/27="M02_RtoT.avi"
/28="M03_RtoT.avi"
/29="M04_RtoT.avi"
/30="M05_RtoT.avi"
/31="F01_RtoT.avi"
/32="F02_RtoT.avi"
/33="F03_RtoT.avi"
/34="F04_RtoT.avi"
/35="F05_RtoT.avi"
/36="M01_RtoT.avi"
/37="M02_RtoT.avi"
/38="M03_RtoT.avi"
/39="M04_RtoT.avi"
/40="M05_RtoT.avi"
/41="F01_PtoT.avi"
/42="F02_PtoT.avi"
/43="F03_PtoT.avi"
/44="F04_PtoT.avi"
/45="F05_PtoT.avi"
/46="M01_PtoT.avi"
/47="M02_PtoT.avi"
/48="M03_PtoT.avi"
/49="M04_PtoT.avi"
/50="M05_PtoT.avi"
/51="F01_PtoT.avi"
/52="F02_PtoT.avi"
/53="F03_PtoT.avi"
/54="F04_PtoT.avi"
/55="F05_PtoT.avi"
/56="M01_PtoT.avi"
/57="M02_PtoT.avi"
/58="M03_PtoT.avi"
/59="M04_PtoT.avi"
/60="M05_PtoT.avi"
</item>

<video video>
/items = item.video
/ position = (50%, 50%)
/ size = (80%, 80%)
</video>

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE INSTRUCTIONS: change instructions here
**************************************************************************************************************
**************************************************************************************************************
<instruct>
</instruct>

<text beginning>
/ items = ("In questo esperimento, Lei vedrà dei filmati di volti umani che partono da un'emozione per trasformarsi lentamente in un'altra emozione.
L'esperimento vero e proprio è preceduto da un piccolo training.")

/ position = (50%, 50%)
/ size = (90%, 75%)
/ vjustify = center
/ hjustify = left
/ fontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
</text>

<text intro>
/ items = ("Adesso vedrà una serie di volti che esprimono un'emozione di partenza, che lentamente si trasformerà in un'altra emozione.
essi verranno presentati uno alla volta al centro dello schermo.

Lei si ricordi di premere il tasto indicato dello sperimentatore nel momento in cui percepisce che sul volto rappresentato compaia un'emozione diversa da quella di partenza.")

/ position = (50%, 50%)
/ size = (80%, 60%)
/ vjustify = center
/ hjustify = left
/ fontstyle = ("Arial", 3.5%, true, false, false, false, 5, 1)
</text>

<text continue>
/ items = ("<%expressions.continueInstructions%>")

/ position = (50%, 95%)
/ size = (45%, 5%)
/ vjustify = center
/ fontstyle = ("Arial", 2.5%, true, false, false, false, 5, 1)
/ txbgcolor = black
/ txcolor = white
/ erase = false
</text>

<expressions>
/continueInstructions = "Prema il tasto indicato dello sperimentatore per continuare."
</expressions>

<text start>
/ items = ("Prema il tasto indicato dello sperimentatore per iniziare.")

/ position = (50%, 95%)
/ size = (40%, 5%)
/ vjustify = center
/ fontstyle = ("Arial", 2.5%, true, false, false, false, 5, 1)
/ txbgcolor = black
/ txcolor = white
/ erase = false
</text>

<text getReadyInstructions>
/ items = ("<%expressions.readyInstruct%>")
/ fontstyle = ("Arial", 5.00%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 40%)
/ vjustify = center
/ voiceover = false
</text>

<expressions>
/readyInstruct = "Posizioni il suo indice sul tasto indicato dello sperimentatore e lo prema per poter continuare."
</expressions>

<text finish>
/ items = ("Grazie per aver partecipato all'esperimento!")
/ voiceover = false
/ fontstyle = ("Arial", 6%, true, false, false, false, 5, 1)
/ position = (50%, 45%)
/ size = (100%, 10%)
/ vjustify = center
/ valign = center
/ halign = center
</text>

<text exit>
/ items = ("<%expressions.continueInstructions%>")
/ voiceover = false
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 95%)
/ size = (40%, 5%)
/ vjustify = center
/ valign = center
/ halign = center
/ txbgcolor = black
/ txcolor = white
</text>

<text fixation>
/ items = ("+")
/ position = (50%, 50%) // Centra la croce sullo schermo
/ fontstyle = ("Arial", 5%, true, false, false, false, 5, 1)
/ txcolor = black // Colore della croce
/ erase = true (500) // Cancella dopo la durata specificata
</text>


**************************************************************************************************************
                !!!REMAINING CODE: Customize after careful consideration only!!!
**************************************************************************************************************
**************************************************************************************************************
**************************************************************************************************************
    DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.5.2.0 or higher

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "6.5.2.0"
/fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = lightgrey
/txcolor = black
/screencolor = lightgrey
/inputdevice = keyboard
/quitcommand = (Ctrl+Alt+30)
</defaults>

**************************************************************************************************************
**************************************************************************************************************
    DATA
**************************************************************************************************************
**************************************************************************************************************

Note: data file explanations under User Manual Information at the top

To change from one data file per participant to one data file for all participants, set
/separatefiles = false

***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusitem, response, latency, values.iti)
</data>

***********************
summary data file
***********************
<summarydata>
/ columns = (inquisit.version, computer.platform, script.startDate, script.startTime,
script.subjectId, script.groupId, script.sessionId,
script.elapsedTime, script.completed, expressions.video_RT)
</summarydata>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************

<values>
/countTrials = 0
/ITI = ""
/video_RT = ""
</values>

**************************************************************************************************************
**************************************************************************************************************
    EXPRESSIONS
**************************************************************************************************************
**************************************************************************************************************

<expressions>
/video_RT = list.RTvideo.mean
</expressions>


**************************************************************************************************************
**************************************************************************************************************
    INSTRUCTIONS TRIALS
**************************************************************************************************************
**************************************************************************************************************
<trial beginning>
/ stimulusframes = [1 = beginning, continue]
/ validresponse = (parameters.spacekey)
</trial>

<trial practiceintro>
/ stimulusframes = [1 = intro, continue]
/ validresponse = (parameters.spacekey)
/ correctresponse = (parameters.responsekey)
/ response = correct
/ recorddata = false
/ responsemessage = (parameters.responsekey, clearScreen, 0)
</trial>

<trial intro>
/ stimulusframes = [1 = intro, continue]
/ validresponse = (parameters.spacekey)
/ correctresponse = (parameters.responsekey)
/ response = correct
/ recorddata = false
/ responsemessage = (parameters.responsekey, clearScreen, 0)
</trial>

This trial is used when participants are asked to place their fingers on specific response
buttons.
<trial getReady>
/ stimulusframes = [1 = clearScreen, getReadyInstructions, start]
/ validresponse = (parameters.spacekey)
/ correctresponse = (parameters.responsekey)
/ response = correct
/ recorddata = false
/ posttrialpause = expressions.iti
/ responsemessage = (parameters.leftkey, clearScreen, 0)
</trial>

<trial finish>
/ stimulusframes = [1 = clearScreen, finish]
/ recorddata = false
/ timeout = 7000
</trial>

<trial fixation_trial>
/ stimulusframes = [1 = fixation]
/ timeout = 500 // Durata della croce in millisecondi (esempio: 500 ms)
/ recorddata = false
</trial>

**************************************************************************************************************
**************************************************************************************************************
    LISTS    
**************************************************************************************************************
**************************************************************************************************************


*************************************************
Data Lists: used for descriptive statistics
store correct latencies/accuracy data
fill up during runtime
*************************************************

Note: list stores the latency of correct responses for each relevant trial
<list practiceRTvideo>
</list>

<list RTvideo>
</list>

**************************************************************************************************************
**************************************************************************************************************
    EXP. TRIALS     
**************************************************************************************************************
**************************************************************************************************************
<trial practice>
/ ontrialbegin = [
values.ITI = expressions.iti
]
/ stimulusframes = [
1 = clearscreen, // Pulisce lo schermo
2 = fixation_trial, // Mostra la croce di fissazione
3 = practicevideo // Mostra il video
]
/ validresponse = (parameters.spacekey)
/ correctresponse = (parameters.responsekey)
/ response = correct
/ timeout = 5000 // Timeout di 5000 ms (5 secondi)
/ posttrialpause = values.iti
/ ontrialend = [
list.practiceRTvideo.appendItem(trial.practice.latency)
]
</trial>



<trial video>
/ ontrialbegin = [
values.ITI = expressions.iti
]
/ stimulusframes = [
1 = clearscreen, // Pulisce lo schermo
2 = fixation_trial, // Mostra la croce di fissazione
3 = video // Mostra il video
]
/ validresponse = (parameters.spacekey)
/ correctresponse = (parameters.responsekey)
/ response = correct
/ timeout = 5000 // Timeout di 5000 ms
/ posttrialpause = values.iti
/ ontrialend = [
list.RTvideo.appendItem(trial.video.latency)
]
</trial>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************
<block beginning>
/ trials = [1= beginning]

</block>
<block practice>
/ trials = [
    1 = practiceintro;
    2 = getReady;
    3-8 = practice;
]
/ branch = [
return block.video;
]
</block>

<block video>
/ trials = [
    1 = intro;
    2 = getReady;
    3-62 = video;
]
</block>

<block finish>
/ trials = [
    1 = finish;
]
</block>


**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [
    1 = beginning;
    2 = practice;
    3 = video;
    4 = finish;
]
/ onexptend = [
    values.video_RT = expressions.video_RT;
]

</expt>

**************************************************************************************************************
                                                End of File
**************************************************************************************************************



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
freegor - Yesterday @ 4:13 AM
Dave - Yesterday @ 4:29 AM
freegor - Yesterday @ 5:51 AM
Dave - Yesterday @ 6:00 AM

Reading This Topic

Explore
Messages
Mentions
Search