Skip to main content

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

  • This project uses uv for package management.
  • This project uses taskipy for command management.
uv run task test
uv run task lint
uv run task format

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)

Source distribution for xfmido 0.0.2
File Size Uploaded
xfmido-0.0.2.tar.gz 64.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xfmido 0.0.2
File Interpreter ABI Platform
xfmido-0.0.2-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page