mod-sample-extractor
v2.0.0
Published
CLI tools for inspecting and extracting data from MOD files
Maintainers
Readme
mod-tools
mod-tools is a Node.js command-line tool for inspecting and extracting data from ProTracker MOD files.
Prerequisites
Node.js:
This tool requires Node.js (version 10 or higher). If you don't have Node.js installed, please follow these steps:Download and Install:
Visit the official Node.js website and download the installer for your operating system. Follow the installation instructions provided on the website.Verify Installation:
Once installed, open a terminal or command prompt and run:node -vThis should output the version of Node.js you installed.
Installation
To install the tool, run:
npm install -g mod-sample-extractorAlternate Installation
In case it has been 10 years and the npm package repository ceased to exist, you can still clone this repository and run the tool manually:
- Clone the Repository:
git clone https://github.com/andorthehood/mod-sample-extractor.git
cd mod-sample-extractor- Install
npm install
npm run build
npm install -g .Development
Build the publishable JavaScript and type declarations:
npm run buildCommands
Inspect
Print a readable summary:
mod-tools inspect path/to/yourfile.modPrint JSON:
mod-tools inspect path/to/yourfile.mod --jsonExtract Samples
Write one raw PCM file per non-empty sample plus sample_meta.8f4e:
mod-tools extract-samples path/to/yourfile.mod --output-dir out/samplesExtract Patterns
Write one raw pattern file per channel plus patterns_order.8f4e:
mod-tools extract-patterns path/to/yourfile.mod --output-dir out/patternsExtract Everything
Run both extraction steps into one directory:
mod-tools extract-all path/to/yourfile.mod --output-dir out/modThe tool reads the provided MOD file, parses the header, order table, pattern data, and sample descriptors, then writes the selected outputs.
PCM Specification
Each PCM file exported by the tool has the following characteristics:
- Format: Raw PCM data (no header or metadata)
- Bit Depth: 8-bit (signed)
- Channel: Mono
