Skip to main content

Ability logomark
EMG-GUI
Python versions PyPI version Monthly PyPI downloads Total PyPI downloads GitHub release downloads

Real-time acquisition and visualization of OpenBCI EMG signals with Python.

EMG-GUI is a multithreaded Python package built with BrainFlow, Qt, and ModernGL. It displays raw and filtered EMG traces from OpenBCI boards alongside a live spectrogram, with support for recording and playback.

EMG-GUI displaying raw and filtered EMG traces alongside a live spectrogram

Contents

1. Installation

Requirement: Python 3.9, 3.10, 3.11, 3.12, 3.13, or 3.14.

Choose your operating system and follow the steps in order.

🍎 macOS
  1. Install EMG-GUI:

    pip install emg-gui
    
🪟 Windows
  1. Install EMG-GUI in PowerShell:

    pip install emg-gui
    
🐧 Linux — Ubuntu / Debian
  1. Install the system dependencies. For Debian and Ubuntu:

    sudo apt update
    sudo apt install \
      libgl-dev \
      libegl-dev \
      libxcb-icccm4 \
      libxcb-keysyms1 \
      libxcb-xinerama0 \
      libxcb-xkb1 \
      libxkbcommon-x11-0
    
  2. Install EMG-GUI:

    pip install emg-gui
    

Graphics troubleshooting: If the application reports an OpenGL context error, check that your graphics driver provides OpenGL 3.3 or later.

2. Hello world with synthetic data

Each script opens raw and filtered EMG traces alongside a live spectrogram. Run it with Python, then click Stream Data to begin. Close the window to exit.

Source: examples/synthetic_board.py

from emg_gui import (
    ConsoleLogger, EMGVisualizerWindow, MainsFrequency,
    OpenBCIBoard, OpenBCIBoardType, OpenBCIConfig,
)


def main():
    logger = ConsoleLogger()
    board = None
    try:
        config = OpenBCIConfig(board_type=OpenBCIBoardType.SYNTHETIC)
        board = OpenBCIBoard(logger=logger, config=config)
        EMGVisualizerWindow.run(
            logger=logger, board=board, mains_frequency=MainsFrequency.FIFTY_HZ
        )
    finally:
        if board is not None:
            board.release()
        logger.release()


if __name__ == "__main__":
    main()

3. Features

Explore and record Design and integration
Live multichannel EMG. Compare raw and filtered waveforms together on a shared per-channel scale. Independent acquisition. Sensor polling and raw-data recording run on a worker thread, separate from visualization.
Per-channel spectrograms. Observe changing frequency content alongside each channel’s waveform. Self-paced visualization. Display the latest snapshot without queuing outdated frames or reprocessing unchanged snapshots while streaming.
Built-in filtering. Bandpass filtering with selectable 50 Hz or 60 Hz mains-noise suppression. GPU-accelerated rendering. ModernGL renders waveforms, spectrograms, axes, and labels.
Recording and movement markers. Save raw EMG with movement start/stop markers, organized by activity and dataset split. OpenBCI support. Configure Cyton, Cyton Daisy, or Ganglion, with channel counts and sampling rates taken from the selected board.
GUI session controls. Start and stop streaming and recording separately, and select recording labels directly in the interface. Automatic scaling and layout. Waveforms scale automatically, and channel plots adapt to the window size.
Playback and hardware-free demos. Replay compatible recordings, explore bundled samples, or use synthetic data. Python-configured desktop GUI. Launch from your own script on Windows, macOS, or Linux.

4. How EMG-GUI works

See the architecture guide for the component overview, directory layout, data flow, and thread interactions.

5. Contributing

Contributions are welcome! See CONTRIBUTING.md for the development and linting workflow, planned features, and tech debt.

Report reproducible problems through GitHub Issues, including your operating system, Python and package versions, and the full error output.


6. Acknowledgements

6.1 BrainFlow

This project uses BrainFlow for biosignal acquisition and hardware integration. BrainFlow provides a uniform API for acquiring, parsing, and analyzing EEG, EMG, ECG, and other biosensor data across a wide range of supported boards, including OpenBCI devices. BrainFlow is distributed under the MIT License.

6.2 ModernGL Spectrogram

This project uses nickcercone/spectrogram as a reference for parts of its ModernGL spectrogram rendering implementation. The referenced project demonstrates real-time audio spectrogram visualization using ModernGL and is distributed under the MIT License.

6.3 Text Rendering

This project adapts the code in How to render text with PyOpenGL? by exiled (question) and Rabbid76 (answer) for its ModernGL text renderer. The referenced contributions demonstrate text rendering with PyOpenGL and are distributed under the CC BY-SA 4.0 License.

Videos

Watch demos and tutorials on EMGAbility on YouTube.

Metadata

Release files for emg-gui 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emg-gui 0.1.9
File Size Uploaded Provenance Actions
emg_gui-0.1.9.tar.gz 2.4 MB With provenance Details for emg_gui-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for emg-gui 0.1.9
File Interpreter ABI Platform Actions
emg_gui-0.1.9-py3-none-any.whl Python 3 none any Details for emg_gui-0.1.9-py3-none-any.whl

Total release size: 4.8 MB

Release files / emg_gui-0.1.9.tar.gz

Download URL emg_gui-0.1.9.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
102f194c8799fa35b6aafc199e51d6487b8bcfd8e47c2b337af0326dcb3b304b
BLAKE2b-256 checksum
How to use checksums
ec25f4620804c30f463d3e9f04147e762526c5dd6ca1477266e8eb988bf77361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / emg_gui-0.1.9-py3-none-any.whl

Download URL emg_gui-0.1.9-py3-none-any.whl
Size 2.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
07285c16f2732b38af5dd3fb1ceb90c8c9d81cf47d32e0aeda3724aeb92e10e4
BLAKE2b-256 checksum
How to use checksums
c710d1fffd8ee0824f7ba244389b3284edb65cb812b2cb4fce401c5e04edb9fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for emg-gui 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for emg_gui-0.1.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page