Accessing and displaying EPOC headset values.

In order to present my rough plan of action i made this sketch explaining two major parts in my project. It consists of two stages, one is [UNDERSTANDING] through experiments and tests how device operates and how reaction feedback differs in different situations and second is [DRAWING CONSCIOUSNESS] based on the stage one:

It is very exciting process to learn about people emotions and neurological responses to different stimulus in empiric fashion using latest technology gadget. But in order to enjoy this fascinating project in its completed form i must structure very systematic and logical steps of production ladder and devote each stage my utmost care and knowledge.

My main challenge is creating a visualising graph and then, in latter stage, build my own visualising tool. These tasks will require lot of programming and overall understanding of the beauty of visualising data. This discipline has been tried and mastered for many decades and creating something original will demand knowledge and unique style.

Firstly i will break down systematic tasks and tools i will be using for the first part:

1) Prepare EPOC headset (charge, connections, testing).
2) Engage subjects and run all TEST PROGRAMME questions with each of them.
3) Run Mind Your OSC software tool to access values.
4) Use Processing or Max/MSP to access values through the specified port.
5) Feed values into Processing software to draw a graph
6) Export image which is a recording of 1min reaction time.
7) Compile data and make a folder for easy evaluation.

I am confident with first 3 tasks which are completed and ready to go. My main and hardest task is creating a graph and making cross communication between Mind Your OSC and Processing or Max/MSP. As i mentioned in previous post i have to ensure all programs run on same computer and are Windows compatible.

Establishing communication.

To begin with I started EPOC Control Panel to ensure all electrodes were green and in positions as well as indicated green, then I started Mind Your OSC application. I could see the values constantly fluctuating. Then i connected Mind Your OSC to the port and opened Processing sketch which would pick up these values streaming:

At this stage i was happy that connection was established and Processing could pick up the incoming messages and filter them. My first task was to unpack messages and get values streaming into Processing. By changing different print modes i was trying to get some numbers coming in but without success:

My main issue was that Processing was not picking up the number value. It was printing “typetag: f”.  Typetag “f” means a float of numbers but my patch was trying to display integer numbers. The difference between float and integer is that float displays a decimal value while integer is a fixed number. To avoid float or integer numbers I tried printing just data, thinking that it might make the situation better but it didn’t. In return I saw very strange data streaming and it seemed that it was not usable:

I believed the solution was somewhere near but my beginner’s programming skills and experience with Processing wasn’t helping me much. I was already giving up on Processing and finding it very difficult to extract the OSC message value using these sketches. My only hope was in Max/MSP and from my previous experiences i felt more confident using it.

My first attempt was creating a simple port reader and examine Max window to see if anything was streaming in:

it was a first time hit and i knew that i was on a right path. I not only got the right messages in but also according numeric values of those messages. My next step was try and unpack these values and direct them into separate streams of number boxes. Here are my first few attempts:

I was obviously doing something wrong. The Max windows was clearly showing that all incoming values were streaming in but i was unable to access and display them using “unpack” object. I did extensive research on Cycling 74 (official Max/MSP website) community forum and found an article which displayed similar problem to mine. The person in question suggested downloading a great library pack for Max/MSP/Jitter developed by people from The UC Berkeley Center for New Music and Audio Technologies (CNMAT). The full package of support tutorials, examples and patches can be downloaded for free from their website. This is a great site and i found it very inspirational and full of great stuff for learning!

I ended up using OSC-Route object and eventually i managed to write a new fully working patch:


Creating a graph.

My initial idea was to create a simple vertical line graph to record the changing values of different OSC message over 60 sec period of time. Here is the sketched idea:

I decided to create this graph in Processing because it was more of a drawing program than Max/MSP and it had more visual styles at hand to experiment with. I started off creating a simple vertical line drawing program and selected thickness of the lines, colour, and distance between them. Here is a small code which generates random length green lines:

The graphics look like this (in reality these lines are constantly changing and it looks like an animation)

Here are some different visual styles i was experimenting with:

I think i would like to go for a very simple and clear design. At this stage of visualising incoming values i don’t need to worry about stylistics or visual aesthetics. The graph has to be easy to understand and overall explicable in order to make a final comparisons and conclusions. I decided that each mood i will dedicate a different colour so it will be easier to differentiate between them as well as easier to do the comparisons across different test subjects and questions.

In all of these graph examples the height of the line was selected randomly. For my particular project i will need to define the height of the line according to the incoming value. But firstly i will try to make Max/MSP communicate with Processing and see if i can manage to send some float values over to the Processing. Here is an example of max patch  :

After routing signal from Mind Your OSC and navigating them into dedicated packets i can direct those values further down to Processing. I am using “udpsend” object for this task. Here is Processing sketch which does receive OSC values sent from Max/MSP:

Here are further development steps and completion steps on Max/MSP patch:

Here is the graph which has been drawn in Processing based on incoming values from Max/MSP. The height of each line is defined by the value showing in blue box. That’s how it looks written in code. The highlighted green area shows how to insert the data values stored into an array and use them to define the length of the bars:

I also want to do the colour matching on Max/MSP value boxes and apply those identical colours on each chart drawn by Processing for better understanding.

Here is the final edit of Max/MSP patch and test with 5 different colour charts.

These tests have been done manually without the EPOC device in action as i already tested the device beforehand and it worked fine. I had to establish flawless communication between Max/MSP and Processing and could do that without EPOC device. I have been adjusting changing values by myself in order to program things faster and without cluttering with saline liquids and firing up two more programs unnecessary. I will need to do the final test when i have eventually installed Windows on my machine so i can do it with everything working at once. Fingers crossed!

So far i am very pleased with the progress and that means that i can finally start my TEST PROGRAMME. The test subjects are confirmed and i will have few days of hectic testing and recording. I have already prepared all of them questions and folder to organise all my resulting data for further analysis. I am little bit behind the schedule but not much, i just will have to do more work in shorter period of time. My goal is to finish all of them tests and analysis by the end of this month and start on the final piece at the beginning of April.

For people who are interested to see the full body code for Processing, please click here .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s