{"id":19518634,"url":"https://github.com/mik3y/pymidi","last_synced_at":"2025-04-26T07:30:52.245Z","repository":{"id":54850385,"uuid":"148922971","full_name":"mik3y/pymidi","owner":"mik3y","description":"Python library for building RTP-MIDI / AppleMIDI clients and servers","archived":false,"fork":false,"pushed_at":"2023-10-17T03:13:53.000Z","size":143,"stargazers_count":51,"open_issues_count":10,"forks_count":12,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-15T23:04:46.421Z","etag":null,"topics":["applemidi","midi","rtp-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/mik3y.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-15T17:13:09.000Z","updated_at":"2025-04-08T17:56:44.000Z","dependencies_parsed_at":"2023-01-24T20:50:18.125Z","dependency_job_id":null,"html_url":"https://github.com/mik3y/pymidi","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mik3y%2Fpymidi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mik3y%2Fpymidi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mik3y%2Fpymidi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mik3y%2Fpymidi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mik3y","download_url":"https://codeload.github.com/mik3y/pymidi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250953195,"owners_count":21513271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["applemidi","midi","rtp-midi"],"created_at":"2024-11-11T00:13:17.407Z","updated_at":"2025-04-26T07:30:52.001Z","avatar_url":"https://github.com/mik3y.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pymidi\n\nA python RTP-MIDI / AppleMIDI implementation. You can use this library to build a network attached virtual MIDI device.\n\n[![Build Status](https://travis-ci.org/mik3y/pymidi.svg?branch=main)](https://travis-ci.org/mik3y/pymidi)\n\n**Latest release:** v0.5.0 (2020-01-12) ([changelog](https://github.com/mik3y/pymidi/blob/main/CHANGELOG.md))\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [Quickstart](#quickstart)\n- [Developer Setup](#developer-setup)\n  - [Compatibility](#compatibility)\n  - [Running tests](#running-tests)\n  - [Developing against something else](#developing-against-something-else)\n- [Demo Server](#demo-server)\n- [Using in Another Project](#using-in-another-project)\n- [Project Status](#project-status)\n- [References and Reading](#references-and-reading)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Quickstart\n\n```\n$ pip install pymidi\n```\nor\n\n```\npoetry install pymidi\n```\n\nSee [Using in Another Project](#using-in-another-project) and the [Developer Setup wiki](wiki/Developer-MIDI-Setup) for more information.\n\n## Developer Setup\n\nSet up your workspace with the very excellent [Poetry](https://python-poetry.org/):\n\n```\n$ poetry install\n```\n\nOnce installed, you'll probably find it useful to work in a `poetry shell`, for ease of testing and running things:\n\n```\n$ poetry shell\n(pymidi-tFFCbXNj)\n$ python pymidi/server.py\n```\n\n### Compatibility\n\n`pymidi` requires Python 3. It has been tested against Python 3.6 and Python 3.7.\n\n### Running tests\n\nTests are run with pytest:\n\n```\n$ pytest\n```\n\n### Developing against something else\n\nIf you're working on a project that uses `pymidi` and want to develop both concurrently, leverage the setuptools `develop` command:\n\n```\n$ cd ~/git/otherproject\n$ poetry shell\n$ pushd ~/git/pymidi \u0026\u0026 python setup.py develop \u0026\u0026 popd\n```\n\nThis creates a link to `~/git/pymidi` within the environment of `~/git/otherproject`.\n\n## Demo Server and Examples\n\nThe library includes a simple demo server which prints stuff.\n\n```\n$ python pymidi/examples/example_server.py\n```\n\nSee `--help` for usage. See the `examples/` directory for other examples.\n\n## Using in Another Project\n\nMost likely you will want to embed a server in another project, and respond to MIDI commands in some application specific way. The demo serve is an example of what you need to do.\n\nFirst, create a subclass of `server.Handler` to implement your policy:\n\n```py\nfrom pymidi import server\n\nclass MyHandler(server.Handler):\n    def on_peer_connected(self, peer):\n        print('Peer connected: {}'.format(peer))\n\n    def on_peer_disconnected(self, peer):\n        print('Peer disconnected: {}'.format(peer))\n\n    def on_midi_commands(self, peer, command_list):\n        for command in command_list:\n            if command.command == 'note_on':\n                key = command.params.key\n                velocity = command.params.velocity\n                print('Someone hit the key {} with velocity {}'.format(key, velocity))\n```\n\nThen install it in a server and start serving:\n\n```\nmyServer = server.Server([('0.0.0.0', 5051)])\nmyServer.add_handler(MyHandler())\nmyServer.serve_forever()\n```\n\nSee the [Developer Setup wiki](https://github.com/mik3y/pymidi/wiki/Developer-MIDI-Setup) for ways to test with real devices.\n\n## Project Status\n\nWhat works:\n* Exchange packet parsing\n* Timestamp sync packet parsing\n* Exchange \u0026 timestamp sync protocol support\n* MIDI message parsing\n\nNot (yet) implemented:\n* Journal contents parsing\n* Verification of peers on the data channel\n* Auto-disconnect peers that stop synchronizing clocks\n\n## References and Reading\n\n* Official docs\n  - [RFC 6295: RTP Payload Format for MIDI](https://tools.ietf.org/html/rfc6295)\n  - [AppleMIDI Reference Documentation from Apple](https://developer.apple.com/library/archive/documentation/Audio/Conceptual/MIDINetworkDriverProtocol/MIDI/MIDI.html)\n  - [RTP-MIDI on Wikipedia](https://en.wikipedia.org/wiki/RTP-MIDI)\n* Other helpful docs/sites\n  - [The MIDI Specification](http://midi.teragonaudio.com/tech/midispec.htm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmik3y%2Fpymidi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmik3y%2Fpymidi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmik3y%2Fpymidi/lists"}