An open source bag of tools for recording and visualizing Bio-potential signals like EEG, ECG, EMG, or EOG.
Project description
Chords - Python
Chords- Python is an open-source bag of tools designed to interface with Micro-controller development boards running Chords Arduino Firmware. Use Upside Down Labs bio-potential amplifiers to read data, visualize it, record data in CSV Files, and stream it via Lab Streaming Layer.
[!NOTE]
Firmware Required for Arduino: Chords Arduino Firmware
Features
- Multiple Protocols: Supports
Wi-Fi,Bluetooth, andSerialcommunication. - LSL Data Streaming: Once the LSL stream starts, any PC on the same Wi-Fi network can access the data using tools like BrainVision LSL Viewer.
- CSV Logging: Save raw data with Counter
- GUI: Live plotting for all channels.
- Applications: EEG/ECG/EMG/EOG-based games and utilities (e.g., Tug of War, Keystroke Emulator).
Installation
-
Make sure you have the latest version of Python installed.
-
Open command prompt and run:
python -m venv venv
venv\Scripts\activate # For Windows
source venv/bin/activate # For MacOS/Linux
pip install chordspy
Usage
Run the command and access the web interface:
chordspy
Web Interface Preview:
Key Options:
- LSL Streaming: Choose a protocol (
Wi-Fi,Bluetooth,Serial). - CSV Logging: Data saved as
ChordsPy_{timestamp}.csv. - Applications: Multiple Applications can be Launch from the Interface simultaneously(e.g.,
EEG Tug of War).
Connection Guide
WIFI Connection
- Upload the NPG-Lite WIFI Code to your device.
- Connect to the device's WIFI network.
- Click the WIFI button in the interface, then select CONNECT.
- Once connected, the button will change to Disconnect, and a pop-up will confirm: "Connected via Wifi!"
Bluetooth Connection
- Ensure Bluetooth is turned ON on your system.
- Upload the Bluetooth code to your device.
- Click the Bluetooth button to scan for available devices.
- Select your device from the list and click Connect.
- Once connected, the button will change to Disconnect, and a pop-up will confirm: "Connected via Bluetooth!"
Serial Connection
- Ensure Bluetooth is OFF and the device is connected via USB.
- Upload the required code to your hardware.
- Click the Serial button, then select Connect.
- Once connected, the button will change to Disconnect, and a pop-up will confirm: "Connected via Serial!"
CSV Logging
To save sensor data for future analysis, follow these steps:
- Start Data Streaming – Begin streaming data via WiFi, Bluetooth, or Serial.
- Start Recording – Click the Start Recording button (it will change to Stop Recording).
- File Saved Automatically – The data is saved as
ChordsPy_{timestamp}.csvin your default folder.
Visualizing CSV Data - You can plot the recorded data using the CSV Plotter tool.
Applications
| Application | Description |
|---|---|
| ECG with Heart Rate | Real-time ECG with BPM calculation. |
| EMG with Envelope | Real-time EMG Visualization with Envelope. |
| EOG with Blinks | Real-time EOG Signal visualization with Blinks marked as Red Dot. |
| EEG with FFT | Real-time EEG Signal visualization with FFT and Brainpower bands. |
| EEG Tug of War Game | 2 Player EEG Based Game |
| EEG Beetle game | Real-time EEG focus based game. |
| EOG Keystroke Emulator | Blink detection triggers spacebar. |
| GUI | Visualize raw data in real-time |
| CSV Plotter | Tool to plot the recorded CSV Files |
Troubleshooting
- Arduino Not Detected: Ensure the Arduino is properly connected and powered. Check the serial port and baud rate settings.
- CSV File Not Created: Ensure you have write permissions in the directory where the script is run.
- LSL Stream Issues: Ensure that the
pylsllibrary is properly installed and configured. Additionally, confirm that Bluetooth is turned off.
How to Contribute
You can add your project to this repo:
- Add a button in apps.yaml to link your application.
- Include your script as a .py file with LSL Data Reception code. (Pull requests welcome!)
Contributors
We are thankful to our awesome contributors, the list below is alphabetically sorted.
The audio file used in game.py is sourced from Pixabay
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chordspy-0.2.0.tar.gz.
File metadata
- Download URL: chordspy-0.2.0.tar.gz
- Upload date:
- Size: 11.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4d69cb0b8102e6818f234668c043f478022118fd91645a25b43730b68ced662
|
|
| MD5 |
70f4b6c7da1185ccf0946f058383f460
|
|
| BLAKE2b-256 |
c9e7d9c256d9d90ab2aef851452bacac88a9fb2e32e2afe92ac2c3730ca0105b
|
Provenance
The following attestation bundles were made for chordspy-0.2.0.tar.gz:
Publisher:
release.yaml on upsidedownlabs/Chords-Python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chordspy-0.2.0.tar.gz -
Subject digest:
a4d69cb0b8102e6818f234668c043f478022118fd91645a25b43730b68ced662 - Sigstore transparency entry: 287871677
- Sigstore integration time:
-
Permalink:
upsidedownlabs/Chords-Python@320090b00c0f7b99c07bd19dc66b1d109e8bc004 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/upsidedownlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@320090b00c0f7b99c07bd19dc66b1d109e8bc004 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chordspy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: chordspy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38c20c64fc7732deb38bc8f523be6821376f0361b9c7938bb29d15cbee817b3c
|
|
| MD5 |
970cde0610d3b6544d31251aa6d6fbf7
|
|
| BLAKE2b-256 |
fea7387e91407b0a11cdf0a2a414450179cdbddebb8c7b4db0211aedcf57346a
|
Provenance
The following attestation bundles were made for chordspy-0.2.0-py3-none-any.whl:
Publisher:
release.yaml on upsidedownlabs/Chords-Python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chordspy-0.2.0-py3-none-any.whl -
Subject digest:
38c20c64fc7732deb38bc8f523be6821376f0361b9c7938bb29d15cbee817b3c - Sigstore transparency entry: 287871713
- Sigstore integration time:
-
Permalink:
upsidedownlabs/Chords-Python@320090b00c0f7b99c07bd19dc66b1d109e8bc004 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/upsidedownlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@320090b00c0f7b99c07bd19dc66b1d109e8bc004 -
Trigger Event:
push
-
Statement type: