TrackMod
A tracker module is a complete piece of music in one file. It holds the notes, the effects and the recorded sounds together. TrackMod reads these files, gives you what is inside, and writes them back.
TrackMod supports five formats:
| Tracker | Module | Single instrument |
|---|---|---|
| Impulse Tracker | .it |
.iti |
| FastTracker 2 | .xm |
.xi |
| Amiga ProTracker | .mod |
— |
| Scream Tracker 3 | .s3m |
— |
| Soundtracker | .mod |
— |
All five formats share one model of a song. This lets you:
- open a file written by one tracker and save it for another,
- check whether a song fits a format before you write it.
TrackMod does not play audio. It gives you the notes, the settings and the waveforms. Use a player to hear them.
What you can do with it
- Read a module and get the song inside: its patterns, their order, the instruments and the waveforms.
- Write a song in any of the five formats.
- Check the file size and find values the format cannot store, before you write.
- Convert a song from one format to another.
- Save an instrument as an
.itior.xifile. - Save a waveform as a
.wavfile.
Installing
TrackMod needs Python 3.12 or newer. Install it from PyPI:
pip install trackmod
or add it to a uv project:
uv add trackmod
This also installs the two libraries TrackMod uses, numpy and pydantic.
Reading a file
from pathlib import Path
from trackmod import load_module
module = load_module(Path("song.it"))
print(module.song.name)
print(module.song.patterns[0].cell(row=0, channel=3))
TrackMod reads the format from the file contents, not from its name. A file with a wrong or missing extension still opens.
Writing a song
Pass a song to a format class. You get a module, which can:
- tell you how large the file will be,
- list the values the format cannot store,
- write the file.
from pathlib import Path
from trackmod import Compliance, ITModule
module = ITModule.from_song(song, compliance=Compliance.CANONICAL)
print(module.size().total) # how many bytes the file will take
print(module.violations()) # values the format cannot store, empty when the song is writable
module.save(Path("song.it"))
Compliance sets how strict the check is. See docs/reference/limits.md.
To write the same song in another format, use another class:
from trackmod import XMModule
XMModule.from_song(song, compliance=Compliance.EXTENDED).save(Path("song.xm"))
Saving instruments and waveforms
from pathlib import Path
from trackmod import Compliance, ITInstrumentFile, load_module, save_sample, units
sounds = Path("sounds")
for path in Path("modules").iterdir():
module = load_module(path)
for index, unit in enumerate(units(module.song.voices)):
instrument = ITInstrumentFile.from_unit(unit, compliance=Compliance.CANONICAL)
instrument.save(sounds / f"{path.stem}-{index:02d}.iti")
for index, sample in enumerate(module.song.voices.samples):
save_sample(sample, sounds / f"{path.stem}-{index:02d}.wav")
units gives you every instrument with the waveforms it plays. It works the same for all five formats.
Each .wav file keeps the loop points, the tuning, the volume, the panning and the auto-vibrato. You can
open these files in a tracker or in any audio editor.
Documentation
See docs/:
docs/guide/— how to do each task,docs/reference/— the song model and the format limits,docs/formats/— the byte layout of each format.
Start at docs/README.md. What changed in each release is in
CHANGELOG.md.
Development
docs/contributing/development.md covers the tools, the tests
and the checks a change passes, and docs/contributing/releasing.md
covers how a release reaches PyPI.
License
TrackMod is released under the MIT License.
Release files for trackmod 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| trackmod-0.2.0.tar.gz | 333.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| trackmod-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 623.4 kB
Release files / trackmod-0.2.0.tar.gz
| Download URL | trackmod-0.2.0.tar.gz |
|---|---|
| Size | 333.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bfc65fcb64bc5ddfdd6a30431c3f2b064f60b8d1b8db34d3dfa486618a6a97e
|
|
BLAKE2b-256 checksum How to use checksums |
1c54deec696fb2123aec8f93c502814df29607c7743d67f3aee445190770f3df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / trackmod-0.2.0-py3-none-any.whl
| Download URL | trackmod-0.2.0-py3-none-any.whl |
|---|---|
| Size | 289.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbdd024dded8eb108ad0c4b0f5a622967040b75565823c5a93f122b4fba4c42f
|
|
BLAKE2b-256 checksum How to use checksums |
11ca8c63097afbcb1505cf8e9686166bbfe67a0520588640e243c807dd59bbb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log