Giter Club home page Giter Club logo

xmodits-py's Introduction

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 arbitary 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 pipi

run test library:

maturin develop

License

The xmodits python library is licensed under the LGPLv3

xmodits-py's People

Contributors

b0ney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.