Metadata-Version: 2.4
Name: mftd
Version: 0.3.0
Summary: Python Midi Fighter Twister configuration for Touch Designer
Author-email: Gary Tyler <mail@garytyler.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/garytyler/mftd
Project-URL: Repository, https://github.com/garytyler/mftd
Project-URL: Issues, https://github.com/garytyler/mftd/issues
Keywords: midi,midi-fighter-twister,touchdesigner,hardware-controller,dj-controller
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio :: MIDI
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: python-rtmidi>=1.5.8
Provides-Extra: dev
Requires-Dist: pytest>=6.2.5; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-mock>=3.6.1; extra == "dev"
Requires-Dist: inline-importer>=0.0.4; extra == "dev"
Requires-Dist: ruff>=0.13.1; extra == "dev"
Requires-Dist: mypy>=1.18.2; extra == "dev"
Dynamic: license-file

# mftd

A thin, adaptable API for programatically configuring [Midi Fighter Twister](https://www.midifighter.com/#Twister) midi controllers, and integrating them in Touch Designer projects.

### Firmware support

**0.3.0 and later target the 2026 firmware** (build `2026-06-01` or newer — the
Midi Fighter Utility gates the same behaviour on `fw_version >= 0x20230c11`).

That release renumbered two enums *by insertion*, so running 0.3.0 against
older firmware fails silently rather than loudly — the stale value selects a
different, valid function:

| Value | Pre-2026 meaning | 2026 meaning |
| ----- | ---------------- | ------------ |
| `EncoderSwitchActionType` 6 | Shift Encoder (Hold) | Encoder Fine Adjust |
| `SideSwitchAction` 12 | Cycle Bank | Bank 2 |

Use 0.2.0 for pre-2026 firmware. 0.3.0 also adds device config addresses
33–38 (colour map, animation channels, sleep timer and animation, bank change
animations), which older firmware does not report — `get_device_config()`
raises on a response missing any declared address.

### Build

Generate inlined source using [`inline-importer`](https://inline-importer.readthedocs.io/en/latest/):

```shell
# Prepare destination
rm -f dist/mftd.py
mkdir -p dist

# Build
inline-python -p mftd -e mftd/__init__.py -o dist/mftd.py
```

### Touch Designer Usage

When running inside TouchDesigner the library uses a `midioutCHOP` named `midiOut` to communicate with the Midi Fighter Twister. The library will create this operator if it is missing.
