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#
Java Development Kit (JDK 17+) – Required for compiling and running the application
VS Code or any Java-compatible IDE
jSerialComm (already bundled in the repo)
Arduino IDE - Required to upload firmware into the arduino board
Chords-LSL-Visualizer - for live LSL streaming of data
Hardware Requirements#
To use Chords-Java, you need:
A development board running Chords Arduino Firmware
A USB cable
BioAmp Hardware and accessories (like electrodes)
Setting up the Hardware#
Connect your BioAmp signal chain:
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.
Plug the BioAmp Hardware to the development board (e.g., Arduino UNO R4, ESP32, etc.).
Connect the board to your laptop via USB.
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:
Download the Repository:
Or use Git Bash.
git clone https://github.com/upsidedownlabs/Chords-Java.git
Navigate to project folder:
Open Windows Terminal by
Win + X
and choose Windows Terminal from the menu. Alternatively, pressWin + 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.
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:
Upload firmware with LSL support.
Run the
ChordsLSLStreamer.java
class.Ensure your PC can detect the USB device.
A stream named
Chords_USB_Stream
will appear in your LSL tool when you click onRefresh
.Start the stream and visualize the live data.
Note
LSL streaming is essential for running cross-platform applications and tools.
Applications#
1. Electrocardiography (ECG)#

Displays real-time ECG waveform
2. Electromyography (EMG)#

Visualizes filtered EMG signal and smooth envelope
Detects muscle activity in real time
Supports fine-tuning of RMS window and filtering parameters