File: portmidi.rst

package info (click to toggle)
python-mido 1.3.3-0.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 920 kB
  • sloc: python: 4,006; makefile: 127; sh: 4
file content (50 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.. SPDX-FileCopyrightText: 2017 Ole Martin Bjorndalen <ombdalen@gmail.com>
..
.. SPDX-License-Identifier: CC-BY-4.0

PortMidi
--------

Name: ``mido.backends.portmidi``

Resources:

* `PortMidi C Library <https://github.com/PortMidi/portmidi>`_


Installing
^^^^^^^^^^

The PortMidi backend requires the ``portmidi`` shared library.

`Ubuntu <https://www.ubuntu.com/>`_::

    apt install libportmidi-dev

`Homebrew <https://mxcl.dev/homebrew/>`_::

    brew install portmidi

`MacPorts <https://www.macports.org/>`_::

    port install portmidi

The backend will look for::

    portmidi.so      (Linux)
    portmidi.dynlib  (macOS)
    portmidi.dll     (Windows)


Features
^^^^^^^^

* Can send but doesn't receive ``active_sensing`` messages.

* No callback mechanism so callbacks are implemented in
  Python with threads. Each port with a callback has a dedicated thread
  doing blocking reads from the device.

* Due to limitations in PortMidi the port list will not be up-to-date if
  there are any ports open. (The refresh is implemented by
  re-initializing PortMidi which would break any open ports.)