CLI tool for working with the Mega Drive MIDI Interface (MDMI)
Project description
Mega Drive MIDI Interface CLI
Python CLI for controlling the Mega Drive MIDI Interface (MDMI). Supports loading presets in WOPN, DMP, and TFI formats with instrument selection for WOPN files.
Features
- Multi-format preset support: Load presets in WOPN, DMP, and TFI formats to MDMI user presets (programs 0-127)
- Advanced WOPN support: Choose specific bank, instrument, and bank type (melody/percussion) from WOPN files
- Intelligent format detection: Automatic detection of preset formats based on file headers and structure
- Preset management: Clear individual user presets or all presets at once
- WOPN browsing: List WOPN file contents to explore available banks and instruments
- Flexible MIDI support: Works with both real MIDI hardware and fake interface for testing
- Comprehensive testing: Full test coverage including real-world data validation
Installation (from PyPi)
pip install mdmi-cli
Installation (from source)
make install
Build
Add Requirements
pip install -r requirements.txt
Usage
Load a preset
# Load TFI preset to program 0
mdmi load-preset example.tfi --program 0
# Load DMP preset to program 5 via real MIDI port
mdmi load-preset example.dmp --program 5 --port "USB MIDI Interface"
# Load specific WOPN instrument to program 10
mdmi load-preset soundbank.wopn --program 10 --bank 0 --instrument 5 --bank-type melody
# List available MIDI ports
mdmi list-ports
WOPN file management
# List contents of a WOPN file
mdmi list-wopn soundbank.wopn
# Load percussion instrument from WOPN
mdmi load-preset soundbank.wopn --program 20 --bank 0 --instrument 3 --bank-type percussion
# Load from different melody bank
mdmi load-preset soundbank.wopn --program 15 --bank 1 --instrument 65 --bank-type melody
Clear presets
# Clear preset at program 5
mdmi clear-preset --program 5
# Clear all presets (with confirmation)
mdmi clear-all-presets
# Clear all presets (skip confirmation)
mdmi clear-all-presets --confirm
Supported Formats
TFI (42 bytes)
- Direct YM2612 FM parameter files
- Algorithm and feedback as separate bytes
- 4 operators with 10 bytes each
- Commonly used with Deflemask and other trackers
DMP (DefleMask preset format)
- Version 8: Basic FM parameters with operator data
- Version 9: Enhanced format with additional features
- Version 11: Full format with system type specification
- Automatic version detection and proper parsing
- Support for both
.DMPsignature and direct version byte formats
WOPN (libOPNMIDI bank format)
- Multi-bank instrument collections with proper
WOPN2-B2NKheader support - Separate melody and percussion banks
- Advanced instrument selection by bank index and instrument index
- Bank type selection (melody/percussion)
- Comprehensive bank browsing with
list-wopncommand - Support for multiple banks per type
Development
Running Tests
# Run all tests
make test
Dependencies
- click: Command-line interface framework for robust CLI development
- mido: MIDI library for hardware communication and SysEx handling
- bitstruct: Binary data parsing library for efficient preset format parsing
- pytest: Testing framework for comprehensive test coverage
License
This project is open source. Please check the license file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdmi_cli-0.1.1.tar.gz.
File metadata
- Download URL: mdmi_cli-0.1.1.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a2df7f35a56f643439318f21987eae93750bef0ea3dd2db0cafe8aa4f6436cf
|
|
| MD5 |
4f727ed4ea6c7f015980188ee4c26f5a
|
|
| BLAKE2b-256 |
59f395113d0f0e815e9e3e1053377b83319fc9efcee351f026c6713bfd37a4fe
|
Provenance
The following attestation bundles were made for mdmi_cli-0.1.1.tar.gz:
Publisher:
publish.yml on rhargreaves/mdmi-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mdmi_cli-0.1.1.tar.gz -
Subject digest:
4a2df7f35a56f643439318f21987eae93750bef0ea3dd2db0cafe8aa4f6436cf - Sigstore transparency entry: 229008200
- Sigstore integration time:
-
Permalink:
rhargreaves/mdmi-cli@b79178f8eb49af91b487d5c2864468a246813a4b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/rhargreaves
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b79178f8eb49af91b487d5c2864468a246813a4b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mdmi_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mdmi_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07eaf67089bfb387f0a319310a8df320a4647f844907740d5d38ce49c1e4ae15
|
|
| MD5 |
6eefd026a98d6daa803660471e861b5f
|
|
| BLAKE2b-256 |
e6253818087b6e16717653dee1d2b0ab032c274de0125295ad0356ab2afc5a99
|
Provenance
The following attestation bundles were made for mdmi_cli-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on rhargreaves/mdmi-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mdmi_cli-0.1.1-py3-none-any.whl -
Subject digest:
07eaf67089bfb387f0a319310a8df320a4647f844907740d5d38ce49c1e4ae15 - Sigstore transparency entry: 229008202
- Sigstore integration time:
-
Permalink:
rhargreaves/mdmi-cli@b79178f8eb49af91b487d5c2864468a246813a4b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/rhargreaves
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b79178f8eb49af91b487d5c2864468a246813a4b -
Trigger Event:
workflow_dispatch
-
Statement type: