Chords-Java#

Overview#

Chords Java is an open-source Java-based project to acquire, visualize, and stream real-time biopotential signals such as ECG, EMG, EEG, and EOG from BioAmp hardware. Built with JavaFX and supporting LSL (Lab Streaming Layer), it provides a reliable, low-latency interface for research, prototyping, and educational neuroscience.

Features#

Feature

Description

USB Serial Connection

Detects and connects to compatible development boards over USB using jSerialComm. Supports real-time data acquisition without missing samples.

Real-Time Visualization

Displays multi-channel biopotential data with smooth waveform scrolling using JavaFX LineCharts.

Sample Miss Detection

Automatically detects and notifies on packet loss or missing samples using packet counters in the firmware.

LSL Streaming

Streams synchronized multi-channel signals using Lab Streaming Layer (LSL), making it compatible with tools like Chords-LSL-Visualizer, OpenViBE, and Open Ephys

Software Requirements#

Hardware Requirements#

To use Chords-Java, you need:

Setting up the Hardware#

Connect your BioAmp signal chain:

  1. Connect the gel electrodes or dry electrodes according to the type of signal being measured, such as ECG or EMG. For detailed placement guide visit.

  2. Plug the BioAmp Hardware to the development board (e.g., Arduino UNO R4, ESP32, etc.).

  3. Connect the board to your laptop via USB.

  4. Upload the firmware (with correct baud rate and protocol) using Arduino IDE.

Uploading the Firmware#

  • Go to the Chords Arduino Firmware repo.

  • Find your board in the supported boards table.

  • Copy and paste the sketch into the Arduino IDE.

  • Select the correct board and COM port under Tools.

  • Upload the code.

Using Chords-Java#

To launch and run the Java project:

  1. Download the Repository:

    git clone https://github.com/upsidedownlabs/Chords-Java.git
    
  2. Navigate to project folder:

    • Open Windows Terminal by Win + X and choose Windows Terminal from the menu. Alternatively, press Win + S, type Windows Terminal, and press Enter.

    • Use the cd (change directory) command to go to the folder where your project is located. For example:

    cd "C:\Users\YourName\Downloads\Chords-Java"
    

    Replace the example path with the actual path to your project directory.

  3. Compile and Run:

    For Comp - Use the following command to compile the code:

    javac -d bin -cp "lib/*" src/ChordsUSB.java examples/ChordsLSLStreamer.java
    
    • Use the following command to run the code:

    java '-Djna.library.path=lib' -cp "bin;lib/*" ChordsLSLStreamer
    

LSL Streaming#

To stream data into tools like Chords LSL Visualizer:

  1. Upload firmware with LSL support.

  2. Run the ChordsLSLStreamer.java class.

  3. Ensure your PC can detect the USB device.

  4. A stream named Chords_USB_Stream will appear in your LSL tool when you click on Refresh.

  5. Start the stream and visualize the live data.

Note

LSL streaming is essential for running cross-platform applications and tools.

Applications#

1. Electrocardiography (ECG)#

Interface in Light Mode
  • Displays real-time ECG waveform

2. Electromyography (EMG)#

Interface in Light Mode
  • Visualizes filtered EMG signal and smooth envelope

  • Detects muscle activity in real time

  • Supports fine-tuning of RMS window and filtering parameters