My problem is that the I need the code to take care of two processes concurrently:
1. create beeps sounds in different frequency
2. saving subject responses (key board presses)
So far i tried pulling the subject responses using kbcheck,
but kbcheck response is longer then the gap between two beeps....
%%%%%%%%%
while (k <= NumBeeps)
PsychPortAudio('Start', pahandle,1,0,0);
beepList = [beepList (GetSecs - start)];
CycleStart = GetSecs;
while ((GetSecs - CycleStart) < Period)
[keyIsDown,secs,keyCode] = KbCheck;
while ((GetSecs - CycleStart) < Period)
if keyIsDown
RT = [RT (GetSecs - start)];
while KbCheck && ((GetSecs - CycleStart) < Period) ; end %%% this part lasts too long, and each key press recorder more then once....
end
end
end
k = k +1;
end
%%%%%%%%%%%
and even if ill maximize this, i don't thing it is the ideal way of running concordant processes.
I was thinking of using a callback/ interrupt mechanism .
but i cant find a way to create an on screen/ window object.
do you have any idea how can I do that?
Thank you so much