-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayStimuli_run2.m
33 lines (22 loc) · 976 Bytes
/
PlayStimuli_run2.m
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
clear sound;
%Loads the noise that will be reproduced the whole run
load Noise_run2.mat;
x = Gated_noiseVector(:);
sound(x,44100);
5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
%Loads the audio to be played
load SparsedRandTonesStimuli_run2.mat;
[rows, cols] = size(TOTAL_MAT_file_reduced);
for cell = 1:rows
WaitingTime = KbTriggerWait(53);
WaitingTime_List{cell} = [cell WaitingTime]; %#ok<SAGROW>
y = TOTAL_MAT_file_reduced(cell,:);
sound(y,44100);
%%function secs = KbTriggerWait(keyCode, deviceNumber)
%%Add a silence. If the fMRI acquires just after the trigger, the
%%stimuli should be done with the silence before the tones.
end
WaitingTime_File = cell2mat(WaitingTime_List);
dlmwrite('SparsedRandTonesStimuli_run2_WaitingTimeList.txt',WaitingTime_File,'delimiter','\t', 'precision', 9);
fprintf('The run is finished.\n');
clear sound;