Skip to main content

python bindings for the libxmp-lite modplayer library (protracker, screamtracker, ...)

Project description

saythanks Latest Version

Python libxmp-lite modplayer

This module (pun intented) provides a Python interface to the libxmp-lite (a cut-down version of libxmp library. The libxmp-lite library is linked into the extenson module, no additional fiddling and installation is required.

Requires Python 3.5 or newer. Also works on pypy3 (because it uses cffi).

The library is primarily distributed in source form so you need a C compiler to build and install this (note: the setup script takes care of the actual compilation process, no need to worry about compiling things yourself). For Linux and Mac this shouldn't be a problem. For Windows users, if the correct binary install is not available on pypi, you'll have to get it to compile as well which may be a bit of a hassle on this platform. You have to make sure that the required tools that allow you to compile Python extension modules are installed (Visual Studio or the VC++ build tools).

Software license for these Python bindings: MIT

Software license for the libxmp library: LGPL


Most basic mod decoding

import libxmplite

print("Supported module formats: ", libxmplite.get_formats())

xmp = libxmplite.Xmp()

info = xmp.module_info()    # grab name, comment, number of patterns, ....

frame_info = xmp.play_frame()

# ... process the frame buffer bytes ...
# ... repeat until satisfied


There's also a xmp.play_buffer() method that is more suited to be integrated into an async pull API. It's used in the "modplay" example (which utilizes my other library, miniaudio, for sound playback).

There's also extensive documentation for the underlying libxmp API.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libxmplite-1.1.tar.gz (213.1 kB view hashes)

Uploaded Source

Built Distributions

libxmplite-1.1-cp37-cp37m-win_amd64.whl (86.4 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

libxmplite-1.1-cp37-cp37m-win32.whl (74.8 kB view hashes)

Uploaded CPython 3.7m Windows x86

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page