Control napari with a MIDI controller.
Project description
midi-app-controller
midi-app-controller is an app, that allows user to control all applications using 'pyapp-kit/app-model' with a USB MIDI controller.
Documentation
Documentation at https://midi-app-controller.readthedocs.io/en/latest/.
Usage (napari)
MIDI App Controller is a package designed to integrate MIDI controllers with Python Qt apps using app-model. As of now, it is used most commonly with napari, a viewer for multi-dimensional images. We will show how to use MIDI App Controller with napari but getting started with other applications should look very similar.
Installation
To install MIDI App Controller in your environment (where Python and napari are already installed), use this command:
pip install midi-app-controller
napari will automatically detect the package and install the plugin next time it starts.
To install the newest development version, clone the GitHub repo and install it as a local package.
Setup
Launch the plugin from the Plugins menu.
A panel will open to the side.
Controller
If your MIDI controller is supported out of the box, you can simply select the appropriate model. If not, you will need to tell MIDI App Controller how to interact with this model of controller by creating a controller schema.
Once you have selected the controller schema, you can select binds schema.
MIDI ports
If they haven't been selected automatically, select MIDI input and output ports that correspond to your physical controller.
Start handling
After a controller and bindings are selected, you can click "Start handling". This will start a thread that listens to all input from the controller and invokes appropriate commands. You can close the panel with the settings, the thread will work in the background until you click "Stop handling".
Edit binds
Click "Edit binds" to open dialog where you can configure bindings by choosing which physical buttons and knobs on your controller correspond to which commands in the application. Think of it like configuring keyboard shortcuts.
All configurations are simple YAML files which you can copy, share, or edit manually. You can click "Reveal in explorer" to see the exact location of the currently chosen config file. You shouldn't edit built-in presets stored in the package directory; when you edit a built-in preset in the graphical user interface, a copy will automatically be created.
After you save changes, if you have already started handling, you need to click "Restart handling" to start a new server with the changes applied.
Usage without GUI
The library can be also controlled using the singleton of StateManager
class:
from midi_app_controller.state.state_manager import get_state_manager
state = get_state_manager()
# Now the library can be controlled using `state`.
Development
Installing
python3 -m pip install -e .
Testing
python3 -m pip install -e .[testing]
python3 -m pytest --cov .
Testing docs
mkdocs serve -a localhost:8080
Using pre-commit
python3 -m pip install -e .[dev]
pre-commit install
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
File details
Details for the file midi_app_controller-0.1.1.tar.gz
.
File metadata
- Download URL: midi_app_controller-0.1.1.tar.gz
- Upload date:
- Size: 149.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e6a5e1fef6568456dc7d68d74ccbe05ec62e3763bd70a3ee9c1ec0b01094cb0 |
|
MD5 | aa26cc5276ae311116938300d9d8ca2a |
|
BLAKE2b-256 | 80d7e91501714ba36a32e2bf717da47322655e54670b9c447d74b02ab6facd7c |
Provenance
The following attestation bundles were made for midi_app_controller-0.1.1.tar.gz
:
Publisher:
publish.yml
on napari/midi-app-controller
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
midi_app_controller-0.1.1.tar.gz
- Subject digest:
6e6a5e1fef6568456dc7d68d74ccbe05ec62e3763bd70a3ee9c1ec0b01094cb0
- Sigstore transparency entry: 148567294
- Sigstore integration time:
- Predicate type:
File details
Details for the file midi_app_controller-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: midi_app_controller-0.1.1-py3-none-any.whl
- Upload date:
- Size: 159.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6335a46cbaaaefc34b624d09ebac015b611afdda3d38be4e7d538ebcfa1605e |
|
MD5 | f8bc2ebeaa1338f380188f3d71f30ca3 |
|
BLAKE2b-256 | 37a8f569cae5c5e24a5bca3b3484bceaa32740cff3d2c7900acb99e76b48fb80 |
Provenance
The following attestation bundles were made for midi_app_controller-0.1.1-py3-none-any.whl
:
Publisher:
publish.yml
on napari/midi-app-controller
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
midi_app_controller-0.1.1-py3-none-any.whl
- Subject digest:
a6335a46cbaaaefc34b624d09ebac015b611afdda3d38be4e7d538ebcfa1605e
- Sigstore transparency entry: 148567295
- Sigstore integration time:
- Predicate type: