Progress on the Brain Computer Interface project. To recap: I picked the Pendant EEG as my device-of-choice. I did not however, purchase the BioEra or BioExplorer packages. Partially because I hate frameworks (more on that later), and mainly because I didn’t want to spend the money. Part of this is just pain ego. I just wanted a raw library from where I could read two-channel data and then pump it into any pipeline I wanted, without an expensive software to do the same thing. (Don’t get me wrong – BioEra is an awesome architecture and especially for home-training sessions, it’s very powerful).
I spend the last three weeks going over options, and couldn’t find the spec (sort of) for capturing raw EEG data. I noticed that, until about 2009, BioEra had an open-source fork called BioEra Light on SourceForge. Turns out this tool claims to read the PendantEEG data. A quick look at their sources and you’ll find the code (best spec), to read this data. It’s a pity this isn’t part of a native library, but now I intend to make it one.
This weekend will be spend in this coding effort. I’m going to try and stick to C as language of choice, since the lib can then be consumed from Java or .Net or whatever (doing the reverse is possible, but breaks my philosophical rant below.) Since such a raw library is asked for many times, it would make sense for me to publish it, but that’s probably going to take a while before I figure out all the agreements and legalities. If it helps, I’ve pointed you to where you can read the code, at a glance it seems extremely simple, elegant and well-written. If others have followed a better approach, I’m always willing to improve.
I did some more hunting around. Turns out, I was wrong in my assumption. Someone else published some BSD-licenced C++ code on Google Code here: http://code.google.com/p/pyofeedback
For completeness, here’s the link to BioEra: http://sourceforge.net/projects/bioera/
Both projects were last updated in 2009, and I’ve made contact with their owners to get any help I can. I don’t want another fork going around the web for the next person to find. I’m considering contributing to/using one of the above.
Philosophical rant about frameworks:
Recently, I’ve acquire an absolute and complete hatred of frameworks.
Two Three things in particular I want to avoid follow in my weekend projects at least.
1. Code must compile exclusively out of the same directory. If it’s outside of that directory, especially one-level up, it’s got to be a transparent binary that I care nothing about. I come across way too much code which has “frameworks” to help write executables. Command-line parsing logic, some kind of usage-printing-helper, etc. They’re not exactly classes you can reference in a library, but the code files aren’t in the folder you’re reading your logic from. Massive waste of time if you just want to add another param and move on.
2 .Must conform to the platform. NO syntax overloads. I love language-features and libraries. All code I read, I want to give you a spec: .Net 2.0 or .Net 3.5 or whatever, and if you read a code-line, it must correspond to something directly interpretable by and semantically accurate to an anthropomorphic being named .Net 3.5. If a sentence begins with “See this looks just like an event in Java, but internally…” it’s booted ruthlessly.
3. Unix-philosophy of specific tools for a focussed purpose. Like the Terminator, if the purpose vanishes, the tool must question its own reason to exist. I don’t want an ls command that has a data-driven manifest, that tells it to load listing-provider-factories, that instantiate listing-providers, which have their own configurations providing the parameters for their initialization, thereby allowing you to list, not only files and directories, but all the galaxies and stars, and streets in NY or the known prime numbers, using just one command. I’ll put in the effort to learn, as ridiculous as it may sound, a brand new command for the oft-necessary purpose of listing all galaxies when I’m browsing a folder tree.