Prezzodaman / pymod

Python program that plays/renders ProTracker modules using PyAudio
https://verycheapwebsite.rf.gd/pymod
GNU General Public License v3.0
9 stars 1 forks source link
mod-files module-player protracker python3

Pymod

An Amiga module player/renderer written in Python! It uses PyAudio for real-time playback, so you'll need to install PortAudio for it to work (more information below). I've included a bunch of test modules that I made myself; they're free for anyone to use, for testing their players.

Features

Installation

Pymod requires at least Python 3.8. You can install it by installing pip and typing the following in a terminal window:

pip install pymod

You will also need to install portaudio, which is required by PyAudio. On macOS you can do this via brew:

brew install portaudio

Usage

Pymod can be used to play a module from the command line:

pymod <options> <path to .mod file> <play mode>

Pymod can also be imported into your Python programs and used as a module:

import pymod

module = pymod.Module(<path_to_mod_file>)

if module is not None:
    module.play()

or

import pymod

module = pymod.Module(<path_to_mod_file>)

if module is not None:
    module.render_to(<path_to_wav_file_to_render_to>, <optional flag to render channels separately>)

The Module instance also has these methods:

By default, the sample rate is 44100 Hz and the play mode is mono. These can be changed on init by specifying the optional arguments sample_rate and play_mode. verbose, legacy, quiet, amplify and interpolate can also be specified as arguments.

Unit testing

Unit tests can be run by using pytest. These tests run against a set of pre-generated wav files to make sure that the output is consistent across changes.

These test files can be re-generated, when a change requires it, by running Python in interactive mode from the project's root folder and typing:

import sys
import os
sys.path.insert(0, os.getcwd())
import pymod
pymod.Module._generateTestFiles()

Remarks

Supported effects

Pymod exclusive effects (per-channel)

Note: in legacy mode, these will do nothing!

Thanks