keyboard stimulator

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
rsadi002
Posts: 1
Joined: Tue Jul 27, 2021 7:18 pm

keyboard stimulator

Post by rsadi002 »

Hi,

I've exhausted own troubleshooting ideas and would hugely appreciate insights on why I'm experiencing the issue described below. If it helps, I uploaded the relevant openvibe scenario: keyboard stimulator + MATLAB scripting box, and corresponding MATLAB-BOX SCRIPTS on WeTransfer: https://we.tl/t-t7UCui4s7M.

My MATLAB box brings up the window (Psychotoolbox Screen) on monitor #2 with some instructions and the idea is to replace them with a fixation cross after the 'a' key was pressed. I followed MATLAB tutorial #1 (http://openvibe.inria.fr/tutorial-using ... -openvibe/) and I use the default key specs in the shared openvibe file 'simple-keyboard-to-stimulations.txt'. The problem seems to be in line 56 of the MATLAB SCRIPT 'RunExpBlock_process' i.e. in this command: [box_in,starttime,endtime,keypress] = OV_popInputBuffer(box_in,2). The keypress variable is always empty, even when I press all keys on the keyboard one by one.

Here is an extract of the script:
%% keyboard
if box_in.user_data.is_headerset>0

save bo % works ok, MATLAB saves 'bo' (variables in the workspace)

[box_in,starttime,endtime,keypress] = OV_popInputBuffer(box_in,1);
if ~isempty(keypress)

save boo % boo never saved despite regardless of how long I keep pressing 'a' or other keys - the keypress is always empty!

if any(keypress(:,1)==33025)
% want to press 'a' to begin (fixation cross should replace instructions)
Screen('TextSize', box_in.user_data.w, 52);
DrawFormattedText(box_in.user_data.w, '+',...
'center', 'center', BlackIndex(box_in.user_data.w));
Screen('Flip',box_in.user_data.w);

save booo
CRASH % this never happened (because of empty keypress variable)

end
end
end

My experiment runs on Windows 10, Matlab version is 2020, 2 monitors.

Thanks in advance for help!

Renata

Thomas
Posts: 210
Joined: Wed Mar 04, 2020 3:38 pm

Re: keyboard stimulator

Post by Thomas »

Hi Renata,

The WeTransfer link you provided has expired, could you share the data again ?

Without seeing the scripts or scenario, I will only state the obvious: Can you double check that OV_popInputBuffer() is called on the right input index.

Also, the latest versions of OpenViBE were compiled with Matlab 2015b (64bits), so maybe there is something going wrong using Matlab 2020.
Do you have any warnings or error messages in the console ?

Hope this helps a little, and please share the data again so we can have a look at it. :)

Thanks,
Thomas

Post Reply