-
Notifications
You must be signed in to change notification settings - Fork 0
/
2c - Copy.osexp
194 lines (177 loc) · 5.52 KB
/
2c - Copy.osexp
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
---
API: 2.1
Citation: 'Logan, G. D., Cowan, W. B., & Davis, K. A. (1984). On the ability to inhibit
simple and choice reaction time responses: a model and a method. *Journal of Experimental
Psychology: Human Perception and Performance*, *10*(2), 276. <http://doi.org/10.1037/0096-1523.10.2.276>'
Description: Loosely based on Logan et al. (1984)
OpenSesame: 3.2.8
Platform: nt
Title: Stop-Signal Task
---
set width 1024
set uniform_coordinates yes
set title "Stop-Signal Task"
set subject_parity even
set subject_nr 0
set start experiment
set sound_sample_size -16
set sound_freq 48000
set sound_channels 2
set sound_buf_size 1024
set sampler_backend legacy
set round_decimals 2
set mouse_backend xpyriment
set keyboard_backend legacy
set height 768
set fullscreen no
set form_clicks no
set foreground white
set font_underline no
set font_size 18
set font_italic no
set font_family mono
set font_bold no
set experiment_path "F:\\bciiiiiiiiiiiiiiiiiiiiiiiii"
set disable_garbage_collection yes
set description "Loosely based on Logan (1984) Journal of Experimental Psychology: Human Perception and Performance"
set coordinates uniform
set compensation 0
set color_backend legacy
set clock_backend legacy
set canvas_backend xpyriment
set bidi no
set background black
define sketchpad blank
set duration 500
set description "Displays stimuli"
define loop block_loop
set source_file ""
set source table
set skip 0
set repeat 1
set order random
set offset no
set item trial_sequence
set description "Repeatedly runs another item"
set cycles 20
set continuous no
set column_order "target;stop_after;correct_response"
set break_if_on_first yes
set break_if never
setcycle 0 stop_after ""
setcycle 0 target left
setcycle 1 stop_after ""
setcycle 1 target right
setcycle 2 stop_after ""
setcycle 2 target left
setcycle 3 stop_after ""
setcycle 3 target right
setcycle 4 stop_after ""
setcycle 4 target left
setcycle 5 stop_after ""
setcycle 5 target right
setcycle 6 stop_after ""
setcycle 6 target left
setcycle 7 stop_after ""
setcycle 7 target right
setcycle 8 stop_after ""
setcycle 8 target left
setcycle 9 stop_after ""
setcycle 9 target right
setcycle 10 stop_after ""
setcycle 10 target left
setcycle 11 stop_after ""
setcycle 11 target right
setcycle 12 stop_after ""
setcycle 12 target left
setcycle 13 stop_after ""
setcycle 13 target right
setcycle 14 stop_after ""
setcycle 14 target left
setcycle 15 stop_after ""
setcycle 15 target right
setcycle 16 stop_after ""
setcycle 16 target left
setcycle 17 stop_after ""
setcycle 17 target right
setcycle 18 stop_after ""
setcycle 18 target left
setcycle 19 stop_after ""
setcycle 19 target right
run trial_sequence
define sketchpad cue
set duration 1500
set description "Displays stimuli"
draw arrow arrow_body_length=0.8 arrow_body_width=0.5 arrow_head_width=30 color=white fill=1 penwidth=1 show_if="[target] = right" x1=-64 x2=64 y1=0 y2=0 z_index=0
draw arrow arrow_body_length=0.8 arrow_body_width=0.5 arrow_head_width=30 color=white fill=1 penwidth=1 show_if="[target] = left" x1=64 x2=-64 y1=0 y2=0 z_index=0
define sequence experiment
set flush_keyboard yes
set description "Runs a number of items in sequence"
run new_inline_script_3 always
run block_loop always
run blank always
run finished always
run new_inline_script_4 always
define sketchpad finished
set duration keypress
set description "Displays stimuli"
draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="The experiment is finished!<br /><br />" x=0 y=0 z_index=0
define sketchpad fixdot
set duration 4500
set description "Displays stimuli"
draw line color=white penwidth=5 show_if=always x1=0 x2=0 y1=0 y2=-160 z_index=0
draw line color=white penwidth=5 show_if=always x1=0 x2=160 y1=0 y2=0 z_index=0
draw line color=white penwidth=5 show_if=always x1=0 x2=0 y1=0 y2=160 z_index=0
draw line color=white penwidth=5 show_if=always x1=0 x2=-160 y1=0 y2=0 z_index=0
define inline_script new_inline_script
set description "Executes Python code"
___run__
print(i)
i = i + 1
try:
exp.serial_port.write(1000)
print 'trigger '
except:
print 'Failed to send trigger!'
__end__
set _prepare ""
define inline_script new_inline_script_1
set description "Executes Python code"
set _run ""
set _prepare ""
define inline_script new_inline_script_2
set description "Executes Python code"
set _run ""
set _prepare ""
define inline_script new_inline_script_3
set description "Executes Python code"
___run__
import serial
exp.serial_port = serial.Serial('COM7')
i = 1
__end__
set _prepare ""
define inline_script new_inline_script_4
set description "Executes Python code"
___run__
exp.serial_port.close()
__end__
set _prepare ""
define sketchpad new_sketchpad
set duration 3500
set description "Displays stimuli"
draw line color=white penwidth=1 show_if=always x1=0 x2=0 y1=-96 y2=96 z_index=0
draw line color=white penwidth=1 show_if=always x1=-96 x2=96 y1=0 y2=0 z_index=0
define coroutines stop_signal_coroutines
set function_name ""
set flush_keyboard no
set end_after_item ""
set duration 50000
set description "Run items simultaneously"
define sequence trial_sequence
set flush_keyboard yes
set description "Runs a number of items in sequence"
run new_sketchpad always
run cue always
run new_inline_script always
run fixdot always