{"id":34113090,"url":"https://github.com/rhargreaves/mdmi-cli","last_synced_at":"2026-04-04T22:05:44.170Z","repository":{"id":296892857,"uuid":"994862678","full_name":"rhargreaves/mdmi-cli","owner":"rhargreaves","description":"CLI for controlling the Mega Drive MIDI Interface","archived":false,"fork":false,"pushed_at":"2025-09-22T21:13:49.000Z","size":161,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-18T16:52:33.628Z","etag":null,"topics":["mega-drive","midi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhargreaves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-02T15:40:55.000Z","updated_at":"2025-10-13T20:24:18.000Z","dependencies_parsed_at":"2025-06-03T06:18:49.349Z","dependency_job_id":"20e0b91d-6b0c-43d1-a0b1-d9b750b8968a","html_url":"https://github.com/rhargreaves/mdmi-cli","commit_stats":null,"previous_names":["rhargreaves/mdmi-cli"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rhargreaves/mdmi-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhargreaves%2Fmdmi-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhargreaves%2Fmdmi-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhargreaves%2Fmdmi-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhargreaves%2Fmdmi-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhargreaves","download_url":"https://codeload.github.com/rhargreaves/mdmi-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhargreaves%2Fmdmi-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30627192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T14:16:03.965Z","status":"ssl_error","status_checked_at":"2026-03-17T14:16:03.380Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mega-drive","midi"],"created_at":"2025-12-14T19:08:27.248Z","updated_at":"2026-04-04T22:05:44.158Z","avatar_url":"https://github.com/rhargreaves.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mega Drive MIDI Interface CLI\n\n[![PyPI](https://img.shields.io/pypi/v/mdmi-cli)](https://pypi.org/project/mdmi-cli/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mdmi-cli)](https://pypi.org/project/mdmi-cli/)\n[![PyPI - License](https://img.shields.io/pypi/l/mdmi-cli)](https://github.com/rhargreaves/mdmi-cli/blob/main/LICENSE)\n[![Build](https://github.com/rhargreaves/mdmi-cli/actions/workflows/build.yml/badge.svg)](https://github.com/rhargreaves/mdmi-cli/actions/workflows/build.yml)\n\nCLI for controlling the [Mega Drive MIDI Interface (MDMI)](https://github.com/rhargreaves/mega-drive-midi-interface). Helps you load presets from instrument files, clear presets, list WOPN instruments, and test connectivity.\n\n## Features\n\n* Load presets from instrument files:\n    * DefleMask preset versions 8, 9 and 11\n    * [WOPN](https://github.com/Wohlstand/libOPNMIDI/blob/master/fm_banks/wopn%20specification.txt) versions 1 and 2, as used by libOPNMIDI\n    * [TFI](https://vgmrips.net/wiki/TFI_File_Format)\n* Dump presets from MDMI to files (DMP or TFI format)\n* Dump FM channel parameters from MDMI to files (DMP or TFI format)\n* Clear presets. Individual user presets or all presets at once\n* List WOPN instruments\n* Connectivity testing: Ping/pong functionality to test MDMI connectivity\n* Performance testing: Continuous latency measurement with statistics and histogram generation\n\n## Installation\n\nLatest version from PyPI:\n\n```bash\npip install mdmi-cli\n```\n\n## Usage\n\n### Load a preset\n\n```bash\n# Load TFI preset to program 0\nmdmi load-preset example.tfi --program 0\n\n# Load DMP preset to program 5\nmdmi load-preset example.dmp --program 5\n\n# Load specific WOPN instrument to program 10\nmdmi load-preset soundbank.wopn --program 10 --bank 0 --instrument 5 --bank-type melody\n```\n\n### Dump presets\n\n```bash\n# Dump preset from program 5 to DMP file\nmdmi dump-preset --program 5 --format dmp --filename my_preset.dmp\n\n# Dump preset with auto-generated filename (preset_5.dmp)\nmdmi dump-preset --program 5\n\n# Dump preset to TFI file\nmdmi dump-preset --program 10 --format tfi --filename my_preset.tfi\n```\n\n### Dump FM channel parameters\n\n```bash\n# Dump FM channel parameters from MIDI channel 5 to DMP file\nmdmi dump-channel --channel 5 --format dmp --filename channel_5.dmp\n\n# Dump with auto-generated filename (channel_05.dmp)\nmdmi dump-channel --channel 5\n\n# Dump to TFI file\nmdmi dump-channel --channel 3 --format tfi --filename channel_3.tfi\n```\n\n### WOPN file management\n\n```bash\n# List contents of a WOPN file (first 10 instruments per bank)\nmdmi list-wopn soundbank.wopn\n\n# List all instruments in WOPN file\nmdmi list-wopn soundbank.wopn --full\n\n# Load percussion instrument from WOPN\nmdmi load-preset soundbank.wopn --program 20 --bank 0 --instrument 3 --bank-type percussion\n```\n\n### Clear presets\n\n```bash\n# Clear preset at program 5\nmdmi clear-preset --program 5\n\n# Clear all presets (with confirmation)\nmdmi clear-all-presets\n\n# Clear all presets (skip confirmation)\nmdmi clear-all-presets --confirm\n```\n\n### Test connectivity\n\n```bash\n# Continuously ping MDMI (stop with Ctrl+C)\nmdmi ping\n\n# Send exactly 5 pings\nmdmi ping -n 5\n\n# Add 16 bytes of extra packet data\nmdmi ping --size 16\n\n# Use a custom timeout\nmdmi ping --timeout 10.0\n```\n\n`ping` now behaves like a standard network ping: it runs continuously by default, supports `-n/--count` to stop after a fixed number of packets, and supports `--size` to append additional packet data after the ping ID.\n\n### Performance testing\n\n```bash\n# Run continuous ping/pong latency test (stop with Ctrl+C)\nmdmi perf-test\n\n# Run test for specific duration with custom interval\nmdmi perf-test --duration 30 --interval 0.05\n\n# Customize histogram filename\nmdmi perf-test --hist-filename my_latency_test.png\n\n# Test with custom timeout for individual pings\nmdmi perf-test --timeout 1.0 --duration 60\n```\n\n### List available MIDI ports\n\n```bash\n# List all available MIDI input and output ports\nmdmi list-ports\n```\n\n## Common Options\n\nAll commands support these common options:\n\n### MIDI Port Selection\n\n```bash\n# Use specific MIDI ports instead of environment variables\nmdmi load-preset example.tfi --program 0 --midi-out \"IAC Driver Bus 1\"\n\n# Commands with bidirectional communication support input ports\nmdmi ping --midi-out \"IAC Driver Bus 1\" --midi-in \"IAC Driver Bus 2\"\nmdmi dump-preset --program 5 --midi-out \"Port 1\" --midi-in \"Port 2\"\n```\n\n### Dry Run\n\n```bash\n# Test with fake interface (no real MIDI hardware required)\nmdmi load-preset example.tfi --program 0 --dry-run\nmdmi perf-test --dry-run --duration 5\nmdmi ping --dry-run\n```\n\n### Timeout\n\n```bash\n# Custom timeouts for bidirectional commands\nmdmi ping --timeout 10.0\nmdmi dump-preset --program 3 --timeout 5.0\n```\n\n## Configuration\n\n### Environment Variables\n\n- **`MDMI_MIDI_OUT`**: Default MIDI output port name\n- **`MDMI_MIDI_IN`**: Default MIDI input port name\n- **`MDMI_MIDI_PORT`**: Legacy fallback for MIDI output port\n\n### Command-line Options\n\n- `--midi-out TEXT`: MIDI output port name (overrides environment variables)\n- `--midi-in TEXT`: MIDI input port name for bidirectional commands (overrides `MDMI_MIDI_IN`)\n- `--dry-run`: Use fake MIDI interface for testing\n- `--timeout FLOAT`: Timeout for bidirectional commands (default varies by command)\n\n## Development\n\n### Build\n\n```bash\n# Install cli (from source)\nmake install\n\n# Run tests\nmake test\n```\n\n### Release\n\n1. Bump the version in `mdmi/__init__.py`\n2. Add a version tag: `git tag v...`\n3. Push the tags: `git push --tags`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhargreaves%2Fmdmi-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhargreaves%2Fmdmi-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhargreaves%2Fmdmi-cli/lists"}