Skip to content

Commit 7bda078

Browse files
committed
set parameters and chose the right file
1 parent ab9847e commit 7bda078

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

subfun/doAudMot.m

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,54 @@
11
function [onset, duration] = doAudMot(cfg, expParameters, thisEvent)
2+
3+
% Play the auditopry stimulation of moving in 4 directions or static noise bursts
4+
%
5+
% DIRECTIONS
6+
% 0=Right; 90=Up; 180=Left; 270=down; -1 static
7+
%
8+
% Input:
9+
% - cfg: PTB/machine configurations returned by setParameters and initPTB
10+
% - expParameters: parameters returned by setParameters
11+
% - thisEvent: structure that the parameters regarding the event to present
12+
%
13+
% Output:
14+
% -
15+
%
16+
17+
%% Get parameters
18+
19+
sound=[];
20+
21+
direction = thisEvent.direction(1);
22+
isTarget = thisEvent.target(1);
23+
24+
25+
26+
if isTarget == 0
27+
28+
if direction == -1
29+
sound = soundData.S;
30+
elseif direction == 90
31+
sound = soundData.U;
32+
elseif direction == 270
33+
sound = soundData.D;
34+
elseif direction == 0
35+
sound = soundData.R;
36+
elseif direction == 180
37+
sound = soundData.L;
38+
end
39+
40+
elseif isTarget == 1
41+
42+
if direction == -1
43+
sound = soundData.S_T;
44+
elseif direction == 90
45+
sound = soundData.U_T;
46+
elseif direction == 270
47+
sound = soundData.D_T;
48+
elseif direction == 0
49+
sound = soundData.R_T;
50+
elseif sdirection == 180
51+
sound = soundData.L_T;
52+
end
53+
54+
end

0 commit comments

Comments
 (0)