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": null,
"name": "adafruit-circuitpython-ble-midi",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "adafruit, blinka, circuitpython, micropython, ble_midi, ble, midi",
"author": null,
"author_email": "Adafruit Industries <circuitpython@adafruit.com>",
"download_url": "https://files.pythonhosted.org/packages/9b/cd/36d16796d1f05b2fa6ff33bade5edc7431e49782742737d69151a6293030/adafruit_circuitpython_ble_midi-1.0.17.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.17",
"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": "c8c111616a74c7281271dbb19708c330181f4caa5f841e3628d193b4fc185e90",
"md5": "6ec07eab4ca41b0c65f7c4f021b84cac",
"sha256": "1b45b6bea47f446bfacb9b90d7ee87d65d75a284520f15fd0eaae1a62f927a5f"
},
"downloads": -1,
"filename": "adafruit_circuitpython_ble_midi-1.0.17-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6ec07eab4ca41b0c65f7c4f021b84cac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6151,
"upload_time": "2025-01-16T19:31:29",
"upload_time_iso_8601": "2025-01-16T19:31:29.772572Z",
"url": "https://files.pythonhosted.org/packages/c8/c1/11616a74c7281271dbb19708c330181f4caa5f841e3628d193b4fc185e90/adafruit_circuitpython_ble_midi-1.0.17-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9bcd36d16796d1f05b2fa6ff33bade5edc7431e49782742737d69151a6293030",
"md5": "c1a8cc57207854ceca90ba1ffc43d96e",
"sha256": "60b77a968e0b0052b999fef23eb4a87597396ce3c138f7660c96c3516e3d5a76"
},
"downloads": -1,
"filename": "adafruit_circuitpython_ble_midi-1.0.17.tar.gz",
"has_sig": false,
"md5_digest": "c1a8cc57207854ceca90ba1ffc43d96e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 27742,
"upload_time": "2025-01-16T19:31:33",
"upload_time_iso_8601": "2025-01-16T19:31:33.424549Z",
"url": "https://files.pythonhosted.org/packages/9b/cd/36d16796d1f05b2fa6ff33bade5edc7431e49782742737d69151a6293030/adafruit_circuitpython_ble_midi-1.0.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-16 19:31:33",
"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": [
{
"name": "Adafruit-Blinka",
"specs": []
},
{
"name": "adafruit-circuitpython-ble",
"specs": []
},
{
"name": "adafruit-circuitpython-typing",
"specs": []
}
],
"lcname": "adafruit-circuitpython-ble-midi"
}