adafruit-circuitpython-midi


Nameadafruit-circuitpython-midi JSON
Version 1.4.18 PyPI version JSON
download
home_page
SummaryA CircuitPython helper for encoding/decoding MIDI packets over a MIDI or UART connection.
upload_time2023-12-09 17:45:37
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords adafruit blinka circuitpython micropython midi uart encoding decoding
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black
    :alt: Code Style: Black

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": "",
    "name": "adafruit-circuitpython-midi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit,blinka,circuitpython,micropython,midi,uart,encoding,decoding",
    "author": "",
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/d5/e2/71f4a0790801e23973c0aa404bd68fc7879d4f8ec0ef4ba5b3b96e5e3761/adafruit-circuitpython-midi-1.4.18.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/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code Style: Black\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.4.18",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_MIDI"
    },
    "split_keywords": [
        "adafruit",
        "blinka",
        "circuitpython",
        "micropython",
        "midi",
        "uart",
        "encoding",
        "decoding"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e80761c2e59a523094f178701577fcba41559a479789a28d0ebb1afba99ff014",
                "md5": "e56e007705883ef7e6d8d0114218f675",
                "sha256": "26a94bb5adedc64f909ec7993508612b83de7403549de63329e09bd7c2b745e0"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_midi-1.4.18-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e56e007705883ef7e6d8d0114218f675",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21070,
            "upload_time": "2023-12-09T17:45:35",
            "upload_time_iso_8601": "2023-12-09T17:45:35.678949Z",
            "url": "https://files.pythonhosted.org/packages/e8/07/61c2e59a523094f178701577fcba41559a479789a28d0ebb1afba99ff014/adafruit_circuitpython_midi-1.4.18-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5e271f4a0790801e23973c0aa404bd68fc7879d4f8ec0ef4ba5b3b96e5e3761",
                "md5": "419973e32df14dc4bdccb9c9188e597b",
                "sha256": "58e22b0ac3ff0f62b0c381e8fe391411ea6b3d368df354f74ae1fc1182a4aefe"
            },
            "downloads": -1,
            "filename": "adafruit-circuitpython-midi-1.4.18.tar.gz",
            "has_sig": false,
            "md5_digest": "419973e32df14dc4bdccb9c9188e597b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 40580,
            "upload_time": "2023-12-09T17:45:37",
            "upload_time_iso_8601": "2023-12-09T17:45:37.674852Z",
            "url": "https://files.pythonhosted.org/packages/d5/e2/71f4a0790801e23973c0aa404bd68fc7879d4f8ec0ef4ba5b3b96e5e3761/adafruit-circuitpython-midi-1.4.18.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-09 17:45:37",
    "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": [],
    "lcname": "adafruit-circuitpython-midi"
}
        
Elapsed time: 0.15049s