Recording detailed brain wave data through Python-OSC

banjo
Posts: 17
Joined: Sat Feb 05, 2022 4:10 pm

Re: Recording detailed brain wave data through Python-OSC

Post by banjo »

Great point, appreciating your tips :-) I'll do something alike your proposal. Right now I have separate handlers for the different waves, just to get things going and understand what I'm doing, but I'll probably replace those with one handler (similar to abs_handler), and incorporate more error handling there.
travelmail26
Posts: 16
Joined: Mon Feb 06, 2023 12:52 pm

Re: Recording detailed brain wave data through Python-OSC

Post by travelmail26 »

How can I tell which sensor these values are coming from? Like, If i want the raw or alpha value from AF8, which position is that in the list?
User avatar
James
Site Admin
Posts: 1110
Joined: Wed Jan 02, 2013 9:06 pm

Re: Recording detailed brain wave data through Python-OSC

Post by James »

The order is listed in the data spec here:
https://mind-monitor.com/FAQ.php#oscspec
"TP9, AF7, AF8, TP10 {+AUX on non MU-01 + AUX2 on MS-01|MS-02}"
travelmail26
Posts: 16
Joined: Mon Feb 06, 2023 12:52 pm

Re: Recording detailed brain wave data through Python-OSC

Post by travelmail26 »

Still a little confused (and i appreciate all the help so far!). I'm trying to understand what "args" in the function are. When the dispatch.map() function is called, it triggers 'eeg_handler'.

To see what was going on, I tried to print when each "arg" was called in the 'for arg in arg' loop; what confused me is that often the data in a particular loop comes back empty and not for all values in every loop.

I'd love a bit more detail on what's being streamed each time the band sends data to the app. Does the band send the exact same set of data points (each value for each node) every time it sends data through eeg_handler ?

Maybe i'm doing something wrong.

thanks
User avatar
James
Site Admin
Posts: 1110
Joined: Wed Jan 02, 2013 9:06 pm

Re: Recording detailed brain wave data through Python-OSC

Post by James »

args is the arguments array. The length of which will depend on what was sent. The band sends different arguments for different OSC paths.

dispatcher.map("/muse/eeg", eeg_handler)
This will call eeg_handler for the specific OSC path "/muse/eeg", which will always have the same number of arguments: 4, 5 or 6 depending on your Muse model.

If you want to receive a different OSC path, then you can write a new handler and dispatch it with the same function call e.g.
dispatcher.map("/muse/elements/alpha_absolute", alpha_handler)
Post Reply