XFMIDO
XFMIDO is a Python library for processing XF (eXtended Format) MIDI data. This library is Based on the mido library.
English | 日本語
Features
- Reading XF-compliant headers (XFIH) and karaoke information (XFKM) chunks
- Can also read standard MIDI files (SMF)
Usage
pip install xfmido
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
uv run task test
uv run task lint
uv run task format
Metadata
Release files for xfmido 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xfmido-0.0.2.tar.gz | 64.6 kB | Without provenance | Details for xfmido-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xfmido-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for xfmido-0.0.2-py3-none-any.whl |
Total release size: 70.2 kB
Release files / xfmido-0.0.2.tar.gz
| Download URL | xfmido-0.0.2.tar.gz |
|---|---|
| Size | 64.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6599ebf4521e95619a327f583442d82c64312089567c868a5a241307537a0a04
|
|
BLAKE2b-256 checksum How to use checksums |
21d3417d7b2b391e1fdae0952b983ea7e0a83db39ff7193386510f0a121b1c22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.20
|
Release files / xfmido-0.0.2-py3-none-any.whl
| Download URL | xfmido-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
579e5bc2d5033c6079ab5be758601cb3d8f6dd4d74adebe4d70b8a03dc228304
|
|
BLAKE2b-256 checksum How to use checksums |
33274798c74d372a88ad49794d29caa0a012b4470afdad7919a3917ca0edb766
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.20
|
Security for xfmido 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.