The Musical Gestures Toolbox for Python (musicalgestures) is a collection of tools for visualising and analysing motion in video recordings, together with the sound that accompanies them. It was developed for research on music-related body motion, but it works on any video or audio file.
pip install musicalgesturesYou also need FFmpeg on your system; everything else installs automatically. The installation guide covers optional extras such as pose estimation.
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 in the frame movement happens 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:
- 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
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 over the years, including Balint Laczko, Joachim Poutaraud, Frida Furmyr, Marcus Widmer, and Alexander Refsum Jensenius.
The software is maintained by the fourMs lab at RITMO Centre for Interdisciplinary Studies in Rhythm, Time and Motion, University of Oslo.
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.
This toolbox is released under the GNU General Public License 3.0.
