Skip to content
Musical Gestures Toolbox for Python
Python Jupyter Notebook
Branch: master
Clone or download
Latest commit a9c9b9b Nov 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
documentation Added histogram flattening to average_image() as well Jul 17, 2019
examples Testing new normalization Jul 17, 2019
mgmodule Added histogram flattening to average_image() as well Jul 17, 2019
.gitignore Adding TSV files Jul 17, 2019
LICENSE Initial commit Feb 27, 2019
MotionGesturesToolbox.ipynb Fixing permissions Jun 25, 2019 Update Nov 19, 2019


The Musical Gestures Toolbox for Python is a collection of tools for video visualization and video analysis.

This toolbox is a port and further development of the Musical Gestures Toolbox for Matlab, which again was a port of Musical Gestures Toolbox for Max.


Videos can be used to develop new visualisations to be used for analysis. The aim of creating such alternate displays from video recordings is to uncover features, structures and similarities within the material itself, and in relation to, for example, score material. Three useful visualisation techniques here are motion images, motion history images and motiongrams.

MGT can generate both dynamic and static visualizations, as well as some quantitative data:

  • dynamic visualisations (video files)
    • motion video
    • motion history video
  • static visualisations (images)
    • motion average image
    • motiongrams
    • videograms
  • motion data (csv files)
    • quantity of motion
    • centroid of motion
    • area of motion


Windows, macOS and Linux

Step 1: Clone the git repository:

git clone

Step 2 (if Python 3 is not installed): Install Python 3 either by installing Anaconda 3 (Python distribution) or directly at

Step 3: Install the necessary packages: OpenCV, moviepy,dvipng and FFmpeg. Some of these packages have many dependencies, so remember to check that everything installs correctly. With pip you can run:

pip3 install opencv-python moviepy ffmpeg ffmpeg-python scipy


The documentation folder in this repository holds the main documentation file MGT-doc.pdf, which describes all functionalities.

The Jupyter notebook "MotionGesturesToolbox.ipynb" shows examples of the usage of the toolbox.

For terminal usage, try the two examples in the One example file of how it can be run is mgmodule/tests/ where any .avi-video can be input as filename. To run in terminal (in correct directory): python


This toolbox builds on the Musical Gestures Toolbox for Matlab, which again builds on the Musical Gestures Toolbox for Max.

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.


If you use this toolbox for research purposes, please reference this publication:

  • Jensenius, Alexander Refsum (2018). The Musical Gestures Toolbox for Matlab. Proceedings of the 19th International Society for Music Information Retrieval Conference, Late Breaking Demos Session.


Main developers: Frida Furmyr, Marcus Widmer, Alexander Refsum Jensenius


This toolbox is using the GNU General Public License 3.0 license.

You can’t perform that action at this time.