adafruit-circuitpython-ble-midi


Nameadafruit-circuitpython-ble-midi JSON
Version 1.0.15 PyPI version JSON
download
home_page
SummaryBLE MIDI service for CircuitPython
upload_time2023-12-09 17:43:30
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords adafruit blinka circuitpython micropython ble_midi ble midi
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-ble_midi/badge/?version=latest
    :target: https://docs.circuitpython.org/projects/ble_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_BLE_MIDI/workflows/Build%20CI/badge.svg
    :target: https://github.com/adafruit/Adafruit_CircuitPython_BLE_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

BLE MIDI service for CircuitPython


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://circuitpython.org/libraries>`_.

Installing from PyPI
=====================
.. note:: This library is not available on PyPI yet. Install documentation is included
   as a standard element. Stay tuned for PyPI availability!

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-ble_midi/>`_. To install for current user:

.. code-block:: shell

    pip3 install adafruit-circuitpython-ble-midi

To install system-wide (this may be required in some cases):

.. code-block:: shell

    sudo pip3 install adafruit-circuitpython-ble-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-ble-midi

Usage Example
=============

.. code-block:: python

    """
    This example sends MIDI out. It sends NoteOn and then NoteOff with a random pitch bend.
    """

    import time
    import random
    import adafruit_ble
    from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
    import adafruit_ble_midi
    import adafruit_midi
    from adafruit_midi.control_change import ControlChange
    from adafruit_midi.note_off import NoteOff
    from adafruit_midi.note_on import NoteOn
    from adafruit_midi.pitch_bend import PitchBend

    # Use default HID descriptor
    midi_service = adafruit_ble_midi.MIDIService()
    advertisement = ProvideServicesAdvertisement(midi_service)
    # advertisement.appearance = 961

    ble = adafruit_ble.BLERadio()
    if ble.connected:
        for c in ble.connections:
            c.disconnect()

    midi = adafruit_midi.MIDI(midi_out=midi_service, out_channel=0)

    print("advertising")
    ble.start_advertising(advertisement)

    while True:
        print("Waiting for connection")
        while not ble.connected:
            pass
        print("Connected")
        while ble.connected:
            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)
            # note how a list of messages can be used
            midi.send([NoteOff("G#2", 120), ControlChange(3, 44)])
            time.sleep(0.5)
        print("Disconnected")
        print()
        ble.start_advertising(advertisement)

Documentation
=============

API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ble_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_BLE_MIDI/blob/main/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "adafruit-circuitpython-ble-midi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit,blinka,circuitpython,micropython,ble_midi,ble,midi",
    "author": "",
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/ae/5f/42bf08ca833c55377a974f1f6a2183e32ea5b2ae5ff4dcb80308128db1db/adafruit-circuitpython-ble-midi-1.0.15.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ble_midi/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/ble_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_BLE_MIDI/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_BLE_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\nBLE MIDI service for CircuitPython\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://circuitpython.org/libraries>`_.\n\nInstalling from PyPI\n=====================\n.. note:: This library is not available on PyPI yet. Install documentation is included\n   as a standard element. Stay tuned for PyPI availability!\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/adafruit-circuitpython-ble_midi/>`_. To install for current user:\n\n.. code-block:: shell\n\n    pip3 install adafruit-circuitpython-ble-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-ble-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-ble-midi\n\nUsage Example\n=============\n\n.. code-block:: python\n\n    \"\"\"\n    This example sends MIDI out. It sends NoteOn and then NoteOff with a random pitch bend.\n    \"\"\"\n\n    import time\n    import random\n    import adafruit_ble\n    from adafruit_ble.advertising.standard import ProvideServicesAdvertisement\n    import adafruit_ble_midi\n    import adafruit_midi\n    from adafruit_midi.control_change import ControlChange\n    from adafruit_midi.note_off import NoteOff\n    from adafruit_midi.note_on import NoteOn\n    from adafruit_midi.pitch_bend import PitchBend\n\n    # Use default HID descriptor\n    midi_service = adafruit_ble_midi.MIDIService()\n    advertisement = ProvideServicesAdvertisement(midi_service)\n    # advertisement.appearance = 961\n\n    ble = adafruit_ble.BLERadio()\n    if ble.connected:\n        for c in ble.connections:\n            c.disconnect()\n\n    midi = adafruit_midi.MIDI(midi_out=midi_service, out_channel=0)\n\n    print(\"advertising\")\n    ble.start_advertising(advertisement)\n\n    while True:\n        print(\"Waiting for connection\")\n        while not ble.connected:\n            pass\n        print(\"Connected\")\n        while ble.connected:\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            # note how a list of messages can be used\n            midi.send([NoteOff(\"G#2\", 120), ControlChange(3, 44)])\n            time.sleep(0.5)\n        print(\"Disconnected\")\n        print()\n        ble.start_advertising(advertisement)\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ble_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_BLE_MIDI/blob/main/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "BLE MIDI service for CircuitPython",
    "version": "1.0.15",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_BLE_MIDI"
    },
    "split_keywords": [
        "adafruit",
        "blinka",
        "circuitpython",
        "micropython",
        "ble_midi",
        "ble",
        "midi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e7a593c9edb0c1710b51afc8e7930440ea7a711782069ee154d1557af1cac4f2",
                "md5": "bd364d424a33d901433da5ba83fb8c27",
                "sha256": "b1b96649f20f5f27bf3023f4e825193e23e5447282b22f773984a9d45d7fe42f"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_ble_midi-1.0.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bd364d424a33d901433da5ba83fb8c27",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6150,
            "upload_time": "2023-12-09T17:43:29",
            "upload_time_iso_8601": "2023-12-09T17:43:29.827644Z",
            "url": "https://files.pythonhosted.org/packages/e7/a5/93c9edb0c1710b51afc8e7930440ea7a711782069ee154d1557af1cac4f2/adafruit_circuitpython_ble_midi-1.0.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae5f42bf08ca833c55377a974f1f6a2183e32ea5b2ae5ff4dcb80308128db1db",
                "md5": "cb5894bf1b31465bce24cb18b0f5fcf1",
                "sha256": "f3b4a6cc3589dfd058763d170d7f0f42ba9569dc772bba226ea3a82c431658b3"
            },
            "downloads": -1,
            "filename": "adafruit-circuitpython-ble-midi-1.0.15.tar.gz",
            "has_sig": false,
            "md5_digest": "cb5894bf1b31465bce24cb18b0f5fcf1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 27728,
            "upload_time": "2023-12-09T17:43:30",
            "upload_time_iso_8601": "2023-12-09T17:43:30.907449Z",
            "url": "https://files.pythonhosted.org/packages/ae/5f/42bf08ca833c55377a974f1f6a2183e32ea5b2ae5ff4dcb80308128db1db/adafruit-circuitpython-ble-midi-1.0.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-09 17:43:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adafruit",
    "github_project": "Adafruit_CircuitPython_BLE_MIDI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "adafruit-circuitpython-ble-midi"
}
        
Elapsed time: 0.22056s