Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-midi/badge/?version=latest
:target: https://docs.circuitpython.org/projects/midi/en/latest/
:alt: Documentation Status
.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_MIDI/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_MIDI/actions/
:alt: Build Status
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Code Style: Ruff
A CircuitPython helper for encoding/decoding MIDI packets over a MIDI or UART connection.
Dependencies
=============
This driver depends on:
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
Installing from PyPI
--------------------
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-midi/>`_. To install for current user:
.. code-block:: shell
pip3 install adafruit-circuitpython-midi
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install adafruit-circuitpython-midi
To install in a virtual environment in your current project:
.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-midi
Usage Example
=============
.. code-block:: python
import time
import random
import usb_midi
import adafruit_midi
from adafruit_midi.note_on import NoteOn
from adafruit_midi.note_off import NoteOff
from adafruit_midi.pitch_bend import PitchBend
from adafruit_midi.control_change import ControlChange
midi = adafruit_midi.MIDI(midi_out=usb_midi.ports[1], out_channel=0)
print("Midi test")
print("Default output MIDI channel:", midi.out_channel + 1)
while True:
midi.send(NoteOn(44, 120)) # G sharp 2nd octave
time.sleep(0.25)
a_pitch_bend = PitchBend(random.randint(0, 16383))
midi.send(a_pitch_bend)
time.sleep(0.25)
midi.send([NoteOff("G#2", 120),
ControlChange(3, 44)])
time.sleep(0.5)
Documentation
=============
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/midi/en/latest/>`_.
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_MIDI/blob/main/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Raw data
{
"_id": null,
"home_page": null,
"name": "adafruit-circuitpython-midi",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "adafruit, blinka, circuitpython, micropython, midi, uart, encoding, decoding",
"author": null,
"author_email": "Adafruit Industries <circuitpython@adafruit.com>",
"download_url": "https://files.pythonhosted.org/packages/09/ca/919f46f93a8844c9129e4bbf7730877fd17ec2e50a24ae6b4125a0476a02/adafruit_circuitpython_midi-1.5.6.tar.gz",
"platform": null,
"description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-midi/badge/?version=latest\n :target: https://docs.circuitpython.org/projects/midi/en/latest/\n :alt: Documentation Status\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n :target: https://adafru.it/discord\n :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_MIDI/workflows/Build%20CI/badge.svg\n :target: https://github.com/adafruit/Adafruit_CircuitPython_MIDI/actions/\n :alt: Build Status\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n :target: https://github.com/astral-sh/ruff\n :alt: Code Style: Ruff\n\nA CircuitPython helper for encoding/decoding MIDI packets over a MIDI or UART connection.\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.\n\nInstalling from PyPI\n--------------------\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/adafruit-circuitpython-midi/>`_. To install for current user:\n\n.. code-block:: shell\n\n pip3 install adafruit-circuitpython-midi\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n sudo pip3 install adafruit-circuitpython-midi\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n mkdir project-name && cd project-name\n python3 -m venv .venv\n source .venv/bin/activate\n pip3 install adafruit-circuitpython-midi\n\nUsage Example\n=============\n\n.. code-block:: python\n\n import time\n import random\n import usb_midi\n import adafruit_midi\n\n from adafruit_midi.note_on import NoteOn\n from adafruit_midi.note_off import NoteOff\n from adafruit_midi.pitch_bend import PitchBend\n from adafruit_midi.control_change import ControlChange\n\n midi = adafruit_midi.MIDI(midi_out=usb_midi.ports[1], out_channel=0)\n\n print(\"Midi test\")\n\n print(\"Default output MIDI channel:\", midi.out_channel + 1)\n\n while True:\n midi.send(NoteOn(44, 120)) # G sharp 2nd octave\n time.sleep(0.25)\n a_pitch_bend = PitchBend(random.randint(0, 16383))\n midi.send(a_pitch_bend)\n time.sleep(0.25)\n midi.send([NoteOff(\"G#2\", 120),\n ControlChange(3, 44)])\n time.sleep(0.5)\n\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/midi/en/latest/>`_.\n\nFor information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_MIDI/blob/main/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A CircuitPython helper for encoding/decoding MIDI packets over a MIDI or UART connection.",
"version": "1.5.6",
"project_urls": {
"Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_MIDI"
},
"split_keywords": [
"adafruit",
" blinka",
" circuitpython",
" micropython",
" midi",
" uart",
" encoding",
" decoding"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7a1158ce7bbcbb96eaf79f31ea9ed69586e826647c3a7add8af3497192316478",
"md5": "d701f0c6f08c75b98e2b5b9589e074a2",
"sha256": "f85f05c192ef022a5ef5fbc5bcb36bd20483c1467fe1afa67f0936bc067fcaea"
},
"downloads": -1,
"filename": "adafruit_circuitpython_midi-1.5.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d701f0c6f08c75b98e2b5b9589e074a2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 21909,
"upload_time": "2025-10-20T20:44:27",
"upload_time_iso_8601": "2025-10-20T20:44:27.366005Z",
"url": "https://files.pythonhosted.org/packages/7a/11/58ce7bbcbb96eaf79f31ea9ed69586e826647c3a7add8af3497192316478/adafruit_circuitpython_midi-1.5.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "09ca919f46f93a8844c9129e4bbf7730877fd17ec2e50a24ae6b4125a0476a02",
"md5": "08181233e2d5c9f4cd9a50252c2d968a",
"sha256": "7098db84ed1ed3cfb65008e99cc7322002adede39de1f18d913bb8c83c41c39b"
},
"downloads": -1,
"filename": "adafruit_circuitpython_midi-1.5.6.tar.gz",
"has_sig": false,
"md5_digest": "08181233e2d5c9f4cd9a50252c2d968a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 37732,
"upload_time": "2025-10-20T20:44:28",
"upload_time_iso_8601": "2025-10-20T20:44:28.666352Z",
"url": "https://files.pythonhosted.org/packages/09/ca/919f46f93a8844c9129e4bbf7730877fd17ec2e50a24ae6b4125a0476a02/adafruit_circuitpython_midi-1.5.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-20 20:44:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adafruit",
"github_project": "Adafruit_CircuitPython_MIDI",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "Adafruit-Blinka",
"specs": []
}
],
"lcname": "adafruit-circuitpython-midi"
}