Module: network

Network input/output.

Includes nodes that can read packets from external network destinations or write packets to external network destinations. Nodes for different protocols (e.g., TCP, LSL, OSC) are included.

LSLInput

Receive data from the Lab Streaming Layer.

This node allows you to read a multi-channel stream from LSL (e.g., from an EEG device) in real time. In addition, this node can also read from a second stream that has event markers (for instance, from another application). Important: As of version 1.2, this node now synchronizes LSL stream clocks by default. If the output of this node will be streamed to disk using the Record To XDF node and you wish to retain the ground-truth timestamps then you should disable clock offset correction in this node. Important: Note that the this node does not dejitter the time stamps by default. If you do plotting or event-based processing then you must enable dejittering using the proc_dejitter parameter, or follow this node by a Dejitter Timestamps node to remove the jitter. The Lab Streaming Layer supports many different devices, such as EEG headsets, eye trackers, motion capture devices, audio, video, human-interface devices, and so on. With this node, you can read from any of these in a unified manner. On each tick of the NeuroPype scheduler, this node will output a packet that has all data from the given input stream(s) that came in since the last tick (which may be empty if there is no new data, and which may have a different length on each tick). Correspondingly, this node outputs either one or two streams depending on whether you include a marker stream. See the use_streamnames property for informatino on how these are named. The data stream channel labels will be parsed from the stream metadata. Additional metadata are typically stored in a LSL stream metadata field called desc. That information is parsed and retained in the stream properties' 'desc' field. For more information on LSL, please see the link below.

More Info...

