IBVA:
Filter:
IBVA-BlueVAS-SuperCollider/Classes (extension) | External Control

IBVA
ExtensionExtension

for communicating with the IBVA EEG brain wave measurement headset

Description

uses the SerialPort to get and parse four channels of data from the brainwave device via bluetooth.

see http://www.kuwatec.co.jp/Products/ibva/

NOTE: does not survive CmdPeriod.

Class Methods

.new

open port and start reading data from the sensor.

Arguments:

port

a String with the name of the serial port. by default this is "/dev/tty.BlueVAS_H-Data"

action

a Function that is evaluated each time new sensor data arrives. the arguments passed in are four 10-bit integers (0-1023). by default this function is set to just post data.

rate

sampling rate in Hertz (an Integer 1-2000). can also be set/get with the methods below.

cutoff

filter cutoff frequency ratio to sampling rate (a Float 0.1 to 1.0). can also be set/get with the methods below.

Instance Methods

.port

the SerialPort object in use.

.action

a Function that is evaluated when sensor data is received. the argument passed in is four Integers between 0 and 1023. by default this function is set to just post the data.

.data

an Array with the last received sensor data. as long as nothing is received this is [-1, -1, -1, -1].

.sr

last read sampling rate.

.fr

last read filter cutoff ratio.

.version

quark version.

.mute

a Boolean that can be get or set.

.getBatteryLevel

send a request to the device for the current battery voltage. calls -blAction when received.

.getDeviceName

send a request to the device for the name of the device. calls -dnAction when received.

.getSamplingRate

send a request to the device for the current sampling rate. calls -srAction when received.

.getFilterCutoff

send a request to the device for the current filter cutoff ratio. calls -frAction when received.

.setSamplingRate

update rate in Hertz (1-2000).

.setFilterCutoff

filter cutoff ratio (0.1-1.0).

.ovAction

a Function that is evaluated when data is lost or overflow. the argument passed in is an Integer. by default this function is set to just post the number of missing samples.

.blAction

a Function that is evaluated when a reply from a -getBatteryLevel method is called (callback). the argument passed in is a Float between 0 and 16 in Volts. by default this function is set to just post the voltage.

.dnAction

a Function that is evaluated when a reply from a -getDeviceName method is called (callback). the argument passed in is a String. by default this function is set to just post the name.

.srAction

a Function that is evaluated when a reply from a -getSamplingRate method is called (callback). the argument passed in is an Integer between 1 and 2000. by default this function is set to just post the sampling rate.

.frAction

a Function that is evaluated when a reply from a -getFilterCutoff method is called (callback). the argument passed in is a Float between 0.1 and 1. by default this function is set to just post the filter cutoff ratio.

.close

stops main loop and closes the serial port.

Examples