How to create a box with an integer output

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

How to create a box with an integer output

Post by Tristan »

Hi,

I am trying to create a box with an integer as an output, I want to send a score to a Matlab box. However since the only output compatible is a stimulation I don't know how the conversion is done.
I am sending the git link of the .h and the .cpp
https://github.com/TristanVenot/Score.git

Thank you in advance,

Tristan

Thibaut
Posts: 264
Joined: Wed Oct 31, 2018 9:14 am

Re: How to create a box with an integer output

Post by Thibaut »

466/5000
I looked at your code diagonally, You want to send any int by stimulation. I have never tested sending anything, but normally the stimulations are codified (http://openvibe.inria.fr/stimulation-codes/). Between 0 and 31 you have the OVTK_StimulationId_Number_XX. You can put a stimulation listener after your box to see if he agrees by sending a little bit of everything.
On the other hand, the encode header is necessary to do it only once

Code: Select all

m_oOutput0Encoder.encodeHeader();
There is also the possibility to send a (1,1) matrix

Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Re: How to create a box with an integer output

Post by Tristan »

Hi,

Thank you for your answer, sending int with the stimulation is possible, the identifier will just send the number, I think the limit is uint32, after this my memory was overloaded when I tried to send a stimulation this big. However, you cannot send directly negative int (it will give you a gigantic number instead of for example -1). My data were between -10 and 10 so I came up with a simple solution, you do the absolute value of your data and if it is negative you multiply them by a 100, at the reception you just reconfigure by saying if it is superior to 100, you divide them by 100 and put a negative sign. if you check on the gitHub the new version it works fine now.

Best,
Tristan V.

Post Reply