-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSoftCodeHandler.m
More file actions
38 lines (33 loc) · 1.39 KB
/
SoftCodeHandler.m
File metadata and controls
38 lines (33 loc) · 1.39 KB
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
function SoftCodeHandler(softCode)
%soft code 11-20 reserved for PulsePal sound delivery
global BpodSystem
if softCode > 10 && softCode < 21 %for auditory clicks
if ~BpodSystem.EmulatorMode
if softCode == 11 %noise on chan 1
ProgramPulsePal(BpodSystem.Data.Custom.PulsePalParamFeedback);
SendCustomPulseTrain(1,cumsum(randi(9,1,601))/10000,(rand(1,601)-.5)*20); % White(?) noise on channel 1+2
SendCustomPulseTrain(2,cumsum(randi(9,1,601))/10000,(rand(1,601)-.5)*20);
TriggerPulsePal(1,2);
ProgramPulsePal(BpodSystem.Data.Custom.PulsePalParamStimulus);
elseif softCode == 12 %beep on chan 2
ProgramPulsePal(BpodSystem.Data.Custom.PulsePalParamFeedback);
SendCustomPulseTrain(2,0:.001:.3,(ones(1,301)*3)); % Beep on channel 1+2
SendCustomPulseTrain(1,0:.001:.3,(ones(1,301)*3));
TriggerPulsePal(1,2);
ProgramPulsePal(BpodSystem.Data.Custom.PulsePalParamStimulus);
end
end
end
if softCode > 20 && softCode < 31 %for auditory freq
if softCode == 21
if BpodSystem.Data.Custom.PsychtoolboxStartup
PsychToolboxSoundServer('Play', 1);
end
end
if softCode == 22
if BpodSystem.Data.Custom.PsychtoolboxStartup
PsychToolboxSoundServer('Stop', 1);
end
end
end
end