Changes between Version 19 and Version 20 of python-rtmidi


Ignore:
Timestamp:
03/25/2014 01:13:22 PM (6 years ago)
Author:
carndt
Comment:

Converted fully to Trac wiki syntax

Legend:

Unmodified
Added
Removed
Modified
  • python-rtmidi

    v19 v20  
     1[[PageOutline]] 
     2 
    13A Python wrapper for the !RtMidi C++ library written with Cython. 
    24 
    35The current version is '''0.4.3b1''', released on 2013-11-10. 
    46 
    5 == Quick links == 
     7= Quick links = 
    68 
    79 * [http://python.org/pypi/python-rtmidi PyPI page] 
     
    1921 
    2022 
    21 {{{ 
    22 #!rst 
     23= Overview = 
    2324 
    24 Overview 
    25 ======== 
     25[http://www.music.mcgill.ca/~gary/rtmidi/index.html RtMidi] is a set of  
     26C++ classes which provides a concise and simple, cross-platform API 
     27(Application Programming Interface) for realtime MIDI input/output across  
     28Linux (ALSA & JACK), Macintosh OS X (CoreMIDI & JACK), and Windows  
     29(Multimedia Library & Kernel Streaming) operating systems. 
    2630 
    27 RtMidi_ is a set of C++ classes which provides a concise and simple, 
    28 cross-platform API (Application Programming Interface) for realtime MIDI 
    29 input/output across Linux (ALSA & JACK), Macintosh OS X (CoreMIDI & JACK), 
    30 and Windows (Multimedia Library & Kernel Streaming) operating systems. 
     31python-rtmidi is a Python binding for !RtMidi implemented with  
     32[http://cython.org/ Cython] and provides a thin wrapper around the !RtMidi C++  
     33interface. The API is basically the same as the C++ one but with the naming  
     34scheme of classes, methods and parameters adapted to the Python PEP-8  
     35conventions and requirements of the Python package naming structure.  
     36'''python-rtmidi''' supports Python 2 (tested with Python 2.7) and  
     37Python 3 (3.3). 
    3138 
    32 python-rtmidi_ is a Python binding for RtMidi implemented with Cython_ and 
    33 provides a thin wrapper around the RtMidi C++ interface. The API is basically 
    34 the same as the C++ one but with the naming scheme of classes, methods and 
    35 parameters adapted to the Python PEP-8 conventions and requirements of 
    36 the Python package naming structure. **python-rtmidi** supports Python 2 
    37 (tested with Python 2.7) and Python 3 (3.3). 
     39{{{!#box note 
     40'''python-rtmidi''' is currently in '''beta-stage''', which means is is 
     41published in the hope that other developers try it out and help finding 
     42bugs, and that its API is not yet finalised. What is there should work 
     43but is currently only tested thoroughly under Linux ALSA/JACK and less 
     44regularly under OS X (CoreMIDI/JACK) and Windows (WinMM). 
    3845 
    39 .. note:: 
    40     **python-rtmidi** is currently in **beta-stage**, which means is is 
    41     published in the hope that other developers try it out and help finding 
    42     bugs, and that its API is not yet finalised. What is there should work 
    43     but is currently only tested thoroughly under Linux ALSA/JACK and less 
    44     regularly under OS X (CoreMIDI/JACK) and Windows (WinMM). 
    45  
    46     Support for the Windows Kernel Streaming API is currently *broken* in 
    47     RtMidi. 
    48  
    49  
    50 Usage example 
    51 ------------- 
    52  
    53 Here's a quick example of how to use **python-rtmidi** to open the first 
    54 available MIDI output port and send a middle C note on MIDI channel 1:: 
    55  
    56     import time 
    57     import rtmidi 
    58  
    59     midiout = rtmidi.MidiOut() 
    60     available_ports = midiout.get_ports() 
    61  
    62     if available_ports: 
    63         midiout.open_port(0) 
    64     else: 
    65         midiout.open_virtual_port("My virtual output") 
    66  
    67     note_on = [0x90, 60, 112] # channel 1, middle C, velocity 112 
    68     note_off = [0x80, 60, 0] 
    69     midiout.send_message(note_on) 
    70     time.sleep(0.5) 
    71     midiout.send_message(note_off) 
    72  
    73     del midiout 
    74  
    75 More usage examples can be found in the ``tests`` and ``examples`` directory 
    76 of the source distribution. API documentation is available by looking at the 
    77 docstrings in the Cython source code ``src/_rtmidi.pyx`` or using tools like 
    78 ``pydoc`` or IPython_ and by reading the (somewhat terse and inaccurate) 
    79 RtMidi_ documentation. 
    80  
    81  
    82 .. _rtmidi: http://www.music.mcgill.ca/~gary/rtmidi/index.html 
    83 .. _python-rtmidi: %(url)s 
    84 .. _cython: http://cython.org/ 
    85 .. _ipython: http://ipython.org/ 
    86  
     46Support for the Windows Kernel Streaming API is currently *broken* in 
     47!RtMidi. 
    8748}}} 
    8849 
     50= Usage example = 
    8951 
     52Here's a quick example of how to use '''python-rtmidi''' to open the first 
     53available MIDI output port and send a middle C note on MIDI channel 1: 
     54 
     55{{{#!python 
     56import time 
     57import rtmidi 
     58 
     59midiout = rtmidi.MidiOut() 
     60available_ports = midiout.get_ports() 
     61 
     62if available_ports: 
     63    midiout.open_port(0) 
     64else: 
     65    midiout.open_virtual_port("My virtual output") 
     66 
     67note_on = [0x90, 60, 112] # channel 1, middle C, velocity 112 
     68note_off = [0x80, 60, 0] 
     69midiout.send_message(note_on) 
     70time.sleep(0.5) 
     71midiout.send_message(note_off) 
     72 
     73del midiout 
     74}}} 
     75 
     76More usage examples can be found in the  
     77[source:projects/python-rtmidi/trunk/tests tests] and  
     78[source:projects/python-rtmidi/trunk/examples examples] directories  
     79of the source distribution. API documentation is available by looking at  
     80the docstrings in the Cython source code 
     81([source:projects/python-rtmidi/trunk/src/rtmidi.pyx rtmidi.pyx]) or using  
     82tools like `pydoc` or [http://ipython.org/ IPython] and by reading the  
     83(somewhat terse and inaccurate) !RtMidi documentation.