Skip to main content

Musical Gestures Toolbox for Python

Project description

MGT-python

PyPi version GitHub license CI Documentation

The Musical Gestures Toolbox for Python is a collection of tools for visualizing and analysing audio and video files.

MGT python

📖 Documentation & Examples

Quick Start

Installation

pip install musicalgestures

musicalgestures installs its core Python dependencies automatically. You still need a working ffmpeg installation on your system for video processing.

Basic Usage

import musicalgestures as mg

# Load a video
v = mg.MgVideo('dance.avi')

# Create visualizations
v.grid()
v.videograms()
v.average()
v.history()

# Perform motion analysis
v.motion()

# Audio analysis
v.audio.waveform()
v.audio.spectrogram()
v.audio.tempogram()

# Pose estimation
v.pose(model='body_25', device='cpu')

Runtime Notes

  • ffmpeg is required for video I/O and preprocessing.
  • pose() downloads OpenPose weights on first use if they are missing.
  • In notebooks and other non-interactive runs, missing pose weights are downloaded automatically when possible.
  • If device='gpu' is requested but OpenCV CUDA support is unavailable, pose() falls back to CPU execution.
  • flow.dense(), flow.sparse(), and blur_faces() use CPU by default (use_gpu=False). Set use_gpu=True to opt into CUDA acceleration with automatic CPU fallback.
  • get_cuda_device_count() is available to quickly check whether OpenCV sees CUDA devices.
  • blur_faces() returns the generated result object consistently, including when save_data=True.

Try Online

Open In Colab

Quick Links

Features

  • Video Analysis: Motion detection, optical flow, pose estimation
  • Audio Processing: Spectrograms, audio descriptors, tempo analysis
  • Visualizations: Motiongrams, videograms, motion history
  • Integration: Works with NumPy, SciPy, and Matplotlib ecosystems
  • Cross-platform: Linux, macOS, Windows support

Presentation

See this short video presentation made for the Nordic Sound and Music Computing Conference 2021:

nordicsmc2021-thumbnail_640

Requirements

Research Background

This toolbox builds on the Musical Gestures Toolbox for Matlab, which again builds on the Musical Gestures Toolbox for Max. Many researchers and research assistants have helped its development over the years, including Balint Laczko, Joachim Poutaraud, Frida Furmyr, Marcus Widmer, Alexander Refsum Jensenius

The software is currently maintained by the fourMs lab at RITMO Centre for Interdisciplinary Studies in Rhythm, Time and Motion at the University of Oslo.

Reference

If you use this toolbox in your research, please cite this article:

@inproceedings{laczkoReflectionsDevelopmentMusical2021,
    title = {Reflections on the Development of the Musical Gestures Toolbox for Python},
    author = {Laczkó, Bálint and Jensenius, Alexander Refsum},
    booktitle = {Proceedings of the Nordic Sound and Music Computing Conference},
    year = {2021},
    address = {Copenhagen},
    url = {http://urn.nb.no/URN:NBN:no-91935}
}

License

This toolbox is released under the GNU General Public License 3.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

musicalgestures-1.4.3.tar.gz (34.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

musicalgestures-1.4.3-py3-none-any.whl (34.2 MB view details)

Uploaded Python 3

File details

Details for the file musicalgestures-1.4.3.tar.gz.

File metadata

  • Download URL: musicalgestures-1.4.3.tar.gz
  • Upload date:
  • Size: 34.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for musicalgestures-1.4.3.tar.gz
Algorithm Hash digest
SHA256 232821b5e136984a05a02e67c63062277f81dbe7bf6a7074e8121149c9769a72
MD5 e5d946710626d8fbbaed4d23066a9e6f
BLAKE2b-256 92d691578b351276b5c56c96adf583e2de50d46a3f9e00e4a51e399f04953368

See more details on using hashes here.

Provenance

The following attestation bundles were made for musicalgestures-1.4.3.tar.gz:

Publisher: pypi-publish.yml on fourMs/MGT-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file musicalgestures-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: musicalgestures-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 34.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for musicalgestures-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 618ab9034e33e336979fee5d2c9c6795c9ee4e1d003731b3dcaa15ee5b8a4a7d
MD5 3f04eb06207968f9a7c12d7fc8ffd28d
BLAKE2b-256 1361a27db494188d6c4dd895f9b3b74ce4455fdbe84dc762fb821bdf02c86146

See more details on using hashes here.

Provenance

The following attestation bundles were made for musicalgestures-1.4.3-py3-none-any.whl:

Publisher: pypi-publish.yml on fourMs/MGT-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page