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.4.tar.gz (25.8 kB view details)

Uploaded Source

Built Distributions

xmodits_py-0.3.4-cp37-abi3-win_amd64.whl (188.7 kB view details)

Uploaded CPython 3.7+ Windows x86-64

xmodits_py-0.3.4-cp37-abi3-win32.whl (177.2 kB view details)

Uploaded CPython 3.7+ Windows x86

xmodits_py-0.3.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (260.2 kB view details)

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

xmodits_py-0.3.4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (251.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

xmodits_py-0.3.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (245.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

xmodits_py-0.3.4-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (267.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

xmodits_py-0.3.4-cp37-abi3-macosx_11_0_arm64.whl (234.1 kB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

xmodits_py-0.3.4-cp37-abi3-macosx_10_12_x86_64.whl (243.5 kB view details)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: xmodits_py-0.3.4.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.4.tar.gz
Algorithm Hash digest
SHA256 20d0d277581c534e17db34584ec0de4d47596edc47698eeb1304079b076e99d0
MD5 9e1c8883d6be1262aa215ff2b83ce97d
BLAKE2b-256 cfab6f04932fb5771a55d2c9cbba2e2d88b76dacf9a6dd21650e48f1451d14ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xmodits_py-0.3.4-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f8f79bc54e6804cd0288e8b80256447b7b2a9d7c0f8b905e2294886c0b13244d
MD5 22660cc734385a5db4116cc3ea44f269
BLAKE2b-256 76fae99148913557e3d9586969c67f7388e87094e4224e71f6af515204bfa3bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xmodits_py-0.3.4-cp37-abi3-win32.whl
  • Upload date:
  • Size: 177.2 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.4-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 92b2bc2faae57445669bf018d758b17e4452c3793ab0d6cf13fd391f907ef6a8
MD5 4c46ddd7a2a050e1cbbbd4e4001c8426
BLAKE2b-256 76c0089c4e74f6f1329fcf90c47d50cc58aa093935d456dd8c7cb395581cb5d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xmodits_py-0.3.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d2840b7c712390ec087861a6af18fd47e3f75cac4f78561dad924b7c6f02735e
MD5 a2d2d994de8805ada9f78c4c4fe7e408
BLAKE2b-256 fb3ab63ff0ec8076c2218719a2f715cb96b03711db3cfb1e64337c9611cdf0f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xmodits_py-0.3.4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 7d395609501f85346639f29241a3b7c48f6f38038f3271032556bd0303765144
MD5 a23647b817bbf4dd46c2666023be0606
BLAKE2b-256 ffa676b60d20e55196d3223f08a6e965200c3457edfa1c3b8f90b5dca1b48471

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xmodits_py-0.3.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a79b763b2379c2fe105f7cb50c63ed9d74af4f08db11162292e642bbca0a7b3b
MD5 a9f4ff460d247c0f5a5c9a8466e33371
BLAKE2b-256 f60485bdeefd7835c3a495dd7e8a1ddd82d8ff5cd7b4bb456f9ffd5bc4ab7bd1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xmodits_py-0.3.4-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 7aad12e55450a9a07797073d4bb0b1061b7397e41d03b555b0d1af5ed247ee4a
MD5 9499a1d9f73105e387c1dc510b80f842
BLAKE2b-256 9b96f91f3a164c98d34041c7a3fb948a523d932bdb4dd8fa8aec3b98eb61ba46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xmodits_py-0.3.4-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05eb3064191ade5fcbb26432f79d7a7763792bf27820d9ddfd5c150b092e3fc3
MD5 a9f73b8398e25c4c9d207f60b42aae6e
BLAKE2b-256 d18e54f0c1a53a7bf28bd314983b2ef10a936f801a2d012fdfc573d02419faff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xmodits_py-0.3.4-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8c0e64e3137eaa3e70c3f6a7e95b0fe04fb52b403ecd9fd5bc5d88cc826f47fa
MD5 eddedfc59cef8ce12986ebd8d4ae5a6d
BLAKE2b-256 1df8cdb7fc4ecdc51ce9721a467d9523b09e8ee868028b726f37403e44ce819e

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