File: index.rst

package info (click to toggle)
python-mido 1.3.3-0.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 920 kB
  • sloc: python: 4,006; makefile: 127; sh: 4
file content (215 lines) | stat: -rw-r--r-- 3,563 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
.. SPDX-FileCopyrightText: 2013 Ole Martin Bjorndalen <ombdalen@gmail.com>
.. SPDX-FileCopyrightText: 2023 Raphaƫl Doursenaud <rdoursenaud@gmail.com>
..
.. SPDX-License-Identifier: CC-BY-4.0

.. Mido documentation main file, created by
   sphinx-quickstart on Wed Jun 26 16:58:08 2013.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

.. include:: shared/licenses_logos.rst


Mido - MIDI Objects for Python
==============================


.. Main TOC to get a proper title in the PDF:
.. toctree::
   :caption: Table of Contents
   :maxdepth: 4


.. Workaround to properly show parts in both PDF (latex) and HTML (ReadTheDocs)
   While awaiting a resolution of
   https://github.com/sphinx-doc/sphinx/issues/4977
.. raw:: latex

   \part{Introduction}

.. toctree::
   :caption: Introduction
   :maxdepth: 3
   :hidden:

   self


Overview
--------

Mido is a :term:`Python` library for working with
:term:`MIDI` 1.0 :term:`ports`, :term:`messages` and :term:`files`:

.. code-block:: python

   >>> import mido
   >>> msg = mido.Message('note_on', note=60)
   >>> msg.type
   'note_on'
   >>> msg.note
   60
   >>> msg.bytes()
   [144, 60, 64]
   >>> msg.copy(channel=2)
   Message('note_on', channel=2, note=60, velocity=64, time=0)

.. code-block:: python

   port = mido.open_output('Port Name')
   port.send(msg)

.. code-block:: python

    with mido.open_input() as inport:
        for msg in inport:
            print(msg)

.. code-block:: python

    mid = mido.MidiFile('song.mid')
    for msg in mid.play():
        port.send(msg)


Mido is short for *MIDI objects*.


About this document
^^^^^^^^^^^^^^^^^^^

.. version is automatically generated.

This document refers to Mido version |release|.

.. note::

   An up-to-date version of this document is always available at
   https://mido.readthedocs.io.

.. Build instructions have been moved to contributing.


License
^^^^^^^

This documentation (Except our code of conduct) is licensed under the
`Creative Commons Attribution 4.0 International
License <https://creativecommons.org/licenses/by/4.0/>`__.

|Creative Commons BY-4.0 License|

.. seealso::

   :doc:`licenses`


Community & Source Code
^^^^^^^^^^^^^^^^^^^^^^^

Come visit us at https://github.com/mido.

Everybody is welcome!

.. seealso::

   * :doc:`CODE_OF_CONDUCT`

   * :doc:`contributing`


.. Indices are systematically generated for the PDF.
   Wrap into an HTML only section to prevent spurious title in the TOC.
.. only:: html

    Tables and indices
    ------------------

    * :ref:`genindex`

    * :ref:`modindex`

    .. Comment since Search is provided by the ReadTheDocs theme.
    .. * :ref:`search`


.. The rest of the TOC and documents:

.. raw:: latex

   \part{Basics}

.. toctree::
   :caption: Basics
   :maxdepth: 3
   :hidden:

   installing
   intro


.. raw:: latex

   \part{Details}

.. toctree::
   :caption: Details
   :maxdepth: 3
   :hidden:

   messages/index
   backends/index
   ports/index
   files/index
   binaries


.. raw:: latex

   \part{Reference}

.. toctree::
   :caption: Reference
   :maxdepth: 3
   :hidden:

   api


.. raw:: latex

   \part{Community}

.. toctree::
   :caption: Community
   :maxdepth: 3
   :hidden:

   CODE_OF_CONDUCT
   contributing


.. raw:: latex

   \part{Appendix}

.. toctree::
   :caption: Appendix
   :maxdepth: 3
   :hidden:

   about_midi
   message_types
   meta_message_types
   resources

   freezing_exe

   changes

   authors
   licenses
   acknowledgements

   glossary