Skip to main content

No project description provided

Project description

miditoolkit

A python package for working with MIDI data.

  • Version: 0.1.17
  • Latest update date: 2023/10/31

The usage is similar to pretty_midi, while miditoolkit handles MIDI events in symbolic timing (ticks, instead of seconds). Furthermore, the toolkit can parse MIDI tracks into piano-rolls for computation or visualization purposes.

Main Features

  • MIDI
    • Global
      • ticks per beat
      • tempo changes
      • key signatures
      • time signatures
      • lyrics
      • markers
    • Instruments
      • control changes
      • pitch bend
    • Editing
      • chunk/cropping
    • IO
      • BytesIO
  • Piano-rolls
    • Tools
      • notes to piano-rolls
      • piano-rolls to notes
      • chromagram
    • Visualization
  • External Library

TODO

  • better documentation
  • absolute timing
  • cropping: Control Changes
  • cropping: bars
  • symbolic features
  • new structural analysis

Installation

  • current version: 0.1.15
  • python 2 is not supported
  • Install the miditoolkit via PYPI:
pip install miditoolkit

Example Usage

import miditoolkit
path_midi = miditoolkit.midi.utils.example_midi_file()
midi_obj = miditoolkit.midi.parser.MidiFile(path_midi)
print(midi_obj)

"""
Output:

ticks per beat: 480
max tick: 72002
tempo changes: 68
time sig: 2
key sig: 0
markers: 71
lyrics: False
instruments: 2

"""

A. Parse and create MIDI files
B. Piano-roll Manipulation

Philosophy

  • pretty_midi can parse MIDI files and generate pianorolls in absolute timing (seconds).
  • pypianoroll can parse MIDI files into pianorolls in symbolic timing (through beat resolution).
  • mido processes MIDI files in the lower level such as messages and ports.

Miditoolkit is designed for handling MIDI in symbolic timing (ticks), which is the native format of MIDI timing. We keep the midi parser as simple as possible, and offer several important functions to complete the versatility. For example, piano-rolls, tick-to-second, chromagram, and etc.

To customize settings and maximum the degree of freedom, users can use additional libraries like visualization, which are excluded in the toolkit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miditoolkit-1.0.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

miditoolkit-1.0.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file miditoolkit-1.0.0.tar.gz.

File metadata

  • Download URL: miditoolkit-1.0.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for miditoolkit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9e26b76b9bc79f84566c4bdc04ffd2580880885987f4e793951bfe38240a9f14
MD5 cc272ae3d51ea5d69b185ca1ef0f41aa
BLAKE2b-256 eaae67be0fad806707e216e9f597d1ba18e615cc0217009f2fac5963e1973759

See more details on using hashes here.

File details

Details for the file miditoolkit-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: miditoolkit-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for miditoolkit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20988fa40bc569d50c2312396ec54271b09b6a4c41d221a13e37b3239cc90bfa
MD5 3f8147747e23f5d9daee2a61d17451ba
BLAKE2b-256 4a43d718837baa6e38da7f4639bd300574839820a086e209b54115446c5edcf5

See more details on using hashes here.

Supported by

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