NeuroPlayPro API reference 1.9.1

1. Intro

NeuroPlayPro software works as a server and is available for HTTP requests and WebSockets connection.

This page provides live data requests - press Run near each command.

HTTP interaction parts are marked with blue outlines.
NeuroPlayPro is available across your local network as HTTP server at "http://127.0.0.1:2336"

WebSockets interaction parts are marked with green outlines.
WebSocket server is available on port "1336"
The server works in two modes:
- JSON (e.g. '{"command":"meditation"}')
- simple text (e.g. "meditation") which corresponds to HTTP commands

All commands are case insensitive (e.g. "RAWDATA", "rawData", "RawData").

NeuroPlayPro server's output will be in JSON format, which will always have "result" and "time", where "result" will be true if the command was performed successfully.
{ "result": true, "time": "2020-10-25 10:20:30" }

2. Device

Data frequency depends on the number of selected channels. For devices with higher amount of supported channels it is possible to select less channels for greater data frequency.

ChannelsFrequencyNames
8 channels125 HzO1, P3, C3, F3, F4, C4, P4, O2
6 channels125 HzO1, T3, Fp1, Fp2, T4, O2
1 channel1000 HzO1



RunStartSearch - Starts device searching procedure

Usage: startSearch or {"command": "startSearch"}
RunStopSearch - Stops device searching procedure

Usage: stopSearch or {"command": "stopSearch"}
Example outputRunListDevices - Get a list of available devices.

Returns

Usage: listDevices or {"command": "listDevices"}
Example outputRunDeviceCount - Returns the amount of found devices during search

Returns

Usage: deviceCount or {"command": "deviceCount"}
RunGetDeviceInfo - Get device information about a single device

Arguments

Returns

Usage: getDeviceInfo or {"command": "getDeviceInfo"}
RunStartDevice - Starts device by serial number (use 'startDevice?SN=XXXX') or by index from 'listdevices' command (use 'startDevice?index=X')

Arguments

Usage: startDevice or {"command": "startDevice"}
Example outputRunCurrentDeviceInfo - Information about current device, e.g. current sampling rate (frequency), channel names and signal quality

Returns

Usage: currentDeviceInfo or {"command": "currentDeviceInfo"}
RunCurrentDevicesInfo - Information about all current devices, e.g. current sampling rate (frequency), channel names and signal quality

Returns

Usage: currentDevicesInfo or {"command": "currentDevicesInfo"}
RunMakeFavorite - Makes selected device favorite

Arguments

Usage: makeFavorite or {"command": "makeFavorite"}
RunGetFavoriteDeviceName - Returns favorite device name

Returns

Usage: getFavoriteDeviceName or {"command": "getFavoriteDeviceName"}
RunSetMontage

Arguments

Usage: setMontage or {"command": "setMontage"}

3. Storage time and 'Data grab mode'

All data comes channel-wise. To get channel names use the "CurrentDeviceInfo" command.Data samples are stored for 'StorageTime' seconds, 10 seconds by default.'Grab...' commands get data and clear the queue, so the next time it is called - it returns only newly added samples.Some commands (e.g. RawData and '...History') require enabled 'Data Grab Mode' in which the software stores data for several seconds. By default this feature is off for memory/processor optimisations.

RunEnableDataGrabMode - Enables grab mode

Usage: enableDataGrabMode or {"command": "enableDataGrabMode"}
RunDisableDataGrabMode - Disables grab mode

Usage: disableDataGrabMode or {"command": "disableDataGrabMode"}
RunSetDataStorageTime - Sets storage time (seconds) for data (including the data for 'DataGrabMode')

Arguments

Usage: setDataStorageTime or {"command": "setDataStorageTime"}
RunGetDataStorageTime - Current storage time (seconds) for data (including the data for 'DataGrabMode')

Returns

Usage: getDataStorageTime or {"command": "getDataStorageTime"}

Filters

Original data from the device is processing by several filters:If a filter value is "0" - it is turned off.

RunGetFilters - Returns filters' values

Returns

Usage: getFilters or {"command": "getFilters"}
RunSetFilters - Sets filter settings

Usage: setFilters or {"command": "setFilters"}
RunSetLPF - Low-pass filter

Arguments

Usage: setLPF or {"command": "setLPF"}
RunSetBSF - Band-stop filter

Arguments

Usage: setBSF or {"command": "setBSF"}
RunSetHPF - High-pass filter

Arguments

Usage: setHPF or {"command": "setHPF"}

Data samples

RunFilteredData - Get channel-wise filtered samples (not more than 'StorageTime' ago) (if the device is on)

Usage: filteredData or {"command": "filteredData"}
RunGrabFilteredData - Grab (clear queue) channel-wise filtered samples (not more than 'StorageTime' ago) (if the device is on and 'DataGrabMode' is enabled)

Usage: grabFilteredData or {"command": "grabFilteredData"}
RunRawData - Grab (clear queue) channel-wise unfiltered device samples (not more than 'StorageTime' ago) (if the device is on)

Usage: rawData or {"command": "rawData"}
RunGrabRawData - Get channel-wise unfiltered device samples (not more than 'StorageTime' ago) (if the device is on and 'DataGrabMode' is enabled)

Usage: grabRawData or {"command": "grabRawData"}
RunAddEDFAnnotation - Adding annotation to EDF

Arguments

Usage: addEDFAnnotation or {"command": "addEDFAnnotation"}

Spectrum

Spectrum is calculated via FFT of the filtered data. The dimension is in uV

RunLastSpectrum - Returns last calculated spectrum in uV

Returns

Usage: lastSpectrum or {"command": "lastSpectrum"}
RunGrabSpectrum - Returns spectrum history and clears the buffer. The buffer contains data not older than 'StorageTime' seconds. Data grab mode should be enabled via 'EnableDataGrabCommand'

Returns

Usage: grabSpectrum or {"command": "grabSpectrum"}
RunGetSpectrum - Returns spectrum history not older than 'StorageTime' seconds. Data grab mode should be enabled via 'EnableDataGrabCommand'

Returns

Usage: getSpectrum or {"command": "getSpectrum"}

Rhythms

By default the software calculated standard rhythms (alpha, beta, delta, gamma, theta) and outputs their respective percentage (of overall spectrum) values.

RunRhythms - Get last 'alpha', 'beta', 'delta', 'gamma', 'theta' and 't' for timestamp for every device channel (if the device is on and metering started)

Returns

Usage: rhythms or {"command": "rhythms"}
RunRhythmsHistory - Get timestamped list of 'alpha', 'beta', 'delta', 'gamma', 'theta' and 't' for timestamp for every device channel (if the device is on and metering started and 'DataGrabMode' is enabled)

Usage: rhythmsHistory or {"command": "rhythmsHistory"}

Recording

The software starts recording filtered data to EDF and other data (rhythms, meditation/concentration) to NPD file (stands for "NeuroPlayData", really just a "CSV")

RunStartRecord - Starts data recording

Arguments

Usage: startRecord or {"command": "startRecord"}
RunStopRecord

Returns

Usage: stopRecord or {"command": "stopRecord"}
RunPauseRecord

Usage: pauseRecord or {"command": "pauseRecord"}
RunContinueRecord

Usage: continueRecord or {"command": "continueRecord"}
RunAddFileToRecord

Usage: addFileToRecord or {"command": "addFileToRecord"}
RunGetUserRecords - Returns user's records

Returns

Usage: getUserRecords or {"command": "getUserRecords"}
RunRecords - Returns records

Returns

Usage: records or {"command": "records"}

4. BCI: meditation, concentration, mental states

Standard BCI modes in NeuroPlayPro are:

Meditation

Percentage of how much the user is relaxed, meditated (high alpha)

Example outputRunMeditation - Get current 'meditation' percentage ('-1' if the device is unavailable)

Returns

Usage: meditation or {"command": "meditation"}
Example outputRunMeditationHistory - Get timestamped list of 'meditation' percentages (if the device is on and metering started and 'DataGrabMode' is enabled)

Usage: meditationHistory or {"command": "meditationHistory"}

Concentration

Percentage of how much the user is focused

Example outputRunConcentration - Get current 'concentration' percentage ('-1' if the device is unavailable)

Returns

Usage: concentration or {"command": "concentration"}
Example outputRunConcentrationHistory - Get timestamped list of 'meditation' percentages (if the device is on and metering started and 'DataGrabMode' is enabled)

Usage: concentrationHistory or {"command": "concentrationHistory"}

Mental states

Discrete brain state recognition (states are recorded for every user and every session separately)

RunMentalStateStatus - Mental state recognition status

Returns

Usage: mentalStateStatus or {"command": "mentalStateStatus"}
RunRecordMentalState - Starts recording a mental state file (10 seconds by default). Stops recognition if need be.

Arguments

Usage: recordMentalState or {"command": "recordMentalState"}
RunEraseMentalState - Stops recognition

Arguments

Usage: eraseMentalState or {"command": "eraseMentalState"}
RunStartMentalStateRecognition - Starts mental state recognition training process

Usage: startMentalStateRecognition or {"command": "startMentalStateRecognition"}
RunStopMentalStateRecognition - Stops recognition

Usage: stopMentalStateRecognition or {"command": "stopMentalStateRecognition"}
RunGetMentalStateFile - Returns a mental state file as is (HTTP only) or encoded in base64 (for WebSockets or if argument 'base64=true' is provided)

Arguments

Usage: getMentalStateFile or {"command": "getMentalStateFile"}

Shorthand

Example outputRunBCI - Get all available control values, by default the 'meditation' and 'concentration' values

Returns

Usage: bci or {"command": "bci"}
RunBCIs - Get all available control values, by default the 'meditation' and 'concentration' values for all nodes

Returns

Usage: bCIs or {"command": "bCIs"}

5. Miscellaneous

Example outputRunHelp - Returns all available commands with their descriptions and arguments

Usage: help or {"command": "help"}
RunVersion - Returns version of NeuroPlayPro software

Returns

Usage: version or {"command": "version"}
Example outputRunControlOptions - Provides information about all proportional and discrete controls available. These values can be fetched by the 'bci' command

Returns

Usage: controlOptions or {"command": "controlOptions"}
RunClose - Closes the applcation

Usage: close or {"command": "close"}
RunAddLogItem - Log the text

Arguments

Usage: addLogItem or {"command": "addLogItem"}
RunScreenInfo

Returns

Usage: screenInfo or {"command": "screenInfo"}
RunGetAllSettings - Get all the settings

Returns

Usage: getAllSettings or {"command": "getAllSettings"}
RunGetSettings - Returns settings for a key

Arguments

Returns

Usage: getSettings or {"command": "getSettings"}
RunSetSettings - Sets the setting value by key

Arguments

Usage: setSettings or {"command": "setSettings"}
РУEN