Skip to main content

MIDI Scripter

PyPI - Python Version GitHub License For

MIDI Scripter is a Python framework for filtering, modifying, routing and any other handling of MIDI, Open Sound Control (OSC), keyboard and mouse input and output.

MIDI Scripter listens to input ports and sends incoming messages to subscribed callables such as functions or methods. These callables, along with other Python code, can send modified or new messages through output ports. MIDI Scripter can serve as a proxy that filters, transforms and converts incoming messages.

In addition, MIDI Scripter features a customizable graphical user interface (GUI) that provides logging, coding assistance, various controls and indicators to use in the script.

All that with no boilerplate and only a few lines of code.

An octave transposer with GUI controls in 10 lines of code:

from midiscripter import *

midi_keyboard = MidiIn('MIDI Keyboard')  # GUI will provide you the port names
proxy_output = MidiOut('To DAW', virtual=True)  # virtual proxy port for output

# GUI widget in a single line
octave_selector = GuiButtonSelectorH(('-2', '-1', '0', '+1', '+2'), select='0')

@midi_keyboard.subscribe  # decorated function will receive port's messages
def transpose(msg: MidiMsg) -> None:
	if msg.type == MidiType.NOTE_ON or msg.type == MidiType.NOTE_OFF:  # filter
		msg.data1 += 12 * int(octave_selector.selected_item_text)  # modify
	proxy_output.send(msg)  # route

if __name__ == '__main__':
	start_gui()  # opens helpful customizable GUI

Screenshot with only octave_selector widget enabled:

Screenshot with only octave_selector widget enabled

Screenshot with Ports and Log widgets enabled:

Screenshot with all the widgets visible

The average latency for the script above is less than 0.25 milliseconds.

Use cases

  • Programming MIDI input/output handling scripts that may also use OSC, keyboard and mouse input/output.
  • Mapping your MIDI controller in your own custom way, from simple MIDI message filtering or conversion to mostly anything you can imagine.
  • Controlling Ableton Live with Python, without diving into it's complex MIDI remote scripting or Max for Live.

Examples

Documentation

MIDI Scripter has fully documented and type hinted API.
Overview and API documentation is available here.

Installation

  1. Install Python 3.11+ including pip.
  2. Run pip install midiscripter.

Extra steps for Windows:

  1. Enable Add python.exe to PATH option in Python installer.
  2. For virtual MIDI port support install loopMIDI and enable Compatible with older Windows MIDI 1.0 port naming in MIDI Settings app. The alternative is setting up loopback ports in MIDI Settings app.

Quick Start Guide

  1. Paste the script template into your Python IDE or a plain text editor. Using IDE is recommended.
  2. Run the template script directly from the IDE or by python your_script.py. This will open the GUI, providing information about available ports and incoming input.
  3. Ensure that the “Show Unused Ports” button located under the port list is activated. Enable the checkboxes for any available ports to open them. Monitor the log for incoming messages.
  4. Click on the port names and messages in the log or port list to copy their declarations to the clipboard. You can paste the declarations into your script. Ctrl + Click copies the arguments.
  5. Rewrite the template function to achieve desired functionality. Use log('messages') for debugging purposes.
  6. Restart the script from the GUI to see how it performs.
  7. Develop more complex scripts by utilizing additional inputs, outputs and functions (callables). Subscribe new callables to input messages using the @input_port.subscribe decorator.

License

MIDI Scripter assets and code is under LGPL 3.0 license.
The code that use it can have any license.

Metadata

Release files for midiscripter 0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for midiscripter 0.9
File Size Uploaded
midiscripter-0.9.tar.gz 96.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for midiscripter 0.9
File Interpreter ABI Platform
midiscripter-0.9-py3-none-any.whl Python 3 none any Details

Total release size: 214.9 kB

Release files / midiscripter-0.9.tar.gz

Download URL midiscripter-0.9.tar.gz
Size 96.0 kB
Tags Source
SHA-256 checksum
How to use checksums
eb1f450a48ef913f0abb9eb09deddea3c6fc8c968d4663bed26be0cef0aaf0ab
BLAKE2b-256 checksum
How to use checksums
19fd1001aed0ea88f1fed1e4e0a55be25ddcf97dab5365c9cc80ab28d443a399
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / midiscripter-0.9-py3-none-any.whl

Download URL midiscripter-0.9-py3-none-any.whl
Size 118.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fb225dd57a7db23888b151520ead555dddb38ea777e01e55a6826f91c54533e
BLAKE2b-256 checksum
How to use checksums
6cc7ab6987977117ce3999f06c7d8d448a5bc9a87f9bb017d8701915afb1ec42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9 This release

2 release files

0.8.1

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4.1

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page