Skip to main content

No project description provided

Project description

XMODITS python library

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 <venv>/bin/activate

install maturin (crates.io) or from pipi

run test library:

maturin develop

API (In progress)

Dump samples to a folder

import xmodits

# dump samples to "samples/" 
tracker = "mods/music.xm"
folder  = "samples/"

xmodits.dump(tracker, folder)

This produces the following output in folder "samples":

01 - hihat.wav
02 - kick.wav
03 - snare.wav
04 - toms.wav
...
15 - vocal.wav

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 arbitary index. If you prefer to use this index, include the parameter:

index_raw=True

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

You should include the parameter:

with_folder=True

It will produce a new folder within the destination folder

Required Arguments

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

Additional Arguments

Argument Meaning
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 Sample number will be identical

Exceptions

They're pretty much self explanitory.

Exception Meaning
SampleExtractionError xmodits could not rip a sample.
UnsupportedFormatError
InvalidModuleError
EmptyModuleError The tracker module is valid but it has no samples!

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.1.0.tar.gz (8.7 MB view hashes)

Uploaded Source

Built Distributions

xmodits_py-0.1.0-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (199.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

xmodits_py-0.1.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (200.6 kB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

xmodits_py-0.1.0-cp310-none-win_amd64.whl (147.2 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

xmodits_py-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (199.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

xmodits_py-0.1.0-cp39-none-win_amd64.whl (147.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

xmodits_py-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (199.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

xmodits_py-0.1.0-cp38-none-win_amd64.whl (147.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

xmodits_py-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (199.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

xmodits_py-0.1.0-cp37-none-win_amd64.whl (147.2 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

xmodits_py-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (199.3 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

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