Skip to content
Alexander Refsum Jensenius edited this page Dec 3, 2026 · 36 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, medicine and sport science.

You use it by writing short Python commands, typically in a Jupyter notebook. No earlier programming experience is assumed in the first chapters.

Start here

  1. Try it in the browser, with nothing installed: the tutorial notebook in Colab.
  2. Install it on Windows, macOS or Linux: Installation.
  3. Spend five minutes with the two example videos that come with the toolbox, a dancer and a pianist: the Quick Start on the docs site.
  4. Then read the course below in order, starting with Video Basics.

If a term is new (motiongram, videogram, quantity of motion, pose estimation), Concepts on the docs site explains it in a few lines, and the Gallery shows a picture of each.

The wiki reads in order: each chapter opens with the idea in plain words and then deepens, so a dance student and a signal-processing researcher can start at the same page and stop at different depths. The later chapters assume the earlier ones.

Related packages

ambiscape (soundscapes and sound-event tagging), musiscape (music collections and concert segmentation) and avsegmenter (whole concert and lecture recordings: segmentation, players, archival metadata) build on this toolbox.

Other ways in

  1. Quick Start on the docs site
  2. Tutorial notebook, which can also be run in Colab
  3. Example scripts in the repository
  4. Documentation site, the reference

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

The course, chapter by chapter

The chapters read in order: basics first, then looking, then measuring and segmenting, then annotating, and the special formats last. Later chapters assume the earlier ones. Concepts and quick reference live on the documentation site; this wiki is where the toolbox is taught.

Basics

Looking

Measuring and segmenting

Specialist toolkits and formats

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

Citing musicalgestures

The package is archived on Zenodo. Cite the CONCEPT DOI, which always resolves to the newest version: 10.5281/zenodo.21965729.

Where the exact behaviour matters, name the version you ran as well; the version-specific DOIs are listed on the Zenodo record. CITATION.cff in the repository carries the same information in machine-readable form.

Reuse and boundaries

The README lists the parts of this toolbox that work on their own, under "What you can reuse", and states what the toolbox does not do, with the packages that do it. When you combine it with a toolbox outside the fourMs family, convert at the boundary: a pandas DataFrame is the common currency, and Kinetics Toolkit's TimeSeries and MNE's Raw both convert to and from one.

Clone this wiki locally