BrainBay User Manual
BrainBay User Manual
BrainBay User Manual
Contents:
1. Introduction ................................................................................................................................ 3
1.1 Possible Applications: ...................................................................................................... 4
1.2 Functional features of BrainBay .................................................................................... 4
Rehabilitation Training
muscle- workout and relaxation, posture training
Realtime–Telemetry of Bodysignals
Patient Monitoring
Therapy Progress Control
Online and Offline Data Analysis
Human Computer Interaction, including:
control of mouse-cursor + clicking-functions,
typing via an On-Screen Keyboard,
Brain Computer Interface
Please note that the OpenEEG-hardware is not certified as a medical device, all ap-
plication is done at own risk. Biofeedback should be applied by approved therapists
and works best as part of a wider psychophysical treatment concept.
Archives: contains signal archives in P2/P3/EDF format. These archives are used
by demo configurations and could be used for own experiments. This is the
recommended folder for storing own archive files.
Graphics: contains images for the particle generator or other processing elements
Patterns: contains recorded patterns for the pattern-recognition element (.erp files)
Palettes: contains sample color palettes for display elements (.pal files)
Sounds: contains audio files for the audio-player element (.wav files)
Skindialogs: contains a sample skindialog for user interaction (.ini and .bmp - files)
Edit: copy / paste an element (can be used to paste to another BrainBay instance)
Options: settings for application and currently active eeg amplifier (see 3.1)
The Main Menu’s Options – section offers two dialogs: the Application Settings and
the Device Settings. The Device Settings will only be accessible if an EEG amplifiers
has been added to the Design. The Application Settings offer several important pa-
rameters for system configuration and startup.
The Start Options section has options for application-initialisation: If Load last design
is chosen, the previously used design will be loaded automatically. Load this design
allows to specify a name of a particular design configuration which should be loaded
(the file name is given without the .con extension and may contain a relative path
from the Configurations subfolder). If Autostart is enabled, the session starts after be-
ing loaded. Window minimized results in automatic minimisation of the main window
after a session has been loaded. The Lock session design checkbox allows protec-
tion the design configuration against unintended changes by users: if this option is
enabled, GUI windows can not be re-arranged and the ShowDesign button will be
hidden from the status bar (note that the F5 function key will still work to display the
design, see 3.2).
The Midi-Audio Output section defines the Midi-Devices that will be active within
Brainbay. A Midi-Device could be a soundcard with midi-synthesizer, a wavetable
software synthesizer, or external Midi-devices like keyboards, drum-computers or
midi-controllers. Virtual Midi device drivers like the LoopBe1 freeware cerate virtual
Midi-input and -output devices that provide a bridge to other midi-processing software
running in background.
To add a Midi-Out-Device to the list, select it from the combo-box which contains all
devices that are currently accessible in the system. To delete a device from the list,
just click the list-entry.
In the section Locations of 3rd party tools / SDKs, path settings to additional re-
sources for specific EEG amplifiers can be defined:
The Emotiv Epoc SDK path Setting is only necessary if you want to interface
the Emotiv Epoc device via the (non-free) SDK for accessing Epoc’s raw EEG
data-stream. In this case, specify the correct path to the SDK (where the
edk.dll file is located) so that the emotiv eeg element can be used.
The OpenBCI Ganglion Hub is necessary if you want to use the OpenBCI gan-
glion EEG device. In this case, specify the correct path to the Gangli-
onHub.exe application which provides the raw data from the ganglion. The
GanglionHub is delivered as part of the OpenBCI GUI or can be downloaded
seperately from the OpenBCI github page.
The status bar at the bottom of the main window provides various information (cur-
rent session time, status field) and buttons for session control. The Play and Stop -
buttons or the respective hotkeys F7 and F8 can be used to start and stop the ses-
sion. Reset sets the position of archive files to their beginning and the session time to
0 seconds. The End Button halts a currently running session and loads the design
configuration wich has been specified in the Application Settings dialog (parameter
Load This Design, see 3.1). The Hide/Show Design - button or hotkey F5 controls
visibility of the design-window. The status bar itself can be hidden or displayed by
pressing F6.
If there are archive-file readers present in the design configuration, the status bar ex-
tends automatically and shows the progress of the playback. In- and out points can
be defined for the archive playback which is useful when particular parts of the re-
cording shall be reviewed in more detail (see description of the EEG-amplifier and
EDF-reader elements). The Loop Archive option allows to automatically reset the ar-
chive playback position to the beginning when the end has been reached (endless
playback). The Fly through button processes the archive at maximum speed (this is
useful to review overall session outcomes without having to wait until the real time
playback finishes).
The Color Palette Editor enables to easily create color fades and pallettes for some
display elements. Currently, the color palettes are used by the FFT spectral analyser
and the Particle Animator elements.
To adjust the colors, use left- and right clicks into the color-window to set the update
region: A left-click sets the start and a right click the end point of the current region.
Using the smaller color selection fields or the scrollbars for RGB - composition, the
color value of the start or end point can be set and a color fade from start to end is
calculated. Thus, smaller regions or one big region can be created per just a few
clicks. A palette consist of 127 colors. Existing palettes can be load and modified us-
ing the Import Palette button, new palettes can be saved using Export Palette.
The Tone Scale Editor allows the creation own Tonescales for the midi-player ele-
ment like major, minor, blues etc. Sometimes it can be useful to make small scales
with just two or three tones that fit together.
5. Using Design-Elements
Design-Elements (Signal Sources, Signal Targets and Processing elements) are the
fundamental components for building a signal processing configuration in BrainBay.
Nearly all elements have a graphical user-dialog (configuration window) to adjust
their parameters. The user-dialog can be displayed by right-clicking the center of an
element. In the following, the BrainBay design-elements and their usage will be de-
scribed.
The supported EEG- and Biosignal Amplifiers are available in a subgroup of the Sig-
nal Source Menu. Currently, 14 different devices / protocols are supported:
The following screen shot shows the OpenEEG / Olimex SMT EEG device window:
With the In- and Out- buttons, a segment of the archive can be defined for looped-
playback. By pressing In or Out, the current position will be set as the new start or
end - point for playback. The Go to - button can be used for jumping to a specified
position, given in seconds.
Only one EEG-Amplifier signal source can be active in a given design. Nonetheless it
is possible to have more than one archive players active in the system, using the
EDF-File Reader element. To align the position of an EEG-amplifier archive relatively
to other archives, an offset for the archive in seconds can be set in the user dialog.
When the EEG-Amplifier element receives live-data from an amplifer, the sampling
rate for the whole system is controlled by the output of the EEG-amplifier element.
That means: when the amplifier sends 512 Packets per second, all other elements
will process data at that pace.
When playing back an archive, the sampling rate will be set according to the rate of
this archive, but the rate can be changed using the Options - dialog.
The checkbox enable Input Ports controls the accessibility of frequency- and phase-
settings via input ports. Using the input ports, these settings can be modified by other
elements or by a user dialog.
5.1.3 Constant
5.1.4 EDF-Reader
The EDF-Reader element can be used to read previously recorded file in European
Data Format. EDF is a format for the exchange for biological signals
(see http://www.edfplus.info). The header of an EDF file stores various information
about the recording: date, patient data, recording device, sampling rate, data seg-
ments, signal ranges and descriptions for the data channels.
This information is displayed in the user dialog of the EDF-File Reader element after
a valid file has been opened.
5.1.5 File-Read
The FileRead element allows reading signal channel data from ASCII- text files or
raw binary files. It is the counterpart to the FileWrite element (data recorded via the
FileWrite element can be replayed using the FileRead element)
Using the File Format combo box, the type of storage and the delimiters for rows and
columns can be selected. Available formats are: ASCII-Integer Values (human-
readable text file) Bioexplorer File Format (including a header which makes this file
compatible to the Bioexlorer application) or 1-channel 16 bit raw format (see also
FileWrite element). The archive file read can be started and closed manually via the
dedicated buttons in the configuration dialog.
BrainBay - User Manual page 16 / 50
5.1.6 Key-Capture
The KeyCapture element outputs information about currently pressed keyboard keys.
This can be useful to store triggers in the recording of a biosignal archive (for exam-
ple pressing the spacebar key when starting meditation or deep breathing) – this in-
formation can be added to and EDF file or CSV file recording.
The KeyCapture element offers two modes: “output all keycode values” sends the
keycode of any pressed key (for example 32 for the spacebar key), whereas “detect
one keycode and output custom value” outputs an adjustable value only if a particular
key is pressed – the keycode of the key and the desired value can be given in the re-
spective edit fields. If no key is pressed, the element outputs zero. During a running
session, the keycodes of currently pressed keys can be viewed in the “Act Keycode”
field. Please note that the KeyCapture element only works if the main application
window has the focus (is activated).
5.1.7 TCP-Receive
Similar to the EDF-Reader element, the TCP-Receive element provides EDF channel
data to other elements. The difference is that the data comes from a network
connection and not from a local file. The TCP-Receive element connects to the neu-
roserver software framework by Rudi Cilibrasi which is also part of the OpenEEG pro-
ject (see http://openeeg.sourceforge.net/doc/sw/NeuroServer). To use the TCP-
Receive element, a neuroserver has to be running on a known host in the network or
on the local host. Sending- and receiving clients can connect to this service. Thus,
clients can send / receive live biosignal data and recorded EDF-archives to / from the
neuroserver.
Please take into account that there will be some delay in the transmission, depending
on network bandwidth and other factors like the receive buffer for incoming values.
The button Empty Receive-Buffer discards packets that are currently buffered
The Camera element can be used to process a video stream from a local camera
(usually a webcam) and perform face- and movement-detection. For image- pro-
cessing, the Intel Open Computer Vision library was used. (OpenCV, see
http://www.intel.com/research/mrl/research/opencv )
In particular, three tasks can be performed by the Camera element:
Feature Tracking
If the switchbutton 'enable tracking' is checked, the element will perform a Haar-
Cascade detection of a frontal human face on the videostream from camera or video
archive file. When a face has been found, the nose and chin positions are estimated
and followed by an optical flow algorithm. The coordinates of nose an chin relative to
the last image are sent to the element's output port. After appropriate filter- and
resize-operations, these coordinates can be used by the Mouse-Controller element to
perform mouse movement and clicking operations (for details see the Camera-Mouse
example design)
The Skindialog Element provides a custom draw, skinned user dialog to the design.
Buttons and sliders with mouse-sensitive areas can be defined using and .ini -file and
bitmap graphics. The current values of the sliders or button states are presented at
the element's output port. Thus, special dialog can be draw to support users in the
access or key features of a complicated design.
The Skindialog object is currently in beta-stage, a more comfortable editor will be de-
veloped that allows online-adjustment of the dialog without editing the .ini file.
As the signal source elements deliver biological data, simulated waveforms and other
signals, the processing elements to perform signal adjustments, transformations, ap-
ply thresholds or combine singnals in order to get the desired parameters for the bio-
feedback and training processes. BrainBay currently has 19 signal processing ele-
ments which will be introduced in the following.
The Averager element puts out the mathematical average of the last n samples. The
number of samples can be selected by the Interval scroll bar.
5.2.2 Comparator
This element compares it's two input values in a way given by the user.
When the selected condition is fulfilled, the value of input A is routed to the elements
output port. If not, the output of the element will be INVALID_VALUE (this is a repre-
sentation of boolean false). In case one of the inputs is INVALID_VALUE, the output
of the element will be INVALID_VALUE as well.
5.2.3 Correlation
This element calculates the cross-correlation between the two signals connected to
input 1 and input 2 in a selectable Interval of samples. Correlation is a measurement
for the linear relationship between the two signals. The output will be between 1 (fully
correllated) 0 (uncorrelated) and -1 (fully inverse correlated).
Depending on the selected type, the Counter element is used to count transitions
from or to INVALID_VALUE, measure frequency of true-false transistions (in Hz) or
show the plain input value without counting. The value of the counter is presented at
it's output port, and, if desired, in a seperate window as an integer of float value. The
counter can be set to an initial value by pressing Reset Counter Value. This reset of
the value will also be done when the session is resetted using the status bar. Colors
of text and background and font size can be selected in the Display- section.
5.2.5 Debounce
The ERP-Detect element can record and detect signal patterns in time domain. It can
be used to perform trial averaging, what is a popular technique for extracting event
related potentials (ERPs) from a noisy EEG signal. The Epoch-length of the trials, the
pre-trigger interval and the number of trials can be written into the input fields. The
display range is obtained from the signal input port. Adjust this range by right-clicking
the input port.
The button Start recording activates the recording- and averaging-mode of the ele-
ment. In this mode, the element waits for a TRUE value on it's trigger input port. This
trigger singnal could come from a threshold - element, from an external switch-button
or from a signal generator etc. After the trigger signal has been received, epoch-
length samples are recorded and added to the internal buffer of the element. Then
the next trigger input is awaited and the next trial is recorded. After a number of trials,
the noise gets less due to the averaging process and the exctracted signal remains.
This signal can be saved to an .erp file.
When the ERP-Detect element is not in it's recording state, it's continuously calcu-
lates the linear difference between the recorded signal and the last epoch length
samples that came into it's singal input-port. The output-port presents the similarity
with the recorded signal in percent (0-100).
The Expression Evaluator can have up to six input ports, which automatically extend
when a signal is connected. The input signals are referred to as A, B, C, D, E, F and
can be combined with decimal constants, elementary functions, unary and binary op-
erations to a mathematical expression that is evaluated when the session is running.
exponential (exp), logarithmic (log), square root (sqrt), sine (sin), cosine (cos),
tangent (tan), cotangent (cot), secant (sec), cosecant (csc),
inverse sine (asin), inverse cosine (acos), inverse tangent (atan), inverse co-
tangent (acot), inverse secant (asec), inverse cosecant (acsc),
hyperbolic sine (sinh), cosine (cosh), hyperbolic tangent (tanh), hyperbolic co-
tangent (coth), hyperbolic secant (sech), hyperbolic cosecant (csch), hyperbol-
ic inverse sine (asinh), hyperbolic inverse cosine (acosh), hyperbolic inverse
tangent (atanh), hyperbolic inverse cotangent (acoth), hyperbolic inverse se-
cant (asech), hyperbolic inverse cosecant (acsch),
absolute value (abs), Heaviside step function (step) with value 1 defined
supported unary operation is unary minus ('-').
supported binary operations are:
o addition ('+'), subtraction ('+'), multiplication ('*'),
o division multiplication ('/') and exponentiation ('^').
5.2.8 Filter
The Filter element provides digital low-pass, high-pass, band-pass or band-stop fil-
ters. A low pass filter will filter out high frequencies and let low frequencies pass the
filter. A high pass filter does the opposite - it will filter out low frequencies and let high
frequencies pass. A band pass filter will filter out lower and higher frequencies and let
middle frequencies pass the filter. A band stop filter will filter out the middle frequen-
cies and let lower and higher frequencies pass the filter.
The filter can have bessel- or butterworth - type. The bessel-filter has a slower roll-off
in frequency domain (meaning it is less precise in attenuating around it's corner fre-
quencies) but does not have so much ringing (overshoouting) in time domain.
The Filter Type, Filter Order and the frequency - limits for the filer can be selected in
the user dialog. A higher filter order gives a sharper response in frequency domain
but a longer delay in time domain. When the button Apply is pressed, the filter re-
sponse in frequency domain is shown in the given display range. The display range
can be adjusted be typing new values in the bottom left and bottom right fields.
The FFT element performs a fast fourier transformation on the connected signal. This
shows the frequency components that are present in the signal, just like the ear can
detect the different tone-heights that are present in a sound. Using the FFT -element,
the changing frequency-components of for example brainwaves can be displayed as
a bar-graph, spectogram or 3d- landscape. The kind of display can be changed using
the Style combo-box.
The Calc-Interval sets the number of samples that are buffered before the next trans-
formation is done. An interval of 25 samples gives about 10 transformations per sec-
ond at 256 Hz sampling rate.
The number of Bins defines the distinct frequency components (= bands). Many bins
give good frequency resolution but slow reaction in time. Range selects the bands to
be displayed (in Hz). Align (left, right, bottom) rotates the display.
BrainBay - User Manual page 25 / 50
A color palette can be used to map the intensity information to colors, what is neces-
sary in the 2d and 3d - views (for usage of the color palettes see palette editor).
The FFT-element has two output ports: Average and Power. The first gives the aver-
age freuquency of the bands in the selected range, the second gives the average
power (magnitude) of the bands in the selected range.
5.2.10 Integrator
The Integrator element continuously sums the incoming values. Pressing Reset sets
the buffer to zero, this is also done when starting or resetting the session.
The logical And, Or and Not elements do not have user dialogs. They perform the
logical operations on the inputs and output the result.
The Matlab - element can be used to transfer sample buffers to the Matlab applica-
tion for further processing (see http://www.mathworks.com). Matlab is commonly
used in academic and scientific signal processing. As this is a commercial applica-
tion, the needed .dlls cannot be delivered with brainbay, and the Matlab-element will
only work if you have a licenced version of matlab on your system.
The element can process up to six input ports named A, B, C, ...
During operation, the input values will be collected in buffers of given size. By press-
ing Call Now, the buffers are transferred to Matlab and can be accessed via the
Matlab-variables A, B, C ... and a Matlab-function of given name will be called. The
result (the ANS-variable) will be transferred back to BrainBay and presented on the
output of the Matlab-element.
When Call Periodic is selected, the transfer will be done automatically when a new
sample arrives, this will only work for matlab-functions with low complexity / short ex-
ecution time. (Please note that this element is probably outdated, it’s correct opera-
tion needs to be verified with current versions of Matlab).
5.2.13 Magnitude
The Magnitude - element can be used to calculate the activity in a certain frequency -
range of a singal. This is oftern referred to as 'power in pass-band'. The filter type the
is selected via combox-box can be Bessel-Bandpass or Butterworth-Bandpass. (for
more details on filters see the Filter - element or Jim Peter's FiView - application,
http://uazu.net/fiview). The Center (Hz) and Half Width (Hz) - parameters adjust the
pass-band, where activity shall be measured. Example: when you want to measure
Alpha-frequencies of brainwaves in the range from 10 to 12 Hz, select a center of 11
Hz and a half width of 1 Hz for the filter. The filter order controls the 'sharpness' of the
5.2.14 Mixer
The Mixer - element can be used to merge up to four input signals into one output
signal. The amplification-ratios are given with the corresponding silder-bars. Using
the buttons Chn1 - Chn4, presets for solo-output of the selected channel are activat-
ed.
The Sample-Hold - element stores the current input-value when the button Sample is
pressed. This value will be present at the output-port until another value is stored us-
ing the button.
This Element calculates standard deviation and mean of n samples and puts the re-
sults to the ouput ports. The number of samples for the calculation interval can be set
using the slider bar.
Setup of fixed upper- und lower bounds for the signal (thresholds)
If the values are not in the specified range, the elements outputs
INVALID_VALUE, otherwise the signal will be passed to the output port.
Calculating a baseline value for the threshold after the session starts
The minimum and maximum values of the slider-bars for threshold selection are ob-
tained from the connected input signal. This range can be adjusted by right-clicking
the input port. Dynamic calculation of thresholds will be performed if non-zero values
are entered for upper limit or lower limit: The new threshold values will be set so that
a part of the last Interval values would have passed (either the average or the medi-
an can be used for this calculation).
If rising- or falling values is selected, only progressive or regressive values will pass
the threshold. In the Meter Window - section, font size, bar size, colors and caption
for the meter display can be selected.
The Meter Window section allows various color and style adjustements of the meter
window. If desired, the meter window could also be hidden. When the meter window
is displayed and has the input focus during a running session, users can adjust the
given upper threshold by pressing the cursor-up or cursor-down keys on the key-
board – thus, the threshold level can be easily adjusted on-the-fly.
The Threshold element is a useful tool for feedback-purposes, where the reaching a
certain state (high activity or low activity) is desired. Combined with a Midi - element,
feedback tones can be generated if a desired level is reached.
The AVI-Player element can be used to display and navigate avi-movies. The value
that comes into the input-port of the element is interpreted as frame number. This
frame will be shown in a seperate display window. Using rising or falling values, the
movie can be watched forward or backwards. The sound of the AVI-movie will not be
present at playback (use the Media Player element to include sound output). A video-
codec that can decode the given avi-file has to be installed on the system to use the
AVI-Player element.
Please note that the MediaPlayer element is also available which provides other /
additional features and supports different media file formats.
The COM-Writer element can be used to send command and data values to a con-
nected Monolith-EEG amplifier in bidirectional mode (using P21 firmware protocol) .
Using the Com-Writer, runtime options of the MonolithEEG like baud- or sampling
rate can be changed and the digital I/O- ports of the MonolithEEG can be set. One
command/data frame consist of three bytes that can be defined using the input fields
of the user dialog. The frame is sent by pressing the button. When triggered sending
is enabled by the user option, the frame will be sent every time an input different
from INVALID_VALUE is received by the trigger input-port.
The EDF-File Writer element can be used to created a biosignal archive in European
Data Format (see http://www.edfplus.info). The header of an EDF file stores various
information about the recording: date, patient data, recording device, sampling rate,
data segments, signal ranges and descriptions for the data channels. This infor-
mation can be set using the data fields of the user dialog.
The description for the connected channels can be set using the Channel combo-box
and the corresponding data fields. When all channels have been connected and la-
belled, the button Create File can be used to choose location and file name for the
EDF file to be created.
The recording of channel data can be controlled by the buttons Start Recording and
Stop Recording. After recording, don't forget to press Close File to finish the writing
process and close the file.
The File-Write element can be used to generate an archive file with channel values,
which allows processing of the data in other applications. The File-Read element can
be used to read the channel values from this archive file – usually this will be done in
another design configuration.
Using the File Format combo box, the type of storage and the delimiters for rows and
columns can be selected. When using ASCII-Integer Values, a human-readable text
file will be generated. If more than one channel is connected to the element, the
channel values will be written as columns with commas (CSV- text file) or TABs as
column seperators. As delimiters for the rows, CR/LF - delimiters can be generated.
These text files could be imported in Microsoft Excel or other applications for display
and further processing. Further available file formats are Bioexplorer File Format (in-
cluding a header which makes this file compatible to the Bioexlorer application) or 1-
channel 16 bit raw format, a one-channel binary file that could be imported in a
sound-processing application which supports .wav format (note that in this case only
one channel will be processed).
5.3.5 Oscilloscope
The Oscilloscope element is essential for the display and inspection of one or multi-
ple signals. The connected signals are shown in a seperate window which can be
freely resized. During runtime, a data grid showing the signal ranges and the current
time can be displayed. The Drawing-Interval silder sets the display granularity for the
oscilloscope: a selection of 1 will display every incoming value, a selection of 4 will
display every forth value etc. The Display-Gain slider is used to amplify / attenuate all
connected signals. The gain and drawing-interval settings can also be changed dur-
ing session runtime by using the cursor keys if the oscilloscope window is selected
(up/down for gain, left/right for interval).
If the group option is used, the connected signals will be shown in the same data grid
(in this case, the signal range of the first connected channel is used for all connected
signals). The settings show grid, show mid line, clip to grid and gradual replacement
determine if a grid is used, when the vertical bars for time periods are inserted, how
the signal traces are draw and if they are allowed to exceed their dedicated charts.
In section Drawing styles and colors, background color and individual signal colors
(per channel) are adjusted using the color-picker-buttons and the signal trace width
can be adjusted.
The section Save snapshot / report graphs provides allows storing the oscilloscope
traces before they get removed: if activate bitmap save is enabled, a snapshot is tak-
en of the oscilloscope window and saved under the given filename in the subfolder
/Reports (.bmp will be added automatically). Optionally, date and time can be added
to the filename to avoid overwriting the bitmap file.
The Particle Animation element provides a graphical particle system that can be con-
trolled using signal values from up to six input ports. The particle system can produce
nice visual effects like color fountains, flames, star-flights or, in combination with sig-
nal generators, moving circles and other geometric figures in 3d. The System can be
influenced by changing the current parameter using the Range silder-bar.
The Midi element provides Midi-Audio feedback for the connected signal. Toneheight
and volume are controlled by the connected input ports. The signal range of the con-
nected input signals is mapped to the selected volume range or tone scale (note that
the range can be modified by right-clicking the input ports).
The Output Interval sets the frequency of tone generation: an interval of 1 will gener-
ate a midi tone every time a new value arrives (this is usually much too fast).
A setting of 25 gives about 10 tones per second when a sampling rate of 256 is used,
which is still very accurate. The interval can be directly set via the dedicated input
port as well.
The pitch input port allows adjusting the pitchwheel setting according to the incoming
value and its range. The maximum span for pitch and volume can be defined via the
settings Pitch Range and Volume Range respectively.
For Output Device, a desired Midi-Output device can be selected (please note that
this device must be enabled in the Options Menu before).
Using Channel 1 - 16 allows multiple midi-elements with different instruments to work
in parallel (while channel 10 usually selects the Drum-Set).
The Hold buffer sets the number of tones that will be left on at the same time.
When play only changes is selected, two consecutive notes will only be played if they
are different.
The Mouse Controller element provides an interface to the mouse-cursor and clicking
functionalities. The current screen-resolution should be set as maximum X- and Y-
positions for the cursor. During session runtime, the present values at the xPos- and
yPos- input ports will influence the cursor position. If the x-Integrator and y-Integrator
options are selected, the input values are interpreted as relative changes (Joystick
mode), if not, absolute positions will be used.
A left click will be performed when a value other that INVALID_VALUE is passed to
the l-Clk input port. Right-clicks and drag-clicks can be performed in the same way,
using the r-Clk and drag input ports.
The option activate Click-Selector displays a seperate tool-window which allows se-
lection of right-, double- or drag-clicks without using the corresponding input port.
Thus, a right-, double- or drag-click can be performed by choosing the type of the
next click in the click-selector window, and the special click can be performed with
the normal left-click action. The Dwell-Time can be used to perform a left-click opera-
tion by holding the mouse cursor in a given screen-area for a given time. Thus, click-
ing can be performed without having a seperate control signal connected to the l-Clk
port.
A useful source for the Mouse Controller could be the Camera element (feature
tracking enabled). After some filtering and scaling, the estimated face positions that
are put out by the Camera element set the cursor position for the mouse and give a
functional head-mouse interface (see design examples).
The Sound-Player element can be used for triggered playback of a short audio-file.
Supported file formats include wav, mp3, voc and aiff. The file could contain sound
effects or reward tones of about 1 to 20 seconds length. The element is not suited for
longer music files because of long loading / conversion times (use the Media Player
element for longer files). The input-ports control starting of the sound (on), the current
volume (vol) and the playback speed / toneheight (speed). The sound will be played
when the on input is different from INVALID_VALUE. If the option play only changes
is selected, the sound will be played only once if the value of the on input-port does
not change. The Repeat Interval can be used to select a minimum duration until the
sound is triggered next time, thus a pause can be introduced.
The Sample Buffer Size sets the size for the internal playback buffer, this value af-
fects the audio latency / system performance. Using values < 4096 is recommended
for accurate playback.
The ranges for volume (Input-Range) and speed (Center and Factor) are obtained
from the connected input signals and can be set manually by changing the values in
the user dialog. The reverse option changes speedup or slowdown of the sound
when the speed input values rise. The Center - value sets the value for playback at
original speed and the Factor - value sets the gain for speed-changes.
The TCP-Sender element can be used to transfer signal channels via network, using
the neuroserver software by Rudi Cilibrasi. To establish connection, a neuroserver
has to be running on a known host computer in the network or on the local host. (see
http://openeeg.sourceforge.net/doc/sw/NeuroServer).
The TCP-Sender element then connects to this service as a client which sends bi-
osignal data in EDF-format.
Start Sending and Stop are used to contol the data flow to the neuroserver. The but-
ton Send to neuroserver directly sends a neuroserver command written in the text
field to a connected service. Use Close to disconnect from the service.
The media player element uses the Windows MCI interface to playback video or
sound-files. AVI, WMV, WAV, MP3 and other formats could be used. After a media-
file has been selected, it is played by receiving a value different from INVALID_Value
at it's play input port. Volume and playback speed can be adjusted by the Vol and
speed ports, where a value of 1000 sets full value or normal speed. Update Intervals
for vol and speed have to be set according to system performance because these
functions are time-consuming. Inputs into the step port cause a video file to step one
frame forward.
5.4.1 Documentation
The Documentation element simply provides a text box. It can be useful to describe
the overall purpose of the design, special design elements or archive files that have
been recorded with this design.
5.4.2 Ballgame
The Button element allows placement of a desired icon or symbol inside the main
application window, and to select a function which shall be executed when this icon is
clicked during a running session. The default file path is set to the /GRAPHICS sub-
folder. Alternatively, a relative filepath to other locations can be given. The file type of
the graphics file must be Bitmap (.bmp, 24bit color). The functions for the button can
be selected via a dropdown combo box. Supported functions for the button are:
5.4.4 Speller
The Speller element provides an experimental user interface for step-by-step selec-
tion of letters (e.g. via EMG muscle activity, eye blinks, IMU-accelerometer values
etc.) for the purpose of writing and/or using a speech synthesizer.
5.4.5 Sessiontime
The Sessiontime element allows definition of the session duration in seconds. De-
pending on the selected options, the session can either be stopped, or a desired con-
figuration design file can be loaded. If the countdown to zero option is activated, the
element will output the remaining seconds (e.g. in order to display this value using a
counter/display element). If the load next configuration option is selected, another
design configuration will be automatically loaded when the sesiontime is reached. Per
default, design configuration files are expected in the Configurations subfolder. A
possible use case for this parameter is to switch back to a menu which is displayed
using the SessionManager element.
By sending values to the stop input port of the element which are different from
INVALID_VALUE, a running session can be stopped.
Optionally, a collection of oscilloscope report graphs which have been saved in pre-
vious sessions can be displayed. The next/previous report graph for the highlighted
design can be shown by pressing the cursor keys (left/right) or by using the naviga-
tion cross.
The menu entries are composed in a listbox which holds one line per menu entry:
Every line consists of 2 or 3 string items separated by a # character. The first string
item represents the title of the menu entry which will be displayed in the Session-
Manger GUI (the session title). The second string item defines the name of the de-
sign configuration file which shall be loaded upon selection of the menu entry (given
as relative path to the /Configurations subflder). The (optional) third string item speci-
fies the name of the report graph files for this design configuration - see description of
the oscilloscope element. It is expected that the oscilloscope element which gener-
ates the report graphs is configured to automatically add date and time to the file-
names (to prevent overwriting previous report graphs). The extension .bmp is auto-
matically added to the given report graph file name, the files are expected in the sub-
folder /Reports. If .bmp files are found, they will be displayed in the lower third of the
SessionManager GUI.
The menu can be further customized in terms of font size, font color, highlighting col-
or and background color and the report bitmaps can be resized to a given percentage
of the original.
On the next page, an example of a customized menu including session report graphs
can be seen.
the Style parameter of the FFT-element was changed from bar-graph to 3d line-grid
The following extracts the heartrate from a 17-channel multimodal biosignal recording
stored in an EDF-file. ECG and frequency-spectra of the contraction of the heart
muscle are displayed. For calculating the heartrate, a dynamic threshold level is ap-
plied. Acoustic feedback for the heartbeat is created by three midi-generators.
For audio feedback, three midi-generators with the same type of harmonic tone-scale
were used. As the detected peak of the R-wave can be very short, a fast tone output-
interval is needed to recognize each heartbeat. Therefore, the output-intervals for
the midi-elements were set to 1, 2 and 3, which corresponds to 100, 50 and 33 tones
per second. (the sampling rate for this EDF-recording is 100Hz). The different inter-
vals for tone-generation lead to sightly different notes which fit together because of
the harmonic scale.
The following design can be used to perform muscle feedback for training and re-
habilitation purposes. The example recording was done with a MonolithEEG amplifier
running in P21-bidirectional mode and at 600 Hz sampling frequency. The amplifi-
cation has been set to a low level, corresponding to high muscle potentials of about
500 uV. Muscle activity could be mesured using standard BlueSensor EMG surface-
electrodes attached to the left and right tigh. Four electrodes used in bipolar mode
give a two-channel setting.
The following design illustrates how to use an external switch to control the frame-
rate of a movie-playback. As an application of this design, a bicycle home-trainer
could easily be turned into a multimedia recreation device: A magnet mounted on the
turning wheel closes a reed-switch when passing; the design transforms the switch-
ing information to a desired playback speed of the movie.
Above figures show the reed-switch & magnet and mounting of the switch on the
home trainer. The switch is connected to a digital input port of the ModularEEG (4 in-
put ports are reseverd for buttons/switches). The switch state is present at the B1-B4
- output port of the EEG amplifier element.
In the design, the b1-b4 output is compared with a constant value (in this case, but-
ton 2 has been connected and value 11 indicates a switching of the reed contact).
The debouce-element prevents double- or triple-impulses when the magnet passes.
The first counter measures the frequency of the switching pulse. It's output controls
the frequency of a signal generator. Thus, the switching speed of about 1-4 Hz com-
ing from the wheel/magnet is transformed into a frame pulse for the movie of about 5-
30 frames per second. The current frame number is calculated by the second counter
element and fed into the avi player element.
This design example shows how to use the camera-element to control the mouse
cursor and perform clicking- actions by head movements. With the option feature-
tracking enabled, the camera - element tries to detect the user's face and extract two
positions: