adafruit-circuitpython-midi


Nameadafruit-circuitpython-midi JSON
Version 1.5.2 PyPI version JSON
download
home_pageNone
SummaryA CircuitPython helper for encoding/decoding MIDI packets over a MIDI or UART connection.
upload_time2024-10-07 22:31:43
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
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": 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/8d/09/ee051024138602fbb0d9c3d49b7e927e2c7053a7e162deb73849dcfb236b/adafruit_circuitpython_midi-1.5.2.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.5.2",
    "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": "42bd50cc926f47b908426ea62afb4f1d15e1ab380313cb0eca15046ef8332fa1",
                "md5": "87662412f7e14b64350d41ef21af3ebc",
                "sha256": "5d8954e2ba501f36dbcb8d2602508b4e9e3e81c6c21d483ca5744bbbabdee361"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_midi-1.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "87662412f7e14b64350d41ef21af3ebc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 22042,
            "upload_time": "2024-10-07T22:31:42",
            "upload_time_iso_8601": "2024-10-07T22:31:42.232686Z",
            "url": "https://files.pythonhosted.org/packages/42/bd/50cc926f47b908426ea62afb4f1d15e1ab380313cb0eca15046ef8332fa1/adafruit_circuitpython_midi-1.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8d09ee051024138602fbb0d9c3d49b7e927e2c7053a7e162deb73849dcfb236b",
                "md5": "48c66c9bdcd8df3ab61723cea097ee19",
                "sha256": "45f5b6608faa5d2e4f4f72405219e63c99b23a0772438df68bef76a647a37b7c"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_midi-1.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "48c66c9bdcd8df3ab61723cea097ee19",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 41193,
            "upload_time": "2024-10-07T22:31:43",
            "upload_time_iso_8601": "2024-10-07T22:31:43.897648Z",
            "url": "https://files.pythonhosted.org/packages/8d/09/ee051024138602fbb0d9c3d49b7e927e2c7053a7e162deb73849dcfb236b/adafruit_circuitpython_midi-1.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-07 22:31:43",
    "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.36442s