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

Example

Most basic mod decoding

import libxmplite

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

xmp = libxmplite.Xmp()
xmp.load("amiga.mod")
xmp.start(44100)

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

frame_info = xmp.play_frame()

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

xmp.release()

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.

Files for libxmplite, version 1.3
Filename, size File type Python version Upload date Hashes
Filename, size libxmplite-1.3-cp37-cp37m-linux_armv7l.whl (126.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size libxmplite-1.3-cp37-cp37m-win32.whl (74.9 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size libxmplite-1.3-cp37-cp37m-win_amd64.whl (86.5 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size libxmplite-1.3.tar.gz (213.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page