Skip to main content

Extract samples from tracker modules. Supports IT, XM, S3M, MOD, UMX, MPTM

Project description

XMODITS python library

Supported formats:

  • Impulse Tracker .IT
  • Extended Module .XM
  • Scream Tracker .S3M
  • Amiga Pro Tracker .MOD
  • Open ModPlug Tracker .MPTM (Identical to Impulse Tracker sample-wise)
  • Unreal Music Container .UMX (Containing the above formats)

How to use

import xmodits

file = "~/Downloads/music.xm"
folder = "~/Music/samples/"

# Rip samples to folder
xmodits.dump(file, folder)

Required Arguments

Argument Meaning
Path Path to a tracker module
Destination Destination folder for ripped samples

Additional Arguments

Argument Definition
with_folder Create a new folder for ripped samples.
e.g. When set to True, "drums.it" will create "drums_it" in the destination folder and place those samples there.
index_padding Set padding.
e.g. "01 - kick.wav" --> "1 - kick.wav"
index_only Only name samples with a number.
e.g. "09 - HiHat.wav" --> "09.wav"
index_raw Preserves the internal sample indexing
upper Name samples in upper case
lower Name samples in lower case
strict Enabled by default.
Will reject files that don't match the following file extensions:
[it, xm, s3m, mod, umx, mptm]

Exceptions

They are pretty much self explanitory.

Exception Meaning
SampleExtraction A sample could not be extracted
PartialExtraction Not all of the samples could be extracted
TotalExtraction None of the samples could be extracted
UnsupportedFormat A module format was recognized, but its type is not supported
InvalidModule The file is not a valid tracker module
EmptyModule The tracker module is valid but it has no samples
UnrecognizedFileExtension The file extension was not recognized
NoFormatFound Could not determine a valid format

Additional Examples

Dump samples without names

import xmodits

tracker = "mods/music.xm"
folder  = "samples/"

xmodits.dump(
    tracker,
    folder,

    index_only=True 
)

This produces the following output in folder "samples":

01.wav
02.wav
03.wav
04.wav
...
15 - vocal.wav

Dump samples without padding the index:

import xmodits

tracker = "mods/music.xm"
folder  = "samples/"

xmodits.dump(
    tracker,
    folder,
    index_padding=0 # or 1, both have the same effect
)

Output:

1 - hihat.wav
2 - kick.wav
3 - snare.wav
4 - toms.wav
...
15 - vocal.wav

Samples stored in tracker modules can have an arbitrary index. If you prefer to use this index, include the parameter:

index_raw=True

If you're dumping from multiple modules to the same folder, you're guaranteed to have collisions.

You should include the parameter:

with_folder=True

development:

https://docs.python.org/3/library/venv.html

Create a python virtual environment in this directory:

python -m venv dev

activate virtual environment:

source ./dev/bin/activate

install maturin (crates.io) or from pypi

run test library:

maturin develop

License

The xmodits python library is licensed under the LGPLv3

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

xmodits_py-0.3.5.tar.gz (25.8 kB view details)

Uploaded Source

Built Distributions

xmodits_py-0.3.5-cp37-abi3-win_amd64.whl (189.3 kB view details)

Uploaded CPython 3.7+ Windows x86-64

xmodits_py-0.3.5-cp37-abi3-win32.whl (177.9 kB view details)

Uploaded CPython 3.7+ Windows x86

xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (261.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (252.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (246.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

xmodits_py-0.3.5-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (267.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

xmodits_py-0.3.5-cp37-abi3-macosx_11_0_arm64.whl (234.7 kB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

xmodits_py-0.3.5-cp37-abi3-macosx_10_12_x86_64.whl (244.3 kB view details)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

File details

Details for the file xmodits_py-0.3.5.tar.gz.

File metadata

  • Download URL: xmodits_py-0.3.5.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.1

File hashes

Hashes for xmodits_py-0.3.5.tar.gz
Algorithm Hash digest
SHA256 f9d5489af6c216ca9da55bb06c34837800e7bc43b011a347597c703ff9767b51
MD5 d87f8ebeabf3c9c66e9958de3b586c89
BLAKE2b-256 8740424baab8a35359a468d34eb07ce6dff8758ec5ec488a098473b366e2fa09

See more details on using hashes here.

File details

Details for the file xmodits_py-0.3.5-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for xmodits_py-0.3.5-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bee3c483e29c660870e1ed439b980fdb285331fca6f44421b1ad01f68d385451
MD5 3bd49849a8722704ef216697ac9a9825
BLAKE2b-256 bc2ce8b26d72ac1fce5a3a4b0f40825a61ffdbec55b408e8b89cd03ae7c60cfe

See more details on using hashes here.

File details

Details for the file xmodits_py-0.3.5-cp37-abi3-win32.whl.

File metadata

  • Download URL: xmodits_py-0.3.5-cp37-abi3-win32.whl
  • Upload date:
  • Size: 177.9 kB
  • Tags: CPython 3.7+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.1

File hashes

Hashes for xmodits_py-0.3.5-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 f5c16b752338a0dbc8f7011da27ec705104c03bf68f5594d54ca5b9306f6e4c8
MD5 d85be78414c816afa7cab010281f793e
BLAKE2b-256 04955918a946e922b8b4519daa93dff2b29d08b8f3953d758dbc3b8cfcb6e00c

See more details on using hashes here.

File details

Details for the file xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 275bc025752cfc2093a716fc647e8a167658b89025e193428f08ec0cb328f211
MD5 5bff8612a3a227dff97d1c5fe596c050
BLAKE2b-256 d7377cd625edacb2ca240dcacccd1a8677cad7fa5d6eca105dc8634b875c9302

See more details on using hashes here.

File details

Details for the file xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 db6b0d796ab48a09175e67b1268b0e61d5e32c9fef9fd18ba38b5822fa9b01e8
MD5 b43ff8f515de0d0b42e2ed9a52ebf48b
BLAKE2b-256 6d10b000a8667f5eb7d0216dff9f0a2543995c9b7ccc3d8f8eb5ca6b7e9a33e9

See more details on using hashes here.

File details

Details for the file xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xmodits_py-0.3.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dfb12cb9289587ad8e706aa69a7a73131e4ca2e2ee9b954166be315460648279
MD5 14670757dc2851791926c0b8cbb60b34
BLAKE2b-256 1caab7c6a6c4ac80fa4ded014c91f27e421dd137fb7f6f468d5f14a558f8e33d

See more details on using hashes here.

File details

Details for the file xmodits_py-0.3.5-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for xmodits_py-0.3.5-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 28b680bb420e9416b4537898978c2aadeba7671a586f3671250d1018eb7d5112
MD5 b9f11e756391ac4f2998837e13ef9ac1
BLAKE2b-256 93be1e4d693f85084013fe10a80b10c52aea49c7e393f278fc95efe15fc31a66

See more details on using hashes here.

File details

Details for the file xmodits_py-0.3.5-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for xmodits_py-0.3.5-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b14e9252aae311d0399f316d9bae5d3b64e3e70a2dd1a772b19fe882a553034
MD5 1e19d2c6fa176cf5738365f48a24b881
BLAKE2b-256 70bc833e848f8aac09ca2b54caabc3334d99a09cebcea0e2994212907341e98f

See more details on using hashes here.

File details

Details for the file xmodits_py-0.3.5-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for xmodits_py-0.3.5-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aa1ccde473a7eb3aaa2e3ce850275a4ed289556947d38cf8f6b0365894c91724
MD5 557e34740042a893ce210b84f31f6e12
BLAKE2b-256 1b858120ba01bada6750a593a6d974497c1f5077ca097c2aa302414115993fc9

See more details on using hashes here.

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