Skip to main content

Ability logomark emg-gui

Python versions PyPI version Monthly downloads Total downloads

1. Overview

1.1 Introduction

A real-time visual engine for acquiring, recording, and exploring raw and filtered EMG signals.

1.2 Installation

EMG-GUI can be installed from pypi using pip:

pip install emg-gui

1.3 How to Run

TODO


2. Architecture and Project Structure

2.1 Architecture

The application separates sensor acquisition, interface controls, signal processing, and GPU rendering. Sensor polling and board stream control run on a dedicated thread, while Qt interface updates, filtering, and ModernGL rendering currently run on the main thread.

EMG GUI
├── app.py
├── Acquisition
│   ├── DataSource
│   └── SensorWorker
│       └── RingBuffer
├── UI
│   ├── EMGVisualizerWindow
│   └── EMGControlPanel
├── Processing
│   ├── EMG filtering
│   └── Window functions
└── Visualization
    ├── EMGOpenGLWidget
    ├── TimeSeriesRenderer
    ├── SpectrogramRenderer
    ├── TicksRenderer
    └── TextRenderer

The DataSource provides hardware-independent acquisition from either an OpenBCI board or a playback recording. The current application entry point uses OpenBCIBoard by default, with playback available as an alternate source. SensorWorker reads EMG samples into a fixed-size ring buffer, and EMGOpenGLWidget owns duplicate-snapshot checks, snapshot filtering, and ModernGL rendering. TimeSeriesRenderer and SpectrogramRenderer are connected to the live rendering path. Channel counts come from the selected data source, so synthetic and real boards can expose different numbers of EMG channels. The display window is sample-based, while the rendered layout is derived from the OpenGL widget size and the selected EMG channel count.

See the architecture guide for the detailed component hierarchy, data flow, and thread interaction sequences.

2.2 Directory Layout

Inside this project, you'll see the following folders and files:

/
├── docs/
│   ├── diagrams/
│   │   ├── Ability_Logo.svg
│   │   └── interface-contracts.svg
│   └── architecture.md
├── src/
│   └── emg_gui/
│       ├── app.py
│       ├── acquisition/
│       │   ├── data_source.py
│       │   ├── dataset_files.py
│       │   └── sensor_worker.py
│       ├── config/
│       │   ├── constants.py
│       │   └── Roboto-Black.ttf
│       ├── core/
│       │   ├── enums.py
│       │   ├── logger.py
│       │   └── types.py
│       ├── processing/
│       │   ├── filter.py
│       │   └── window_functions.py
│       ├── ui/
│       │   ├── control_panel.py
│       │   └── window.py
│       └── visualizer/
│           ├── shaders/
│           │   ├── shader_loader.py
│           │   ├── spec/
│           │   │   ├── vertex.glsl
│           │   │   └── fragment.glsl
│           │   ├── text/
│           │   │   ├── vertex.glsl
│           │   │   └── fragment.glsl
│           │   ├── ticks/
│           │   │   ├── vertex.glsl
│           │   │   └── fragment.glsl
│           │   └── time_series/
│           │       ├── vertex.glsl
│           │       └── fragment.glsl
│           ├── open_gl_widget.py
│           ├── spectrogram_renderer.py
│           ├── text_renderer.py
│           ├── ticks_renderer.py
│           └── time_series_renderer.py
├── tests/
├── CONTRIBUTING.md
├── pyproject.toml
└── README.md

3. Contributing

Contributions are welcome! See the contributing guide for development and linting guidelines.


4. Acknowledgements

4.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.

4.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.

4.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.


5. Tech Debt

  1. Add setup and installation instructions to this readme.
  2. Create new repo-emg-ability (create import and remove run.sh).
  3. Folder portability use EMGFlow & system path reference.
  4. Add legends for raw and filtered emg in timeseries renderer.
  5. Processing latency in the performance metrics.
  6. Improve the GUI toggle controls and expose their options in the left sidebar.
  7. Add timer and countdown visualizations.
  8. Move signal processing from the GUI thread to a dedicated processing thread.
  9. Move the complete data-source lifecycle into the sensor thread, including initialization, streaming, recording, stopping, and release.

Metadata

Release files for emg-gui 0.0.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.0.9
File Size Uploaded
emg_gui-0.0.9.tar.gz 429.1 kB Details

Built distribution (wheel)

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

Total release size: 871.6 kB

Release files / emg_gui-0.0.9.tar.gz

Download URL emg_gui-0.0.9.tar.gz
Size 429.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6f2115aa81e9995557b3d5a2d1497ea5ff205ca8afd2eaf0c97f9bcfb1f93025
BLAKE2b-256 checksum
How to use checksums
7c9e9b64adf13c3edfbea3d8863c45b3802d0237f37226dbe316d904200c4043
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

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

Download URL emg_gui-0.0.9-py3-none-any.whl
Size 442.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c024a4a5bb4091c16ec354e9678ac06d80f77a0fa4d2a68f7361e1d3f964f77
BLAKE2b-256 checksum
How to use checksums
74c2d3739f4865f851cf186c54c44176b4ea0d0c8597eafc2f0fd45616b47c18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

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