I have encountered some puzzling interactions between Rush() and code that I
have written to present stimuli that have simultaneous auditory and visual
components. Here is the critical chunk of code that presents the stimulus
after the auditory waveform (beep) and the specifications for the animation
have been generated and loaded into memory.
nframes = length(signal);
evTimes = zeros(1, nframes);
frame = 0; % Pre-allocate storage before Rush
code = {
'Snd(''Play'', beep, audioFreq);'
'SCREEN(w, ''WaitBlanking'');'
'GetSecs(evTimes, 1);'
'SCREEN(''CopyWindow'', lineDraw, w, lineRect, OffsetRect(lineRect,
posSig(1), 600));'
'for frame = 2:nframes;'
'SCREEN(w, ''WaitBlanking'');'
'GetSecs(evTimes, frame);'
'SCREEN(''CopyWindow'', lineErase, w, lineRect,
OffsetRect(lineRect, posSig(frame-1), 600));'
'SCREEN(''CopyWindow'', lineDraw, w, lineRect, OffsetRect(lineRect,
posSig(frame), 600));'
'end'
};
Snd('Close'); % Ensure that Snd is loaded
priorityLevel=MaxPriority(w, 'WaitBlanking', 'SND', 'GetSecs');
% Rush(code, priorityLevel);
Rush(code, 0); % On some machines, this does not work with priority=2
The call to MaxPriority returns 2. However, as the comment on the last line
suggests, on some machines this does not work. Right now, I am sitting at a
PC running Windows 2000, Matlab 6.5 Release 13, and the latest version of
PTB for Windows and the code only works properly if the Rush priority is 0.
If the priority is 2, there is a auditory click at the start and then
silence until the end of the animation at which point the full auditory
signal is played. If the priority is 1, there is again a click at the
start, but now the auditory signal starts playing midway through the visual
animation. However, on an older Windows 98 machine (running the same Matlab
and PTB), the stimulus is presented correctly with priority = 2.
Can anyone provide any insights about what the problem is?
Ted Wright
have written to present stimuli that have simultaneous auditory and visual
components. Here is the critical chunk of code that presents the stimulus
after the auditory waveform (beep) and the specifications for the animation
have been generated and loaded into memory.
nframes = length(signal);
evTimes = zeros(1, nframes);
frame = 0; % Pre-allocate storage before Rush
code = {
'Snd(''Play'', beep, audioFreq);'
'SCREEN(w, ''WaitBlanking'');'
'GetSecs(evTimes, 1);'
'SCREEN(''CopyWindow'', lineDraw, w, lineRect, OffsetRect(lineRect,
posSig(1), 600));'
'for frame = 2:nframes;'
'SCREEN(w, ''WaitBlanking'');'
'GetSecs(evTimes, frame);'
'SCREEN(''CopyWindow'', lineErase, w, lineRect,
OffsetRect(lineRect, posSig(frame-1), 600));'
'SCREEN(''CopyWindow'', lineDraw, w, lineRect, OffsetRect(lineRect,
posSig(frame), 600));'
'end'
};
Snd('Close'); % Ensure that Snd is loaded
priorityLevel=MaxPriority(w, 'WaitBlanking', 'SND', 'GetSecs');
% Rush(code, priorityLevel);
Rush(code, 0); % On some machines, this does not work with priority=2
The call to MaxPriority returns 2. However, as the comment on the last line
suggests, on some machines this does not work. Right now, I am sitting at a
PC running Windows 2000, Matlab 6.5 Release 13, and the latest version of
PTB for Windows and the code only works properly if the Rush priority is 0.
If the priority is 2, there is a auditory click at the start and then
silence until the end of the animation at which point the full auditory
signal is played. If the priority is 1, there is again a click at the
start, but now the auditory signal starts playing midway through the visual
animation. However, on an older Windows 98 machine (running the same Matlab
and PTB), the stimulus is presented correctly with priority = 2.
Can anyone provide any insights about what the problem is?
Ted Wright