Receive an OSC Stream

Receiving an OSC Stream (UDP)

OSC, or Open Sound Protocol, is a protocol that provides typed fields for high frequency streams. It can be used to stream or ingest device EEG data. To receive an OSC stream, you can also use some of the example scripts in the getting started repo.

In order to get around byte-based precision limitations of OSC data types, our data streams all have the following formatted prefix:

  • int: sample ID

  • int: unix timestamp (whole number)

  • float: unix timestamp (decimal)

  • int: LSL timestamp (whole number)

  • float: LSL timestamp (decimal)

Raw Data Stream Topics & Format

​Telemetry (topic: /PetalStream/telemetry):

  • float: battery level

  • float: temperature

  • float: fuel gauge voltage

EEG (topic: /PetalStream/eeg):

  • float: channel 1

  • float: channel 2

  • float: channel 3

  • float: channel 4

  • float: channel 5

Each channel corresponds to the sensors on muse devices:

Ch. 1: 'TP9'

Ch. 2: 'AF7'

Ch. 3: 'AF8'

Ch. 4: 'TP10'

*Ch. 5: 'aux' (Optional and not available on all device versions)

Acceleration and Gyroscope (topics: /PetalStream/acceleration and /PetalStream/gyroscope):

  • float: x

  • float: y

  • float: z

PPG (Experimental, Muse S only, topic: /PetalStream/ppg):

  • float: ambient

  • float: IR

  • float: red

connection_status (/PetalStream/connection_status):

  • int: connected (0 or 1)

Example python snippet for decoding an OSC stream:

def print_petal_stream_handler(unused_addr, *args):
    sample_id = args[0]
    unix_ts = args[1] + args[2]
    lsl_ts = args[3] + args[4]
    data = args[5:]
    print(
        f'sample_id: {sample_id}, unix_ts: {unix_ts}, '
        f'lsl_ts: {lsl_ts}, data: {data}'
    )

Last updated