Repository navigation
Home
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.
- Try it in the browser, with nothing installed: the tutorial notebook in Colab.
- Install it on Windows, macOS or Linux: Installation.
- 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.
- 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.
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.
- Quick Start on the docs site
- Tutorial notebook, which can also be run in Colab
- Example scripts in the repository
- 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 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.
- Installation: Setup instructions for all platforms
- Video Basics: Understanding video processing concepts
- Loading Videos: How to load and display videos
- Preprocessing: Video preprocessing techniques
- Video Analysis: Motion analysis and visualisation
- Filtering Effects: Understanding filter parameters
- Output Management: Working with results
- Function Chaining: Combining multiple operations
- File Naming: Output file conventions
- Audio Analysis: Audio processing functions
-
Pose and Motion Capture:
MgVideo.pose()skeleton rendering; landmark-trajectory extraction; pose-derived limb speed/impacts; QTM mocap I/O - Pulse, Cycles and Alignment: Canonical peak-picker; stroke/cycle segmentation and accelerando fitting; lead/lag estimation, event matching, cross-source agreement
- Segmentation and Annotation: Turning a long recording into material a person can annotate
- Motion, Audio and Posturography Toolkit: Functions that work on columns of numbers rather than video: quantity of motion from position, pose or accelerometer data; audio onsets, decay and brightness; postural sway, complexity and respiration rate
- Working with ambiscape: Joint audio–video sessions: shared clock, device sync, 360-camera workflow
- 360 Video Anglegrams and AEM: Directional motion analysis of 360 video, audio-energy overlays, per-direction views
- Eye Tracking, Events and the Canvas: A wearer's eye tracker on the video's clock, events tested against events, and a painting measured as a time series
- People on Stage and Camera Motion: Counting who is performing in a concert video, and separating camera pans, zooms and cuts from the performers' motion
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.
Please help improve the toolbox by adding bugs and feature requests in the issues section.
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 |
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.
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.
A project from the fourMs Lab, RITMO Centre for Interdisciplinary Studies in Rhythm, Time and Motion, Department of Musicology, University of Oslo.