Skip to main content

MGT-python

PyPi version Python GitHub license CI Documentation DOI

The Musical Gestures Toolbox for Python (musicalgestures) is a collection of tools for visualising and analysing motion in video recordings, along with the accompanying sound. It was developed for research on music-related body motion, but it works on any video or audio file.

MGT python

Installation

pip install musicalgestures

You also need FFmpeg on your system; everything else installs automatically. The installation guide covers optional extras such as pose estimation.

Quickstart

import musicalgestures as mg

v = mg.MgVideo(mg.examples.dance)   # or your own file: mg.MgVideo('dance.mp4')
v.motiongrams().show()

This draws motiongrams: images that trace where movement happens in the frame over time, like a spectrogram for the body. Analysis methods return result objects, and .show() displays them.

You can also try the toolbox in the browser, with no installation:

Open In Colab

Documentation

  • Documentation site — installation, quickstart, user guide, and full API reference
  • Wiki — worked examples and discussion of the methods
  • Contributing — how to report issues and submit changes

The four toolboxes

Four packages from the fourMs Lab at the University of Oslo, each released separately on PyPI. Which one you want is decided by what you have in hand rather than by what you want to know:

you have use it gives you
a video file, with or without its sound musicalgestures (this one) motiongrams, videograms, motion analysis from ordinary video
a motion time series from a body — optical markers, an accelerometer, a respiration belt, a force plate micromotion quantity of motion, posture, balance, and the band conventions the others follow
a recording of a place — mono, stereo, binaural or ambisonic ambiscape the sonic ambience of that place: level, spectrum, space, rhythm, sources
a folder of music, or a concert recording musiscape many tracks and albums compared at a glance

Where a measure appears in more than one package it has a single owner and a single implementation, so the answer does not depend on which package you called. This package owns everything that starts from pixels; micromotion owns filtering, lag estimation and circular statistics, and this package requires it, re-exporting its group_qom, bandpass and xcorr_lag rather than keeping its own. A test here checks the numbers against micromotion's and fails if they diverge.

One name is deliberately NOT shared. musicalgestures.dominant_frequency takes an FFT peak over 0.5–8.0 Hz, for locomotion and dance; micromotion.dominant_frequency takes a Welch peak over 0.3–4.0 Hz, for a body trying to stay still. They answer different questions and can disagree completely, so state which one produced any number you report.

Citing

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

Laczkó, B., & Jensenius, A. R. (2021). Reflections on the Development of the Musical Gestures Toolbox for Python. Proceedings of the Nordic Sound and Music Computing Conference, Copenhagen.

If you want to cite the toolbox itself, use the Zenodo CONCEPT DOI, which always resolves to the newest version:

Jensenius, A. R., Laczkó, B., Poutaraud, J., Widmer, M., Furmyr, F., Guo, J., Clim, A., Upham, F., & von Arnim, H. A. (2026). Musical Gestures Toolbox for Python [Computer software]. Zenodo https://doi.org/10.5281/zenodo.21965729

Where the exact behaviour matters, cite the version you ran.

CITATION.cff in this repository carries the same information in machine-readable form.

Credits

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 (both directly and indirectly) over the years; see the contributor list on Zenodo for details.

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

License

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

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.12.0.tar.gz (32.7 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.12.0-py3-none-any.whl (32.6 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: musicalgestures-1.12.0.tar.gz
  • Upload date:
  • Size: 32.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for musicalgestures-1.12.0.tar.gz
Algorithm Hash digest
SHA256 b0d98389f2778cd6988c0f9d21750551e61bb1837d988dfa4e41170fa7bb669c
MD5 98454d97b4b335ec7db7b116441556a0
BLAKE2b-256 09ec392f75b86a73b71c238aebf6302ceb2c04ba6a9f637857dc05162723bb13

See more details on using hashes here.

Provenance

The following attestation bundles were made for musicalgestures-1.12.0.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.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for musicalgestures-1.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 856c73558b8472670214f9e878d6d778b144d31d59a09f25cf09a374da2340fb
MD5 9056c6eb0d5e9e6cf3e8e7281d944134
BLAKE2b-256 ecf1edc61c082ba1910b4ab5a0af21addb2e71c18a5c89a4d9204b871e7ad533

See more details on using hashes here.

Provenance

The following attestation bundles were made for musicalgestures-1.12.0-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.

Release history Release notifications | RSS feed

1.18.0

2 files

1.17.0

2 files

1.16.0

2 files

1.15.0

2 files

1.14.2

2 files

1.14.1

2 files

1.14.0

2 files

1.13.0

2 files

1.12.1

2 files

This release

1.12.0 This release

2 files

1.11.4

2 files

1.11.3

2 files

1.11.2

2 files

1.11.1

2 files

1.11.0

2 files

1.10.0

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.9

2 files

1.6.8

2 files

1.6.7

2 files

1.6.6

2 files

1.6.5

2 files

1.6.4

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.9

2 files

1.4.8

2 files

1.4.7

2 files

1.4.6

2 files

1.4.5

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.0

2 files

1.3.3

2 files

1.3.2

2 files

1.3.0

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.9

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.1

2 files

1.1.0

2 files

1.0.999

2 files

1.0.6

2 files

Supported by

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