pozalabs-miditoolkit


Namepozalabs-miditoolkit JSON
Version 1.1.2 PyPI version JSON
download
home_pageNone
SummaryA python package for working with MIDI data files. (POZAlabs forked)
upload_time2024-04-15 10:38:37
maintainerNone
docs_urlNone
authorpozalabs
requires_python<4.0,>=3.9
licenseMIT
keywords midi mir music
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Miditoolkit

A Python package for working with MIDI files.

[![PyPI version fury.io](https://badge.fury.io/py/miditoolkit.svg)](https://pypi.python.org/pypi/miditoolkit/)
[![Python 3.7](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/release/)
[![GitHub CI](https://github.com/YatingMusic/miditoolkit/actions/workflows/pytest.yml/badge.svg)](https://github.com/YatingMusic/miditoolkit/actions/workflows/pytest.yml)
[![GitHub license](https://img.shields.io/github/license/YatingMusic/miditoolkit.svg)](https://github.com/YatingMusic/miditoolkit/blob/main/LICENSE)
[![Downloads](https://static.pepy.tech/badge/miditoolkit)](https://pepy.tech/project/miditoolkit)
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Miditoolkit works by loading/writing MIDIs with [mido](https://github.com/mido/mido) in a user-friendly way. It is inspired from [pretty_midi](https://github.com/craffel/pretty-midi), with similar usage and core features, but handles the MIDI events in native **[ticks](https://www.recordingblogs.com/wiki/midi-tick)** time unit instead of seconds. It also comes with a few optimizations and speed-ups, and can parse MIDI tracks into **piano-rolls** for computation or visualization purposes.
If you are working with seconds time units (for e.g. music transcription), you'll be likely better with pretty_midi. Otherwise, if you are working solely on MIDI and symbolic music, miditoolkit should provide slightly faster performances.

## 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
   * [structure analysis](https://github.com/wayne391/sf_segmenter)

## TODO

* better documentation;
* finish the code cleaning of the pianoroll methods (vis);
* a way to switch the time in seconds across the whole MidiFile object;
* cropping Control Changes and bars;
* symbolic features
* new structural analysis

## Installation

You can install miditoolkit via [PYPI](https://pypi.org/project/miditoolkit/):

```bash
pip install miditoolkit
```

... or directly from git if you want to get the latest features or fixes (only recommended if you need it):

```bash
pip install git+https://github.com/YatingMusic/miditoolkit
```

## Example Usage

```python
from miditoolkit import MidiFile
from miditoolkit.midi.utils import example_midi_file

path_midi = example_midi_file()
midi_obj = 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](examples/parse_and_create_MIDI_files.ipynb)
B. [Piano-roll Manipulation](examples/pinoroll_manipulation.ipynb)

## Philosophy

* [mido](https://github.com/mido/mido) processes MIDI files in the lower level such as messages and ports, and is the backend pretty_midi and miditoolkit;
* [pretty_midi](https://github.com/craffel/pretty-midi) parses MIDI files and pianorolls in seconds time unit, plus has audio related features;
* [pypianoroll](https://github.com/salu133445/pypianoroll) parses MIDI files into pianorolls in ticks time unit.

**Miditoolkit** is designed for handling MIDI in **[ticks](https://www.recordingblogs.com/wiki/midi-tick)**, the native time unit of the MIDI protocol. 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, etc.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pozalabs-miditoolkit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "midi, mir, music",
    "author": "pozalabs",
    "author_email": "contact@pozalabs.com",
    "download_url": "https://files.pythonhosted.org/packages/ad/f5/95febd7a04175d7556b75ede6d8af296b29190f05a3e017f7c3592b2cde6/pozalabs-miditoolkit-1.1.2.tar.gz",
    "platform": null,
    "description": "# Miditoolkit\n\nA Python package for working with MIDI files.\n\n[![PyPI version fury.io](https://badge.fury.io/py/miditoolkit.svg)](https://pypi.python.org/pypi/miditoolkit/)\n[![Python 3.7](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/release/)\n[![GitHub CI](https://github.com/YatingMusic/miditoolkit/actions/workflows/pytest.yml/badge.svg)](https://github.com/YatingMusic/miditoolkit/actions/workflows/pytest.yml)\n[![GitHub license](https://img.shields.io/github/license/YatingMusic/miditoolkit.svg)](https://github.com/YatingMusic/miditoolkit/blob/main/LICENSE)\n[![Downloads](https://static.pepy.tech/badge/miditoolkit)](https://pepy.tech/project/miditoolkit)\n[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nMiditoolkit works by loading/writing MIDIs with [mido](https://github.com/mido/mido) in a user-friendly way. It is inspired from [pretty_midi](https://github.com/craffel/pretty-midi), with similar usage and core features, but handles the MIDI events in native **[ticks](https://www.recordingblogs.com/wiki/midi-tick)** time unit instead of seconds. It also comes with a few optimizations and speed-ups, and can parse MIDI tracks into **piano-rolls** for computation or visualization purposes.\nIf you are working with seconds time units (for e.g. music transcription), you'll be likely better with pretty_midi. Otherwise, if you are working solely on MIDI and symbolic music, miditoolkit should provide slightly faster performances.\n\n## Main Features\n\n* MIDI\n    * Global\n        * ticks per beat\n        * tempo changes\n        * key signatures\n        * time signatures\n        * lyrics\n        * markers\n    * Instruments\n        * control changes\n        * pitch bend\n    * Editing\n        * chunk/cropping\n    * IO\n        * BytesIO\n* Piano-rolls\n    * Tools\n        * notes to piano-rolls\n        * piano-rolls to notes\n        * chromagram\n    * Visualization\n* External Library\n   * [structure analysis](https://github.com/wayne391/sf_segmenter)\n\n## TODO\n\n* better documentation;\n* finish the code cleaning of the pianoroll methods (vis);\n* a way to switch the time in seconds across the whole MidiFile object;\n* cropping Control Changes and bars;\n* symbolic features\n* new structural analysis\n\n## Installation\n\nYou can install miditoolkit via [PYPI](https://pypi.org/project/miditoolkit/):\n\n```bash\npip install miditoolkit\n```\n\n... or directly from git if you want to get the latest features or fixes (only recommended if you need it):\n\n```bash\npip install git+https://github.com/YatingMusic/miditoolkit\n```\n\n## Example Usage\n\n```python\nfrom miditoolkit import MidiFile\nfrom miditoolkit.midi.utils import example_midi_file\n\npath_midi = example_midi_file()\nmidi_obj = MidiFile(path_midi)\n\nprint(midi_obj)\n```\n\nOutput:\n\n```\nticks per beat: 480\nmax tick: 72002\ntempo changes: 68\ntime sig: 2\nkey sig: 0\nmarkers: 71\nlyrics: False\ninstruments: 2\n```\n\nA. [Parse and create MIDI files](examples/parse_and_create_MIDI_files.ipynb)\nB. [Piano-roll Manipulation](examples/pinoroll_manipulation.ipynb)\n\n## Philosophy\n\n* [mido](https://github.com/mido/mido) processes MIDI files in the lower level such as messages and ports, and is the backend pretty_midi and miditoolkit;\n* [pretty_midi](https://github.com/craffel/pretty-midi) parses MIDI files and pianorolls in seconds time unit, plus has audio related features;\n* [pypianoroll](https://github.com/salu133445/pypianoroll) parses MIDI files into pianorolls in ticks time unit.\n\n**Miditoolkit** is designed for handling MIDI in **[ticks](https://www.recordingblogs.com/wiki/midi-tick)**, the native time unit of the MIDI protocol. 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, etc.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python package for working with MIDI data files. (POZAlabs forked)",
    "version": "1.1.2",
    "project_urls": null,
    "split_keywords": [
        "midi",
        " mir",
        " music"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a5f420f72158dbfe969b25914ff4d604aefac238c66527da20262ebfd4cd1d9b",
                "md5": "07b1b6743c5f6104ed1dbddd2206e409",
                "sha256": "ad20057557afefda552eae6d727bf6f9ddba095e7d7b1adc96a564c14bba9d89"
            },
            "downloads": -1,
            "filename": "pozalabs_miditoolkit-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07b1b6743c5f6104ed1dbddd2206e409",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 20734,
            "upload_time": "2024-04-15T10:38:38",
            "upload_time_iso_8601": "2024-04-15T10:38:38.675766Z",
            "url": "https://files.pythonhosted.org/packages/a5/f4/20f72158dbfe969b25914ff4d604aefac238c66527da20262ebfd4cd1d9b/pozalabs_miditoolkit-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "adf595febd7a04175d7556b75ede6d8af296b29190f05a3e017f7c3592b2cde6",
                "md5": "18ffa13142da9cb64ce90f83cb11d5ea",
                "sha256": "32dbe4561a8f0e35882a603abf3240cb474531053a7bce25f896c8ef07720bd4"
            },
            "downloads": -1,
            "filename": "pozalabs-miditoolkit-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "18ffa13142da9cb64ce90f83cb11d5ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 20118,
            "upload_time": "2024-04-15T10:38:37",
            "upload_time_iso_8601": "2024-04-15T10:38:37.171735Z",
            "url": "https://files.pythonhosted.org/packages/ad/f5/95febd7a04175d7556b75ede6d8af296b29190f05a3e017f7c3592b2cde6/pozalabs-miditoolkit-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-15 10:38:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pozalabs-miditoolkit"
}
        
Elapsed time: 0.40528s