Skip to content
Alexander Refsum Jensenius edited this page Aug 6, 2026 · 23 revisions

The Musical Gestures Toolbox for Python is a collection of high-level modules targeted at researchers working with video recordings. It includes visualisation techniques such as motion videos, motion history images, and motiongrams; techniques that, in different ways, allow for looking at video recordings from different temporal and spatial perspectives. It also includes basic computer vision analysis, such as extracting the quantity and centroid of motion, and using such features in analysis.

The toolbox targets music-related body motion (of musicians, dancers, and perceivers) but is equally helpful for other disciplines working with video recordings of humans, such as linguistics, pedagogy, psychology, and medicine.

Functionality

The Musical Gestures Toolbox contains functions to analyse and visualise video, audio, and motion capture data. There are three categories of functions:

  • Preprocessing (trimming, cropping, colour adjustments, etc.)
  • Visualisation (video playback, image display, plotting)
  • Processing (videograms, average images, motion images, etc.)

Getting Started Options

  1. Quick Start Tutorial
  2. Jupyter Notebook–can also be run in Colab
  3. Examples Overview
  4. Complete Documentation Site

What changed in each release is kept in one place, the release notes and the changelog, rather than repeated here.

Wiki Navigation

This wiki provides detailed documentation for individual MGT functions:

Sound–Motion Analysis Toolkit

Signal-level numpy/scipy functions (mostly not MgVideo/MgAudio methods) for the ro, still standing, Westney-comparisons and cymbal-comparison studies (Jensenius):

  • Pulse, Cycles and Alignment - Canonical peak-picker; stroke/cycle segmentation and accelerando fitting; lead/lag estimation, event matching, cross-source agreement
  • Motion, Audio and Posturography Toolkit - Band-limited QoM cores for position/pose/accelerometer data; scipy-only audio RMS/flux onsets, T60 decay, attack spectral centroid; sway metrics, complexity/dynamics measures, respiration rate
  • Pose and Motion Capture - MgVideo.pose() skeleton rendering; MediaPipe landmark-trajectory extraction; pose-derived limb speed/impacts; QTM mocap I/O

360 Video and Joint Sessions

Backend

The speed and efficiency of the MGT are made possible by the excellent FFmpeg project. Many of the toolbox functions are Python wrappers/bindings on FFmpeg commands called in a subprocess.

Problems

Please help improve the toolbox by adding bugs and feature requests in the issues section.

The other fourMs toolboxes

Separate packages with separate release cycles, built to be used together and sharing several implementations, so the same measure computed in two of them agrees.

Toolbox What it is for Docs
ambiscape soundscapes: the sonic ambience of a place wiki
musiscape music collections: comparing many tracks and albums wiki
micromotion human micromotion: quantity of motion from markers, accelerometers, belts and force plates wiki

Clone this wiki locally