/pymidifile

Functions and utils to analyse, process and transform midi files

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

pymidifile

This repository combines various available and stable resources to provide a pythonic framework for music analysis and manipulation of midi files. It is conceptually inspired in the MATLAB miditoolbox by Tuomas Eerola and Petri Toiviainen (https://github.com/miditoolbox), although the various conversions, filters and descriptors implemented are guided by my own research on tonality in Electronic Dance Music.

Pymidifile is a conveniency repository aiming at bridging already existing and widely tested tools such as the data analysis library Pandas or the music21 toolkit for computer-aided musicology, adapting, combining and extending the capacities of these powerful projects to my research needs.

The Pymidifile functions can be grouped into three categories:

  1. Conversion: midi files to and from python lists, pandas Dataframes and/or music21 scores, in all combinations.
  2. Descriptive: extract, combine and visualize musical descriptors from any of the converted types (python lists, DataFrames or Scores).
  3. Tranform: process parameters in any converted type, transfoming some or all of its data.

Additionally, I provide a number of command-line scripts that perform useful operations on batches of files (quantization, reformatting, feature extraction).

Main Dependencies

Pymidifile works with Python =>2.7 and >=3.6. The following libraries are needed --and are indeed essential descriptive tools-- that this repository combines:

Other dependencies include common python scientific toolkits such as Numpy, scipy-stats and json.