User Manual: Inquisit Paced Motor Timing Task


___________________________________________________________________________________________________________________	

									*PACED MOTOR TIMING*
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 06-17-2013
last updated:  05-08-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 05-08-2024 Millisecond Software
___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	
This script implements a Paced Motor Timing procedure similarly to the one described in:

Wittmann, M., Leland, D.S., Jan Churan, J. & Paulus, M.P.(2007). Impaired time perception and motor timing
in stimulant-dependent subjects. Drug and Alcohol Dependence, 90, 183–192.

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________	
participants are asked to synchronize keyboard clicks with a steady pacer signal of equally spaced beeps.

In condition A: pacer signal (beep) is played for all test trials.
In condition B: pacer signal (beep) is only played in the beginning.

Note: taps in this script are accepted before or after a beep is played.

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 6 minutes to complete

__________________________________________________________________________________________________________________	
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________	
The fields in the data files are:

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

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 such as feedback trials. Thus, trialNum 
									may not reflect the number of main trials run per block.
										
										
condition:						1 = pacer signal present until the end; 
								2 = pacer signal stops after a predetermined number of trials (here:10)
								
conditionCounter:				counts the number of blocks run in the paced (1) and unpaced (2) conditions								
								
								
(parameter) reps:				stores the number of pacer repetitions for the current block
soa:							stores the SOA for the current block

countbeeps:						counts the number of beeps played

sound.beep.timestamp:			the timestamp of the current beep (measured from script onset)
responseTimeStampsPerBeep:		the timestamp(s) of the spacebar responses made in one (beep-)trial
									Note: for unpaced trials this will always be 1
									
countResponsesTrial:			a counter variable that counts all registered responses during a trial

responseCounter:				counts all responses made during a block (should be 20)


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

inquisit.version:				Inquisit 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)	

///Parameter Settings:																		
(parameter) reps:				number of test trials (default: 20) Note: the start beep does not count towards this number
(parameter) valid_reps:			number of paced/unpaced trials used for summary statistics (default: the last 10 pacers/trials)
								Note: in condition B, the pacer signal does not play anymore for these trials
									
(parameter) SOA1:				SOA 1 in ms (default: 1000ms) => SOA = Stimulus Onset Asynchrony
(parameter) SOA2:				SOA 2 in ms (default: 2000ms)
(parameter) SOA3:				SOA 3 in ms (default: 4000ms)


///Summary Variables:

PACED TRIALS (CONDITION A):

nrResponsesCondASOA1:			number of all registered spacebar presses for Condition A ("paced") with SOA1 (for all 20 beeps);

targetIntervalTapResponsesASOA1:	the number of tap responses made during the TARGET-TIME-INTERVAL;
									Considered for the analysis of tap intervals are all tap responses that are registered from:
									TARGET-TIME-INTERVAL = (timestamp of first of 10 last beeps) - (SOA/2) TO (timestamp of last of 10 last beeps) + (SOA/2)
									
extraTapResponsesASOA1:			the number of extra tap responses (beyond 10) during TARGET-TIME-INTERVAL

meanTICondASOA1:				mean Tap Interval (time intervals between taps).
									
stdTICondASOA1: 				associated standard deviation of tap intervals

pacedResponseCountCondASOA1: 	number of matched responses for the last 10 beeps for Condition A ("paced") with SOA1
								that are used to calculate 'meanToACondA-SOA1' (Range: 0-10). 
								If this number is lower than 10, not all beeps were successfully paired with a spacebar press.
																	
meanToACondASOA1: 				mean TapOnsetAsynchrony (ToA) for conditionA for SOA1; based on the last 10 (default) beeps
								matched with the closest (non matched) response 
								within the time interval: beepTimeStamp +/- (SOA/2)
								(ToA = Deviation from pacer beep -whether early or late) 
								
								Note: if a beep remains unmatched, (SOA/2) is substituted in for the time difference 
								between beepTimeStamp and responseTimeStamp for the purpose of the 
								script's synchronicity analyses
								=> Maximum of meanToACondASOA1 = (SOA/2)
																
									
stdToACondASOA1: 				associated standard deviations of ToAs

								
(same for SOA2-SOA3)


UNPACED TRIALS (CONDITION B):

nrResponsesCondBSOA1:				counts all responses made during the Unpaced Condition (counts responses across paced and unpaced trials)			
unpacedResponseCountCondBSOA1:		counts number of unpaced responses (should be 10)
	
meanTICondBSOA1:					mean Tap Interval (time intervals between taps) in ms based on the last 10 (default) intervals
									for ConditionB ('unpaced') with SOA1
									
stdTICondBSOA1: 					associated standard deviation of tap intervals

(same for SOA2-SOA3)

___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	
- 2 pacing conditions (paced vs. unpaced) x 3 Stimulus Onset Asynchronies (SOAs: 1000ms, 2000ms, 4000ms)
- paced vs. unpaced tested in blocked format with paced conditions running first
- SOAs are sampled randomly within the pacing conditions

Paced Condition:
In the Paced Conditions deviations from the pacer signal are recorded. These deviations can occur
before or after the beep signal. Only the last 10 tap intervals are considered for summary variables

- all trials can collect multiple spacebar presses to enable the collection of synchronized beeps
that happend before the beep is played
The script records the timestamp of the beep as well as the timestamp of each response made in the raw datafile.

Algorithm for SYNCHRONIZATION analysis:
- the script looks at the last 10 beeps and tries to match up each of these beeps with the closest (non matched) 
spacebar response that was made within (beepTimeStamp - SOA/2) to (beepTimeStamp + SOA/2)
- the scripts calculates the absolute difference between the beepTimeStamp and matched responseTimeStamp: abs(beepTimeStamp-responseTimeStamp)
- if no adequate response match is found for a beep, the script substitutes (SOA/2) for the calculated difference
- the script calculates the mean of the 10 time differences: (theoretical Range: 0-SOA/2)

Algorithm for TAP INTERVAL analysis:
- the script looks at all responses made during the TARGET-TIME-INTERVAL: (timestamp of first of the last 10 beeps - SOA/2) TO (timestamp of last of the last 10 beeps + SOA/2)
- the script then calculates all the tap intervals from all responses made during that time frame
as differences in timestamps of these responses
Example: tapInterval1 = responseTimeStamp2-responseTimeStamp1
- the script calculates the mean of all these tap intervals
Note: the more responses were made during the TARGET-TIME-INTERVAL, 
the more intervals are used for the calculation of the mean	
		
Unpaced Condition:
In the unpaced condition, only Response Tap Intervals are recorded and only for the
last 10 tap intervals (in the summary data file).

Note: If only a subset of the conditions should be run, go to section Experiment and follow instructions.
 
___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________	
see section Editable Stimuli

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________	
see section Editable Instructions

___________________________________________________________________________________________________________________	
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:

/reps:							number of test trials (default: 20) Note: the start beep does not count towards this number

/validReps:					number of paced/unpaced trials used for summary statistics (default: the last 10 pacers/trials)
									Note: in condition B, the pacer signal does not play anymore for these trials
									
/soa1:							SOA 1 in ms (default: 1000ms) => SOA = Stimulus Onset Asynchrony
/soa2:							SOA 2 in ms (default: 2000ms)
/soa3:							SOA 3 in ms (default: 4000ms)
/maxAsynchrony:				maximum absolute deviation in ms from pacer that that is considered a synchronous response (default: 120ms)
/getReadyDuration:				the duration (in ms) of the get-ready trial (default: 3000ms)