xfmido


Namexfmido JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryA modified version of the Mido library to handle XF format MIDI files.
upload_time2024-10-18 04:54:15
maintainerNone
docs_urlNone
authorshimajiroxyz
requires_python>=3.11
licenseThe MIT License Copyright (c) Ole Martin Bjørndalen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords midi music xfmido
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # XFMIDO

XFMIDO is a Python library for processing XF (eXtended Format) MIDI data.
This library is Based on the [mido](https://github.com/mido/mido) library.

#### English | [日本語](https://github.com/jiroshimaya/xfmido/blob/main/README.ja.md)

## Features

- Reading XF-compliant headers (XFIH) and karaoke information (XFKM) chunks
- Can also read standard MIDI files (SMF)

## Usage

```
pip install xfmido
```


```python
from xfmido import XFMidiFile

# Load a sample MIDI file
xfmidifile = XFMidiFile("sample/sample.mid", charset="cp932")

# Display the information of the loaded MIDI file
print("MIDI file information:")
print(xfmidifile)

# Display XF-compliant header information
print("\nXF header information:")
print(xfmidifile.xfih)

# Display karaoke information
print("\nKaraoke information:")
print(xfmidifile.xfkm)
```

```
MIDI file information:
XFMidiFile(type=1, ticks_per_beat=480, tracks=[
  MidiTrack([
    Message('note_on', channel=0, note=60, velocity=100, time=0),
    Message('note_off', channel=0, note=60, velocity=64, time=480),
    MetaMessage('lyrics', text='Hello World', time=0),
    MetaMessage('end_of_track', time=0)])
])

XF header information:
MidiTrack([
  MetaMessage('text', text='XF Version 1', time=0),
  MetaMessage('end_of_track', time=0)])

Karaoke information:
MidiTrack([
  MetaMessage('cue_marker', text='$Lyrc:1:312:JP', time=0),
  MetaMessage('lyrics', text='Hello', time=0),
  MetaMessage('lyrics', text='World', time=480),
  MetaMessage('lyrics', text='Hello World', time=0),
  MetaMessage('end_of_track', time=0)])
```

## Background
The XF format is an extension of the standard MIDI file format developed by Yamaha Corporation and is widely used in Japan. Most MIDI files available for purchase on Yamaha's website conform to this specification. Detailed specifications of the XF format can be found at the following link: https://jp.yamaha.com/files/download/other_assets/7/321757/xfspc.pdf

Since mido does not read the dedicated chunks of the XF specification, if lyrics information, etc., is written there, it cannot be retrieved. If it can be retrieved, it is expected to be convenient for the development of various applications, as lyrics, timing, and melody can be obtained. Therefore, I wanted to extend mido to read chunks with XF-specific XFIH and XFKM headers.


# For Developers

- This project uses [uv](https://github.com/astral-sh/uv) for package management.
- This project uses [taskipy](https://github.com/taskipy/taskipy) for command management.

```
uv run task test
uv run task lint
uv run task format
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "xfmido",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "midi, music, xfmido",
    "author": "shimajiroxyz",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/21/d3/417d7b2b391e1fdae0952b983ea7e0a83db39ff7193386510f0a121b1c22/xfmido-0.0.2.tar.gz",
    "platform": null,
    "description": "# XFMIDO\n\nXFMIDO is a Python library for processing XF (eXtended Format) MIDI data.\nThis library is Based on the [mido](https://github.com/mido/mido) library.\n\n#### English | [\u65e5\u672c\u8a9e](https://github.com/jiroshimaya/xfmido/blob/main/README.ja.md)\n\n## Features\n\n- Reading XF-compliant headers (XFIH) and karaoke information (XFKM) chunks\n- Can also read standard MIDI files (SMF)\n\n## Usage\n\n```\npip install xfmido\n```\n\n\n```python\nfrom xfmido import XFMidiFile\n\n# Load a sample MIDI file\nxfmidifile = XFMidiFile(\"sample/sample.mid\", charset=\"cp932\")\n\n# Display the information of the loaded MIDI file\nprint(\"MIDI file information:\")\nprint(xfmidifile)\n\n# Display XF-compliant header information\nprint(\"\\nXF header information:\")\nprint(xfmidifile.xfih)\n\n# Display karaoke information\nprint(\"\\nKaraoke information:\")\nprint(xfmidifile.xfkm)\n```\n\n```\nMIDI file information:\nXFMidiFile(type=1, ticks_per_beat=480, tracks=[\n  MidiTrack([\n    Message('note_on', channel=0, note=60, velocity=100, time=0),\n    Message('note_off', channel=0, note=60, velocity=64, time=480),\n    MetaMessage('lyrics', text='Hello World', time=0),\n    MetaMessage('end_of_track', time=0)])\n])\n\nXF header information:\nMidiTrack([\n  MetaMessage('text', text='XF Version 1', time=0),\n  MetaMessage('end_of_track', time=0)])\n\nKaraoke information:\nMidiTrack([\n  MetaMessage('cue_marker', text='$Lyrc:1:312:JP', time=0),\n  MetaMessage('lyrics', text='Hello', time=0),\n  MetaMessage('lyrics', text='World', time=480),\n  MetaMessage('lyrics', text='Hello World', time=0),\n  MetaMessage('end_of_track', time=0)])\n```\n\n## Background\nThe XF format is an extension of the standard MIDI file format developed by Yamaha Corporation and is widely used in Japan. Most MIDI files available for purchase on Yamaha's website conform to this specification. Detailed specifications of the XF format can be found at the following link: https://jp.yamaha.com/files/download/other_assets/7/321757/xfspc.pdf\n\nSince mido does not read the dedicated chunks of the XF specification, if lyrics information, etc., is written there, it cannot be retrieved. If it can be retrieved, it is expected to be convenient for the development of various applications, as lyrics, timing, and melody can be obtained. Therefore, I wanted to extend mido to read chunks with XF-specific XFIH and XFKM headers.\n\n\n# For Developers\n\n- This project uses [uv](https://github.com/astral-sh/uv) for package management.\n- This project uses [taskipy](https://github.com/taskipy/taskipy) for command management.\n\n```\nuv run task test\nuv run task lint\nuv run task format\n```\n",
    "bugtrack_url": null,
    "license": "The MIT License  Copyright (c) Ole Martin Bj\u00f8rndalen  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A modified version of the Mido library to handle XF format MIDI files.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/jiroshimaya/xfmido"
    },
    "split_keywords": [
        "midi",
        " music",
        " xfmido"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "33274798c74d372a88ad49794d29caa0a012b4470afdad7919a3917ca0edb766",
                "md5": "f53c9bdf31f28452f4021b0ddd3f28d4",
                "sha256": "579e5bc2d5033c6079ab5be758601cb3d8f6dd4d74adebe4d70b8a03dc228304"
            },
            "downloads": -1,
            "filename": "xfmido-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f53c9bdf31f28452f4021b0ddd3f28d4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 5691,
            "upload_time": "2024-10-18T04:54:13",
            "upload_time_iso_8601": "2024-10-18T04:54:13.576800Z",
            "url": "https://files.pythonhosted.org/packages/33/27/4798c74d372a88ad49794d29caa0a012b4470afdad7919a3917ca0edb766/xfmido-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "21d3417d7b2b391e1fdae0952b983ea7e0a83db39ff7193386510f0a121b1c22",
                "md5": "b13df85bb26c01579891ef26c74d60e7",
                "sha256": "6599ebf4521e95619a327f583442d82c64312089567c868a5a241307537a0a04"
            },
            "downloads": -1,
            "filename": "xfmido-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b13df85bb26c01579891ef26c74d60e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 64553,
            "upload_time": "2024-10-18T04:54:15",
            "upload_time_iso_8601": "2024-10-18T04:54:15.201726Z",
            "url": "https://files.pythonhosted.org/packages/21/d3/417d7b2b391e1fdae0952b983ea7e0a83db39ff7193386510f0a121b1c22/xfmido-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-18 04:54:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jiroshimaya",
    "github_project": "xfmido",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xfmido"
}
        
Elapsed time: 4.30539s