Version 1.5.2

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data received.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • query
    LSL query string that identifies the data stream to search for. The simplest form is type='Modality' where modality can be EEG, Audio, VideoRaw, Gaze, MoCap, Control, or any other type string. The inlet will connect to an LSL stream that has its type field set to this value (and if there are multiple matches, the most recently created one of them will be connected to). If you have multiple devices with the same type on the network (e.g., possibly including playback or other users), it is recommended to make the query less broad by using the stream name, as in name='BioSemi', or starts-with(name,'BioSemi') for any stream starting with a given string (in which case you might also need to specify type='EEG' if there is a marker stream that starts with the same string. (Use Tools/LSL Streams in the Pipeline Designer to show current streams.) It is also possible to include the hostname using the 'and' keyword, as in: type='EEG' and hostname='MyLaptop1'. Other rarely-used fields include channel_count, nominal_srate, and source_id. The syntax is that of an XPath predicate, and supports many other features. If query is empty, no data streams will be found (only a marker stream if specified).

    • verbose name: Query
    • default value: type='EEG'
    • port type: StringPort
    • value type: str (can be None)
  • marker_query
    LSL query string to find a marker stream. If non-empty, this node will try to connect to a marker stream in addition to the data stream, and once connected, the packets returned by this node will have both streams in them. The basic marker query is: type='Markers'. If there are multiple matching streams, the most recently created one of them will be connected to, but you can make it less broad by including the name of your marker stream in the query, as in: type='Markers' and name='SNAP-Markers'. You can also include the hostname if there are other machines with streams with the same name on the network (see help for the 'query' parameter for additional information on advanced syntax).

    • verbose name: Marker Query
    • default value:
    • port type: StringPort
    • value type: str (can be None)
  • localhost_only
    Restricts the query and/or marker query to find streams originating from the local host only. Has the same effect as adding "and hostname='' to the LSL query string and/or marker query string, where is the name of the computer where this node is being run. This is useful in cases where multiple computers on the same network may be emitting a stream matching the query (i.e., same name/type).

    • verbose name: Localhost Only
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • use_streamnames
    Use the LSL stream name to name the stream in the Neuropype Packet. This applies to both the signal stream and the marker stream, if any. The stream name will be converted to lowercase, and spaces will be replaced with underscores, as per Packet stream naming convention. Also, in the unlikely event that the LSL signal and marker stream names are identical, the type will be appended to the stream name, two preserve the uniqueness of stream names in Neuropype (i.e., 'My LSL Stream' (type=EEG) will be named 'my_lsl_stream_eeg'). If False, streams in the Packet will be named after the LSL stream type, i.e., eeg or markers. Default is False for backward compatibility, but may be changed to True in a future release.

    • verbose name: Use Stream Names In Packet
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • max_buflen
    Maximum amount of data to buffer. In seconds. If more data than this remains in flight between the sender and receiver (e.g., because the network cable was unplugged, or your app was paused and stopped picking up data), then you will lose some data samples. In all other cases, the data sent will be delivered in order without omissions.

    • verbose name: Maximum Buffer Length
    • default value: 30
    • port type: IntPort
    • value type: int (can be None)
  • max_chunklen
    Desired chunk length for transmission. In samples. This allows to override the preferred chunk size that the sender should send over the wire (if 0, the sender's preferred chunk size is used). Setting this does not guarantee that the returned packets will have this size, but it can be used as a hint to optimize transmission size, e.g., to tune network latency and overhead.

    • verbose name: Desired Chunk Length
    • default value: 0
    • port type: IntPort
    • value type: int (can be None)
  • max_blocklen
    Maximum packet size emitted by node. This setting allows to return the data buffered in the LSL node in packets no larger than this size (in samples). IMPORTANT: if your pipeline is running at a low tick rate (e.g., 5Hz) and your data source is sending data at a high sampling rate (e.g., 5KHz) then NeuroPype would have to pick up more data per tick in order to keep up with the data stream than this limit. Therefore, if the limit is too small NeuroPype will fall behind the data stream up to the maximum buffer size and then start dropping samples. This value is mostly for internal performance optimization, but can also be used to keep subsequent nodes from stalling when a long packet would be received after a pause (instead, the graph will process the accumulated buffer in smaller chunks and remain responsive).

    • verbose name: Maximum Output Packet Size
    • default value: 1024
    • port type: IntPort
    • value type: int (can be None)
  • recover
    Recover lost streams. Whether to attempt silent recovery of a lost LSL stream. There is usually no need to disable this feature.

    • verbose name: Recover Lost Streams
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • channel_names
    Override channel labels. If a list is provided, the channel labels of the data stream will be overridden accordingly.

    • verbose name: Override Channel Labels
    • default value: []
    • port type: ListPort
    • value type: list (can be None)
  • data_dtype
    Optionally override the returned data type.

    • verbose name: Output Value Type
    • default value: float64
    • port type: EnumPort
    • value type: str (can be None)
  • nominal_rate
    Override sampling rate. If set, the nominal sampling rate of the packets emitted by this node will be set to this value.

    • verbose name: Override Sampling Rate
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)
  • diagnostics
    Enable diagnostics. Can be used to monitor what kinds of data is being received from LSL, for debugging purposes.

    • verbose name: Enable Diagnostics
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • resolve_minimum_time
    Network scanning time to discover duplicate streams. If more than one stream is on the LSL network that matches the given query, this node will connect to the most recently created one of them. In order to ensure that all streams on the network have been discovered and none has been missed, the node will wait for at least this amount of time (in seconds).

    • verbose name: Network Scanning Time
    • default value: 0.5
    • port type: FloatPort
    • value type: float (can be None)
  • proc_clocksync
    Perform automatic clock synchronization; equivalent to manually adding the time_correction() value to the received time stamps.

    • verbose name: Synchronize Clocks
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • proc_dejitter
    Remove jitter from time stamps. This will apply a smoothing algorithm to the received time stamps; the smoothing needs to see a minimum number of samples (30-120 seconds worst-case) until the remaining jitter is consistently below 1ms.

    • verbose name: Dejitter Timestamps
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • proc_monotonize
    Force the time-stamps to be monotonically ascending (only makes sense if timestamps are dejittered).

    • verbose name: Ensure Timestamps Are Non-Decreasing
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • proc_threadsafe
    Post-processing is thread- safe (same inlet can be read from by multiple threads); uses somewhat more CPU.

    • verbose name: Thread-Safe Processing
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • omit_desc
    Omit the stream description field from the output data. Even if the desc is omitted, it may still be used to build the block axes.

    • verbose name: Omit Stream Description (Desc)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • exclude_desc_fields
    List of field names to drop from the desc metadata. Only used when omit_desc is False. 'channels' is a good field to drop because much of its information will already be preserved in the space axis.

    • verbose name: Exclude Desc Fields
    • default value: []
    • port type: ListPort
    • value type: list (can be None)
  • prealloc_buffer
    Preallocate buffer to fetch data and reuse across fetches. This can provide a slight performance improvement.

    • verbose name: Preallocate Buffer
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

LSLOutput

Stream data out via the Lab Streaming Layer.

This node will stream the incoming data out over the LSL network, so that other programs or computers can pick up the data stream. LSL is an easy-to-use way to make time-series data available on the network, and is usable from a wide range of prgramming languages and operating systems. Important: keep in mind that the streams that you are sending to LSL will remain visible until you reset the graph, so when you are using LSL Inlets to acquire data, remember that you may still have streams on the network that are easily confused with real device streams (e.g., when you use broad queries such as type='EEG'). When using this node it is worth noting that, in LSL, all data is a multi-channel time series; if your packets have additional axes, like frequency, feature, and so on, these will be automatically vectorized into a flat list of channels. Also, if you send data with multiple instances into this node, subsequent instances will be concatenated along time, so the data seen by receivers will appear continuous and non-segmented (channels by samples). Check out the below link for more information on LSL. Note that this node outputs a single LSL stream and therefore if the incoming data packet has multiple streams (aka chunks), it will generate an LSL stream for the first stream only. If your data has multiple streams, use ExtractStreams before this node to ensure an LSL stream is created for a specific stream in the data.

More Info...

Version 1.4.3

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to send.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • stream_name
    Name of output data stream on LSL. Data will be published on LSL under this stream name.

    • verbose name: Stream Name
    • default value: OutStream
    • port type: StringPort
    • value type: str (can be None)
  • source_id
    Unique data source identifier. If you assign this, then data receivers will be able to auto-recover your stream if you stop and restart your sender pipeline under the same ID. It is highly recommended to set this.

    • verbose name: Source Id
    • default value:
    • port type: StringPort
    • value type: str (can be None)
  • stream_type
    Type of output data stream. The LSL data stream will have this content-type. For control signals, the content type is usually Control. For raw data, content-types such as EEG, Gaze, Audio, VideoRaw, MoCap, etc. are commonly used. See also LSL documentation on content types for more info.

    • verbose name: Stream Type
    • default value: Control
    • port type: StringPort
    • value type: str (can be None)
  • send_markers
    Send markers. This will open a second output stream on LSL that transmits marker contents (if a marker chunk is present in your data), with content-type Markers.

    • verbose name: Send Markers
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • marker_name
    Name of the marker stream on LSL. Marker data will be published in LSL under this stream name.

    • verbose name: Marker Stream Name
    • default value: OutStream-markers
    • port type: StringPort
    • value type: str (can be None)
  • marker_source_id
    Unique data source identifier. If you assign this, then data receivers will be able to auto-recover your stream if you stop and restart your sender pipeline under the same ID. It is highly recommended to set this.

    • verbose name: Marker Source Id
    • default value:
    • port type: StringPort
    • value type: str (can be None)
  • marker_field
    The name of the field in the instance axis of the markers chunk to use to populate the marker data.

    • verbose name: Marker Field
    • default value: Marker
    • port type: StringPort
    • value type: str (can be None)
  • numeric_marker_precision
    If the marker in marker_field is numeric then its conversion to string will use this many digits after the decimal place. (Tech note: uses numpy.around.)

    • verbose name: Numeric Marker Precision
    • default value: 3
    • port type: IntPort
    • value type: int (can be None)
  • srate
    Override sampling rate. Allows you to override the nominal sampling rate of your stream. Usually the sampling rate will be correct, but e..g, if you collapse the data down to only one sample per tick (e.g., machine learning predictions), your sampling rate will equal NeuroPype's tick rate (25Hz by default).

    • verbose name: Override Sampling Rate
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)
  • chunk_len
    Preferred output chunk length. This is the preferred length of chunks sent over the network, in samples. If set to 0, the same chunk length that goes into the node will be used.

    • verbose name: Preferred Chunk Length
    • default value: 0
    • port type: IntPort
    • value type: int (can be None)
  • max_buffered
    Maximum output buffer length. The maximum amount of data that is buffered for network transmission, in seconds. If your connection is interrupted for longer than this, your receiver will lose some data. However, excessively long buffers provide little value for real-time processing, where it is of no use to receive outdated data (and can hurt if the recipient has to process all these data).

    • verbose name: Max Output Buffer
    • default value: 60
    • port type: IntPort
    • value type: int (can be None)
  • use_numpy_optimization
    Use Numpy optimization in pylsl. You need a version of pylsl that supports this.

    • verbose name: Use Numpy Optimization
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • use_data_timestamps
    Use timestamps in data. This requires that the timestamps originally stem from some LSL clock (e.g., LSLInput node). If False, the data will be timestamped at the time of output.

    • verbose name: Use Data Timestamps
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • reset_if_labels_changed
    Reset the outlet if the channel labels changed. If labels change in rapid succession, this can stall downstream inlets until the changes are complete.

    • verbose name: Reset If Labels Changed
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • ignore_signal_changed
    Do not reset outlet in case of a signal-changed notification. Since resetting the outlet causes a hitch in downstream processing, this option allows not resetting the outlet when details of the preceding graph are changed. Note that this can cause crashes (e.g., if the channel count changes), but it will work in case of only changes to the signal content.

    • verbose name: Ignore Signal Changed
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • numeric_label_precision
    The number of digits after the decimal to preserve when converting numeric axes (e.g . Frequency) to channel labels.

    • verbose name: Numeric Label Precision
    • default value: 1
    • port type: IntPort
    • value type: int (can be None)
  • keep_singleton_axes
    Keep singleton axes in the block when constructing LSL stream metadata including channel names. This parameter does not apply to TimeAxis and InstanceAxis.

    • verbose name: Keep Singleton Axes
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • separator
    Separator character to use when folding together multiple non-time and non-instance axes. For example, setting this to : with 2 space axes will create new channels of the form Fp1:C4, and so on.

    • verbose name: Separator
    • default value: -
    • port type: StringPort
    • value type: str (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

MIDIOutput

Send data stream to a MIDI Output Port.

This node can send MIDI data streams to a device that's specified by name, which typically corresponds to a sound card, or an OS-provided MIDI port, but which can also include ports presented by various software applications (e.g., Loopmidi on Windows). On Linux/MacOS this can also include "virtual" MIDI ports, and the node can create such a named virtual port on demand if one does not yet exist. The node can currently send two kinds of MIDI messages, "note on" messages (equivalent to key presses on a MIDI keyboard), as well as "control change" (cc) messages, which correspond to actions of various other widgets on such keyboard (levers, sliders, buttons, etc.) or other MIDI-compatible devices. It's also possible to have the node automatically send "note off" messages when a note is no longer playing via the note_messages parameter. The node can send data simultaneously over any combination of MIDI channels (1-16), and it can accept data from multiple streams. Marker streams are ignored, but all other numeric data is generally emitted. There are two possible schemes for determining the MIDI channel that some value will go to: either based on the names of the incoming data channels (if a space axis is present), using a mapping dictionary that can be provided, and where multiple channels can go to the same MIDI channel OR based on the name of the stream (if multiple streams are incoming), where a simlar name-to-channel table can be specified. Generally, if a mapping match is found based on channel names, it takes precedence over a stream name match, and if nothing matches (or no rules are given), the data are sent over channel 1 (thus one can group data easily by stream, but have selective per-channel overrides on top of that). If time and/or instance axes are in the data, they are sent ordered by increasing time, but otherwise immediately upon arrival in the node. The type of MIDI message can be controlled as follows: if a feature axis is present, a Control Change message is sent for every data value, using a message type that depends on the respective feature name, where names can be either number strings (corresponding to 0-based MIDI control #'s, e.g., '10' meaning "Pan"), or the name of predefined MIDI control parameter (e.g., "Effect Control 2"), or a substring of a MIDI parameter (e.g., "Legato" for "Legato Footswitch"; note that if there are multiple matches, the one with the lower number will be taken). For convenience, a table of short-hand feature names can also be defined, which allows one to e.g., define that a feature named "feat1" maps to "Portamento"). Otherwise if a frequency axis is present, then a Note On message is sent where the frequency value determines the node after rounding (e.g., 7.1 maps to note 7). Other axis types are not supported by this node at this time. Not all streams need to have the same axes -- e.g., a stream may have a frequency axis (thus sending note on messages) while another stream may have a feature axis (thus sending note off messages). The node has some limited support for alternative backends and drivers (which require the respective Python and OS packages to be installed in the Python/OS environment). For debugging it is useful to enable the log_messages parameter. Note that values are sent at 7-bit resolution unless the support_lsb option is enabled (this applies only to parameters that support 14 bits).

More Info...

Version 0.9.6

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to send.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • port_name
    The name of the MIDI output device, physical or virtual, to stream MIDI events to. If not provided, the first available device is used.

    • verbose name: Midi Output Port
    • default value: None
    • port type: StringPort
    • value type: str (can be None)
  • default_channel
    Default MIDI channel. If there is neither a per-stream override nor a per-channel override, the node will send data to this MIDI channel.

    • verbose name: Default Channel
    • default value: 1
    • port type: IntPort
    • value type: int (can be None)
  • streams_to_channels
    Associate stream names with channels. If provided, each input stream can be mapped onto a given MIDI channel. Wilcard characters are supported, and multiple streams can be mapped onto the same channel. For example, {'eeg*': 3, 'ecg',4} will remap data from any stream starting with 'eeg' to channel 3, and the ECG stream to channel 4. Note that MIDI channel numbering is 1-based (1-16).

    • verbose name: Streams To Channels
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • names_to_channels
    Associate input signal channel names (in a space axis) with MIDI channels. For example, {'mychan': 13'} will map data from each channel named 'mychan' (across any streams) to MIDI channel 13. Wilcard characters are supported (e.g., {'ch*': 16} would map all channels starting with ch to MIDI channel 16. Multiple data channels can be mapped onto the same MIDI channel.

    • verbose name: Names To Channels
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • features_to_controls
    Convenience substitution table from feature names to control code names. See MIDI 1.0 Spec, Control Change Message Types for the options and their official names. Note that you can also directly name your features to match certain control codes, e.g., "Volume". If your name is a substring of one of the control codes (e.g., "Volume" instead of "Channel Volume"), the first matching control code will be used. Lengthy substrings can also be abbreviated with wildchard characters, e.g., "General * 5" will match "General Purpose Controller 5"). This table is mostly useful to define short-hand feature names and/or as a way to swap the control mapping in once place.

    • verbose name: Features To Controls
    • default value: {'gp1': 'General Purpose Controller 1', 'gp2': 'General Purpose Controller 2', 'gp3': 'General Purpose Controller 3', 'gp4': 'General Purpose Controller 4', 'gp5': 'General Purpose Controller 5', 'gp6': 'General Purpose Controller 6', 'gp7': 'General Purpose Controller 7', 'gp8': 'General Purpose Controller 8', 'cc0': 'Bank Select', 'cc1': 'Modulation Wheel or Lever', 'cc2': 'Breath Controller', 'cc3': 'CC03', 'cc4': 'Foot Controller', 'cc5': 'Portamento Time', 'cc6': 'Data Entry', 'cc7': 'Channel Volume', 'sc1': 'Sound Controller 1', 'sc2': 'Sound Controller 2', 'sc3': 'Sound Controller 3', 'sc4': 'Sound Controller 4', 'sc5': 'Sound Controller 5', 'sc6': 'Sound Controller 6', 'sc7': 'Sound Controller 7', 'sc8': 'Sound Controller 8'}
    • port type: DictPort
    • value type: dict (can be None)
  • midi_backend
    MIDI Backend to use. RtMidi is the recommended and more flexible backend, particularly on Windows. PortMidi requires PortMidi to be installed.

    • verbose name: Midi Backend
    • default value: RtMidi
    • port type: EnumPort
    • value type: str (can be None)
  • os_driver
    OS-level driver to use. Currently, the JACK option is only available on Linux and MacOS, and only if rtmidi was installed with JACK support compiled in.

    • verbose name: Os Driver
    • default value: OS Native
    • port type: EnumPort
    • value type: str (can be None)
  • note_messages
    How note messages should be emitted. This is only used if incoming data has a frequency axis that encodes the notes to play. In repeated mode, note_on messages are sent repeatedly for each active note, and in retained mode, a single note_on message is sent whenever the data value changes, and once no more data is incoming, a note_off message is sent. Note that empty packages are currently ignored by this node, so you will not receive note_off messages when you stop sending data into the MIDI ndoe altogether.

    • verbose name: Note Messages
    • default value: repeated
    • port type: EnumPort
    • value type: str (can be None)
  • autoreset_on_close
    Auto-reset on close. This emits reset commands over the port before closing to restore a clean slate in the devices that receive data from NeuroPype.

    • verbose name: Autoreset On Close
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • use_virtual_ports
    If a port name is provided and does not match one of the existing available output ports, an attempt is made to create a virtual MIDI port (not supported on Windows).

    • verbose name: Use Virtual Ports
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • support_lsb
    Support sending LSB values. If enabled, then those parameters that support LSB values (14-bit resolution data) will have them sent.

    • verbose name: Support Sending Lsb Values
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • log_messages
    Enable debug logging of messages sent. Note that this will print the channels as 0-based, i.e., in the range 0-15 since this is a low-level printout.

    • verbose name: Log Messages
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • ignore_signal_changes
    Do not reset the state when a signal changed message is received from upstream nodes.

    • verbose name: Ignore Signal Changes
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

OSCInput

Receive data stream from an inbound OSC connection.

This node receives numeric data as a OSC stream. This node acts as a OSC server and will listen for connections from a remote OSC client.

More Info...

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data received.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • headset
    Headset type to read data from.

    • verbose name: Headset
    • default value: Muse 2
    • port type: EnumPort
    • value type: str (can be None)
  • host
    Hostname or IP on which this receiver is listening for OSC connections.

    • verbose name: Osc Hostname (Udp://:)
    • default value: 0.0.0.0
    • port type: StringPort
    • value type: str (can be None)
  • host_override
    If set, this will override the value stored in host.

    • verbose name: Host Override
    • default value: None
    • port type: StringPort
    • value type: str (can be None)
  • listen_port
    UDP Port on which this receiver is listening to OSC connections.

    • verbose name: Osc Port (Udp://:)
    • default value: 5005
    • port type: IntPort
    • value type: int (can be None)
  • listen_port_override
    If set, this will override the value stored in port.

    • verbose name: Listen Port Override
    • default value: None
    • port type: IntPort
    • value type: int (can be None)
  • message_address
    OSC address to use for inbound OSC messages.

    • verbose name: Message Address
    • default value: None
    • port type: StringPort
    • value type: str (can be None)
  • channel_names
    Override channel labels. If a list is provided, the channel labels of the data stream will be overridden accordingly. This takes precedence over the use_standard_channel_names property.

    • verbose name: Override Channel Labels
    • default value: []
    • port type: ListPort
    • value type: list (can be None)
  • sampling_rate
    Nominal sampling rate of the OSC data stream.

    • verbose name: Sampling Rate
    • default value: None
    • port type: IntPort
    • value type: int (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

OSCOutput

Send data stream to a remote OSC receiver.

This node sends numeric data out as a multi-channel stream, using OSC over a UDP transport. Note that due to the nature of UDP, it is possible to lose data packets. If your packets have additional axes, like frequency, feature, and so on, these will be automatically vectorized into a flat list of channels. Also, if you send data with multiple instances into this node, subsequent instances will be concatenated along time, so the data seen by receivers will appear continuous and non-segmented (channels by samples).

More Info...

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to send.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • destination_host
    Hostname or IP address of the data receiver. Using 127.0.0.1 here will be the local machine.

    • verbose name: Receiver Hostname Or Ip
    • default value: 127.0.0.1
    • port type: StringPort
    • value type: str (can be None)
  • destination_port
    UDP port at which the data receiver is listening for connections.

    • verbose name: Receiver Port
    • default value: 9001
    • port type: IntPort
    • value type: int (can be None)
  • message_address
    Address to use for the messages. This is the OSC address under which messages will be sent.

    • verbose name: Message Address
    • default value: /data
    • port type: StringPort
    • value type: str (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

TCPInput

Receive data stream from inbound TCP connection.

This node receives numeric data as a multi-channel stream in an easy-to-parse text format, with customizable value and sample separators. This node acts as a TCP server and will listen for connections from a remote TCP client.

More Info...

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data received.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • listen_port
    TCP port number on which this receiver is listening for connections.

    • verbose name: Listen Port
    • default value: 57318
    • port type: IntPort
    • value type: int (can be None)
  • channel_separator
    Separating character or string that delimits individual channel values. The output will be a character stream where channel values are separated by this character.

    • verbose name: Channel Separator
    • default value: ,
    • port type: StringPort
    • value type: str (can be None)
  • sample_separator
    Separating character or string that delimits multi-channel samples. The output will be a character stream where channel values are separated by this character.

    • verbose name: Sample Separator
    • default value:

    • port type: StringPort

    • value type: str (can be None)
  • sampling_rate
    Nominal sampling rate of the data stream.

    • verbose name: Sampling Rate
    • default value: 125
    • port type: IntPort
    • value type: int (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

TCPOutput

Output data via TCP.

This node can act either as a TCP client or a TCP server. Supports various kinds of message encodings and encoded content.

More Info...

Version 2.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to send.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • role
    Connection role. If set to client, then this node will actively connect to the given host/port where the other process is expected to be listening. If set to server, then this node will bind on the given port and IP address and listen for incoming connections.

    • verbose name: Client/server Role
    • default value: client
    • port type: EnumPort
    • value type: str (can be None)
  • host
    Hostname or IP address to use. In client mode, this identifies host to which to connect (e.g., 127.0.0.1 for local machine). In server mode, this node will bind on this IP address, which restricts from where incoming connections are accepted (127.0.0.1 restricts to connections from the same machine, and 0.0.0.0 allows incoming connections from anywhere).

    • verbose name: Tcp Hostname/ip
    • default value: 127.0.0.1
    • port type: StringPort
    • value type: str (can be None)
  • portnum
    TCP port to use. In client mode, this will connect to a (possibly remote) service listening on this port. In server mode, this node will itself listen on this port for connections.

    • verbose name: Tcp Port
    • default value: 57318
    • port type: IntPort
    • value type: int (can be None)
  • encoding
    Encoding format to use. CSV is the simplest one but only supports a flat 1d array per message. Lines emits a custom text line and also only supports 1d arrays (sample content). The other formats are fully general. JSON is human-readable, universally supported, and easy to parse, msgpack is binary and quite efficient (also commonly supported), yaml is human-readable and quite commonly supported, and pickle is binary and quite python-specific.

    • verbose name: Message Encoding
    • default value: csv
    • port type: EnumPort
    • value type: str (can be None)
  • content
    Data content to transmit per message. The sample is the simplest one and contains just an array of channel values. Sample+ts includes the time-stamp as the last value. Ndarray is the n-way array for a given block. This only supports a single applicable stream in the data. Block is that plus axis descriptions. Chunk is a block plus meta-data. Packet is a dictionary/mapping of multiple named chunks.

    • verbose name: Content To Send
    • default value: sample
    • port type: EnumPort
    • value type: str (can be None)
  • lines_format
    Format string for the lines content. The typical usage would be to use as many format specifiers as you have channels in your signal. The example is for a single-channel output signal.

    • verbose name: Lines Format
    • default value: %.3f

    • port type: StringPort

    • value type: str (can be None)
  • subset
    Subset of chunks to consider for transmission.

    • verbose name: Stream Subset To Send
    • default value: both
    • port type: EnumPort
    • value type: str (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

WebRequest

Perform a web request and retrieve the response.

This node performs an HTTP request to the given URL, using the specified method and optionally URL parameters. One may specify the request body as a dictionary or a string, and request headers and cookies. The response can be retrieved in the form of the data, status code, text, cookies, and headers outputs. To use basic authentication, one may pass a list of [username, password] to the 'auth' input; for digest authentication, one may instead pass a dictionary with the keys 'type', 'username', and 'password'.

Version 0.5.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Request/response data dictionary.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: dict (can be None)
    • data direction: INOUT
  • text
    Request/response text.

    • verbose name: Text
    • default value: None
    • port type: DataPort
    • value type: str (can be None)
    • data direction: INOUT
  • cookies
    Request/response cookies.

    • verbose name: Cookies
    • default value: None
    • port type: DataPort
    • value type: dict (can be None)
    • data direction: INOUT
  • headers
    Request/response headers.

    • verbose name: Headers
    • default value: None
    • port type: DataPort
    • value type: dict (can be None)
    • data direction: INOUT
  • auth
    Request authentication.

    • verbose name: Auth
    • default value: None
    • port type: DataPort
    • value type: object (can be None)
    • data direction: IN
  • status_code
    Response status code.

    • verbose name: Status Code
    • default value: None
    • port type: DataPort
    • value type: int (can be None)
    • data direction: OUT
  • succeeded
    Whether the request suceeded.

    • verbose name: Succeeded
    • default value: None
    • port type: DataPort
    • value type: bool (can be None)
    • data direction: OUT
  • session
    Optional session object to use for the request.

    • verbose name: Session
    • default value: None
    • port type: DataPort
    • value type: BaseNode (can be None)
    • data direction: IN
  • method
    HTTP method (verb) to use. Typically, GET is used for retrieval, POST for submission, and PUT for replacement of a record. DELETE is used to remove a resource. The other methods are less common and are used for specific purposes.

    • verbose name: Http Verb
    • default value: GET
    • port type: EnumPort
    • value type: str (can be None)
  • uri
    URL to request.

    • verbose name: Url
    • default value: None
    • port type: StringPort
    • value type: str (can be None)
  • url_params
    Optional URL parameters. This can also be wired in as a dictionary, or may be specified as in {'param1': value1, 'param2': value2}.

    • verbose name: Url Parameters
    • default value: None
    • port type: DictPort
    • value type: dict (can be None)
  • timeout
    Request timeout in seconds. This can also be set to None, in which case it will default to infinite (this is, however, not recommended).

    • verbose name: Timeout
    • default value: 15.0
    • port type: FloatPort
    • value type: float (can be None)
  • raise_for_status
    Raise an exception if the request fails. If this is set, the node will block until the request completes or times out. If it is not set, the node will only block when the response is accessed.

    • verbose name: Error On Failure
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • allow_redirects
    Allow redirects.

    • verbose name: Allow Redirects
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • verify_ssl
    Verify SSL certificate.

    • verbose name: Verify Ssl
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • extra_options
    Additional options to pass to the underlying requests function (dictionary).

    • verbose name: Extra Options
    • default value: None
    • port type: DictPort
    • value type: dict (can be None)
  • verbose
    Enable verbose diagnostics output.

    • verbose name: Verbose
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

ZMQInput

Read arbitrary data from a ZeroMQ socket.

This node should not be mistaken for a general-purpose network I/O node. This node is usually followed by a Demultiplex Packets node in order to receive multiple data packets, each of which may have one or more streams. Note: The ZeroMQ socket type is DEALER. The node is designed to operate as the receiver in an exclusive pair topology. Topologies other than exclusive pair are unsupported and will likely produce undefined behavior.

More Info...

Version 1.1.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Output signal.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: object (can be None)
    • data direction: OUT
  • endpoint
    Endpoint on which to bind the ZeroMQ socket to listen for incoming messages to read. This is specified as a unique combination of protocol, host and port. For more information, see the ZeroMQ documentation.

    • verbose name: Endpoint
    • default value: tcp://127.0.0.1:10002
    • port type: StringPort
    • value type: str (can be None)
  • encoding
    Encoding type. Messages read from the bound ZeroMQ socket are decoded based on the value of this setting.

    • verbose name: Encoding
    • default value: pickle
    • port type: EnumPort
    • value type: str (can be None)
  • endpoint_override
    If set, this will override the value stored in endpoint.

    • verbose name: Endpoint Override
    • default value: tcp://*:10002
    • port type: StringPort
    • value type: str (can be None)
  • use_shared_socket
    Use a ZeroMQ socket that can be shared with an instance of the ZMQOutput node.

    • verbose name: Use Shared Socket
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • check_duplicate_messages
    Check for duplicate messages.

    • verbose name: Check Duplicate Messages
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • blocking_read
    Block until data is available. By If False, the node returns an empty packet whenever no data is available on a given update. If set to True, this node will block, which allows to run NeuroPype in lock-step with the data sender.

    • verbose name: Blocking Read
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • timeout
    Socket timeout threshold for receiving data after which None is emitted.

    • verbose name: Timeout
    • default value: 1.0
    • port type: FloatPort
    • value type: float (can be None)
  • verbose
    Verbose output.

    • verbose name: Verbose
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

ZMQOutput

Write arbitrary data to a ZeroMQ socket.

This node should not be mistaken for a general-purpose network I/O node. This node is usually preceded by a Multiplex Packets node in order to send multiple data packets, each of which may have one or more streams. Note: The ZeroMQ socket type is DEALER. The node is designed to operate as the receiver in an exclusive pair topology. Topologies other than exclusive pair are unsupported and will likely produce undefined behavior.

More Info...

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to send.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: object (can be None)
    • data direction: IN
  • endpoint
    Endpoint on which to connect the ZeroMQ socket to write outgoing messages. This is specified as a unique combination of protocol, host and port. For more information, see the ZeroMQ documentation.

    • verbose name: Endpoint
    • default value: tcp://127.0.0.1:10001
    • port type: StringPort
    • value type: str (can be None)
  • encoding
    Encoding type. Messages written to the connected ZeroMQ socket are encoded based on the value of this setting.

    • verbose name: Encoding
    • default value: pickle
    • port type: EnumPort
    • value type: str (can be None)
  • endpoint_override
    If set, this will override the value stored in endpoint. Can optionally contain the placeholder %(CPE_ZMQ_TARGET_HOST)s, which will be substituted with the value of the environment variable of same name, or the default string 'worker'.

    • verbose name: Endpoint Override
    • default value: tcp://%(CPE_ZMQ_TARGET_HOST)s:10001
    • port type: StringPort
    • value type: str (can be None)
  • use_shared_socket
    Use a ZeroMQ socket that can be shared with an instance of the ZMQOutput node.

    • verbose name: Use Shared Socket
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)