Skip to content

Commit 8528641

Browse files
Merge pull request #2 from marcobarilari/marco_new-motion-design
PR that will make #22 work with the new sound files
2 parents 76c5489 + 13dd29c commit 8528641

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

audioLocTranslational.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,13 @@
8282
% set direction, speed of that event and if it is a target
8383
thisEvent.trial_type = cfg.design.blockNames{iBlock};
8484
thisEvent.direction = cfg.design.directions(iBlock, iEvent);
85-
% thisEvent.speed = cfg.design.speeds(iBlock, iEvent);
86-
thisEvent.target = cfg.design.fixationTargets(iBlock, iEvent);
85+
thisEvent.fixationTarget = cfg.design.fixationTargets(iBlock, iEvent);
86+
87+
% % % WIP % % %
88+
89+
% thisEvent.soundTarget = cfg.design.soundTargets(iBlock, iEvent);
90+
91+
% % % WIP % % %
8792

8893
% we wait for a trigger every 2 events
8994
if cfg.pacedByTriggers.do && mod(iEvent, 2) == 1

setParameters.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
% cfg.design.motionType = 'radial';
4141
cfg.design.motionType = 'translation';
4242
cfg.design.names = {'static'; 'motion'};
43-
cfg.design.motionDirections = [-1 -1 1 1];
43+
% 0: L--R--L; 180: R--L--R;
44+
cfg.design.motionDirections = [0 0 180 180];
4445
cfg.design.nbRepetitions = 14;
4546
cfg.design.nbEventsPerBlock = 12;
4647

subfun/doAuditoryMotion.m

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,33 @@
1818
%% Get parameters
1919

2020
direction = thisEvent.direction(1);
21-
isTarget = thisEvent.target(1);
21+
isFixationTarget = thisEvent.fixationTarget(1);
2222
targetDuration = cfg.target.duration;
2323

24+
% % % WIP % % %
25+
26+
% isSoundTarget = thisEvent.soundTarget(1);
27+
28+
% % % WIP % % %
29+
2430
soundData = cfg.soundData;
2531

2632
switch direction
2733
case -1
2834
fieldName = 'S';
29-
case 90
30-
fieldName = 'U';
31-
case 270
32-
fieldName = 'D';
3335
case 0
34-
fieldName = 'R';
36+
fieldName = 'LRL';
3537
case 180
36-
fieldName = 'L';
38+
fieldName = 'RLR';
3739
end
3840

39-
if isTarget == 1
40-
fieldName = [fieldName '_T'];
41-
end
41+
% % % WIP % % %
42+
43+
% if isSoundTarget == 1
44+
% fieldName = [fieldName '_T'];
45+
% end
46+
47+
% % % WIP % % %
4248

4349
sound = soundData.(fieldName);
4450

@@ -51,7 +57,7 @@
5157
% ideally we would want to synch that first time stamp and the sound start
5258
thisFixation.fixation = cfg.fixation;
5359
thisFixation.screen = cfg.screen;
54-
if isTarget == 1
60+
if isFixationTarget == 1
5561
thisFixation.fixation.color = cfg.fixation.colorTarget;
5662
end
5763
drawFixation(thisFixation);
@@ -62,7 +68,7 @@
6268
% set default cross cross color but update if target time is not
6369
% finished
6470
thisFixation.fixation.color = cfg.fixation.color;
65-
if GetSecs < (onset + targetDuration) && isTarget == 1
71+
if GetSecs < (onset + targetDuration) && isFixationTarget == 1
6672
thisFixation.fixation.color = cfg.fixation.colorTarget;
6773
end
6874

0 commit comments

Comments
 (0)