File tree Expand file tree Collapse file tree 4 files changed +20
-16
lines changed Expand file tree Collapse file tree 4 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,6 @@ or individual libraries can be installed using
3737`circup <https://github.com/adafruit/circup >`_.
3838
3939
40-
41- .. todo :: Describe the Adafruit product this library works with. For PCBs, you can also add the
42- image from the assets folder in the PCB's GitHub repo.
43-
44- `Purchase one from the Adafruit shop <http://www.adafruit.com/products/ >`_
45-
4640Installing from PyPI
4741=====================
4842
@@ -95,8 +89,23 @@ Or the following command to update an existing version:
9589 Usage Example
9690=============
9791
98- .. todo :: Add a quick, simple example. It and other examples should live in the
99- examples folder and be included in docs/examples.rst.
92+ .. code-block :: python
93+
94+ import adafruit_midi
95+ import adafruit_usb_host_midi
96+
97+ print (" Looking for midi device" )
98+ raw_midi = None
99+ while raw_midi is None :
100+ for device in usb.core.find(find_all = True ):
101+ try :
102+ raw_midi = adafruit_usb_host_midi.MIDI(device)
103+ print (" Found" , hex (device.idVendor), hex (device.idProduct))
104+ except ValueError :
105+ continue
106+
107+ midi_device = adafruit_midi.MIDI(midi_in = raw_midi, in_channel = 0 )
108+
100109
101110 Documentation
102111=============
Original file line number Diff line number Diff line change 2323
2424class MIDI :
2525 """
26- Stream-like MIDI device for use with `adafruit_midi` and similar upstream
26+ Stream-like MIDI device for use with `` adafruit_midi` ` and similar upstream
2727 MIDI parser libraries.
2828
29- :param device: a ``usb.core.Device` object which implements
29+ :param device: a ``usb.core.Device`` object which implements
3030 ``read(endpoint, buffer)`` and ``write(endpoint,buffer)``
3131 :param float timeout: timeout in seconds to wait for read or write operation
3232 to succeeds. Default to None, i.e. reads and writes will block.
Original file line number Diff line number Diff line change @@ -24,15 +24,9 @@ Table of Contents
2424.. toctree ::
2525 :caption: Tutorials
2626
27- .. todo :: Add any Learn guide links here. If there are none, then simply delete this todo and leave
28- the toctree above for use later.
29-
3027.. toctree ::
3128 :caption: Related Products
3229
33- .. todo :: Add any product links here. If there are none, then simply delete this todo and leave
34- the toctree above for use later.
35-
3630.. toctree ::
3731 :caption: Other Links
3832
Original file line number Diff line number Diff line change 44# SPDX-License-Identifier: MIT
55
66Adafruit-Blinka
7+ pyusb
You can’t perform that action at this time.
0 commit comments