CLI tool for working with the Mega Drive MIDI Interface (MDMI)
Project description
Mega Drive MIDI Interface CLI
CLI for controlling the Mega Drive MIDI Interface (MDMI). Helps you load presets from instrument files, clear presets, list WOPN instruments, and test connectivity.
Features
- Load presets from instrument files:
- Dump presets from MDMI to files (DMP or TFI format)
- Dump FM channel parameters from MDMI to files (DMP or TFI format)
- Clear presets. Individual user presets or all presets at once
- List WOPN instruments
- Connectivity testing: Ping/pong functionality to test MDMI connectivity
- Performance testing: Continuous latency measurement with statistics and histogram generation
Installation
Latest version from PyPI:
pip install mdmi-cli
Usage
Load a preset
# Load TFI preset to program 0
mdmi load-preset example.tfi --program 0
# Load DMP preset to program 5
mdmi load-preset example.dmp --program 5
# Load specific WOPN instrument to program 10
mdmi load-preset soundbank.wopn --program 10 --bank 0 --instrument 5 --bank-type melody
Dump presets
# Dump preset from program 5 to DMP file
mdmi dump-preset --program 5 --format dmp --filename my_preset.dmp
# Dump preset with auto-generated filename (preset_5.dmp)
mdmi dump-preset --program 5
# Dump preset to TFI file
mdmi dump-preset --program 10 --format tfi --filename my_preset.tfi
Dump FM channel parameters
# Dump FM channel parameters from MIDI channel 5 to DMP file
mdmi dump-channel --channel 5 --format dmp --filename channel_5.dmp
# Dump with auto-generated filename (channel_05.dmp)
mdmi dump-channel --channel 5
# Dump to TFI file
mdmi dump-channel --channel 3 --format tfi --filename channel_3.tfi
WOPN file management
# List contents of a WOPN file (first 10 instruments per bank)
mdmi list-wopn soundbank.wopn
# List all instruments in WOPN file
mdmi list-wopn soundbank.wopn --full
# Load percussion instrument from WOPN
mdmi load-preset soundbank.wopn --program 20 --bank 0 --instrument 3 --bank-type percussion
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
Test connectivity
# Test MDMI connectivity with ping/pong
mdmi ping
# Test with custom timeout
mdmi ping --timeout 10.0
Performance testing
# Run continuous ping/pong latency test (stop with Ctrl+C)
mdmi perf-test
# Run test for specific duration with custom interval
mdmi perf-test --duration 30 --interval 0.05
# Customize histogram filename
mdmi perf-test --hist-filename my_latency_test.png
# Test with custom timeout for individual pings
mdmi perf-test --timeout 1.0 --duration 60
List available MIDI ports
# List all available MIDI input and output ports
mdmi list-ports
Common Options
All commands support these common options:
MIDI Port Selection
# Use specific MIDI ports instead of environment variables
mdmi load-preset example.tfi --program 0 --midi-out "IAC Driver Bus 1"
# Commands with bidirectional communication support input ports
mdmi ping --midi-out "IAC Driver Bus 1" --midi-in "IAC Driver Bus 2"
mdmi dump-preset --program 5 --midi-out "Port 1" --midi-in "Port 2"
Dry Run
# Test with fake interface (no real MIDI hardware required)
mdmi load-preset example.tfi --program 0 --dry-run
mdmi perf-test --dry-run --duration 5
mdmi ping --dry-run
Timeout
# Custom timeouts for bidirectional commands
mdmi ping --timeout 10.0
mdmi dump-preset --program 3 --timeout 5.0
Configuration
Environment Variables
MDMI_MIDI_OUT: Default MIDI output port nameMDMI_MIDI_IN: Default MIDI input port nameMDMI_MIDI_PORT: Legacy fallback for MIDI output port
Command-line Options
--midi-out TEXT: MIDI output port name (overrides environment variables)--midi-in TEXT: MIDI input port name for bidirectional commands (overridesMDMI_MIDI_IN)--dry-run: Use fake MIDI interface for testing--timeout FLOAT: Timeout for bidirectional commands (default varies by command)
Development
Build
# Install cli (from source)
make install
# Run tests
make test
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.8.0.tar.gz.
File metadata
- Download URL: mdmi_cli-0.8.0.tar.gz
- Upload date:
- Size: 37.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f55e054df3b316234dd82ea9cf37d0b14183fa2c00c24f10baa3a0aa21c97cd
|
|
| MD5 |
c9ca7fadbe33fd0abeb1f94ca128195a
|
|
| BLAKE2b-256 |
36bd656d791060d4cdeda435ac60ff97a1f1e937736faab3721ea6211f59136a
|
Provenance
The following attestation bundles were made for mdmi_cli-0.8.0.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.8.0.tar.gz -
Subject digest:
2f55e054df3b316234dd82ea9cf37d0b14183fa2c00c24f10baa3a0aa21c97cd - Sigstore transparency entry: 547730258
- Sigstore integration time:
-
Permalink:
rhargreaves/mdmi-cli@b8c00c6436fb595886e400932d76267ce4e9ec3a -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/rhargreaves
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b8c00c6436fb595886e400932d76267ce4e9ec3a -
Trigger Event:
push
-
Statement type:
File details
Details for the file mdmi_cli-0.8.0-py3-none-any.whl.
File metadata
- Download URL: mdmi_cli-0.8.0-py3-none-any.whl
- Upload date:
- Size: 31.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2dbf3d4c2766dbaa6a7b485edf04dc96de0bba4936e64ee5dfc706ae4d14685
|
|
| MD5 |
7cf6db299e5ead16724975cdcae6fd79
|
|
| BLAKE2b-256 |
a731b52335c6ec0c6d4f4807e6b6a53aef38b6f318bb5c41b0150630bbfd0d86
|
Provenance
The following attestation bundles were made for mdmi_cli-0.8.0-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.8.0-py3-none-any.whl -
Subject digest:
d2dbf3d4c2766dbaa6a7b485edf04dc96de0bba4936e64ee5dfc706ae4d14685 - Sigstore transparency entry: 547730265
- Sigstore integration time:
-
Permalink:
rhargreaves/mdmi-cli@b8c00c6436fb595886e400932d76267ce4e9ec3a -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/rhargreaves
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b8c00c6436fb595886e400932d76267ce4e9ec3a -
Trigger Event:
push
-
Statement type: