A modified version of the Mido library to handle XF format MIDI files.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xfmido-0.0.2.tar.gz.
File metadata
- Download URL: xfmido-0.0.2.tar.gz
- Upload date:
- Size: 64.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6599ebf4521e95619a327f583442d82c64312089567c868a5a241307537a0a04
|
|
| MD5 |
b13df85bb26c01579891ef26c74d60e7
|
|
| BLAKE2b-256 |
21d3417d7b2b391e1fdae0952b983ea7e0a83db39ff7193386510f0a121b1c22
|
File details
Details for the file xfmido-0.0.2-py3-none-any.whl.
File metadata
- Download URL: xfmido-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
579e5bc2d5033c6079ab5be758601cb3d8f6dd4d74adebe4d70b8a03dc228304
|
|
| MD5 |
f53c9bdf31f28452f4021b0ddd3f28d4
|
|
| BLAKE2b-256 |
33274798c74d372a88ad49794d29caa0a012b4470afdad7919a3917ca0edb766
|