/*! \mainpage The RtMidi Tutorial
OS: | MIDI API: | Preprocessor Definition: | Library or Framework: | Example Compiler Statement: |
Linux | ALSA Sequencer | __LINUX_ALSA__ | asound, pthread | g++ -Wall -D__LINUX_ALSA__ -o midiprobe midiprobe.cpp RtMidi.cpp -lasound -lpthread |
Linux or Mac | JACK MIDI | __UNIX_JACK__ | jack | g++ -Wall -D__UNIX_JACK__ -o midiprobe midiprobe.cpp RtMidi.cpp -ljack |
Macintosh OS X | CoreMIDI | __MACOSX_CORE__ | CoreMIDI, CoreAudio, CoreFoundation | g++ -Wall -D__MACOSX_CORE__ -o midiprobe midiprobe.cpp RtMidi.cpp -framework CoreMIDI -framework CoreAudio -framework CoreFoundation |
Windows | Multimedia Library | __WINDOWS_MM__ | winmm.lib, multithreaded | compiler specific |
The example compiler statements above could be used to compile the midiprobe.cpp example file, assuming that midiprobe.cpp, RtMidi.h and RtMidi.cpp all exist in the same directory.
\section debug Debugging
If you are having problems getting RtMidi to run on your system, try passing the preprocessor definition __RTMIDI_DEBUG__ to the compiler (or define it in RtMidi.h). A variety of warning messages will be displayed that may help in determining the problem. Also try using the programs included in the tests directory. The program midiprobe displays the queried capabilities of all MIDI ports found.
\section multi Using Simultaneous Multiple APIs
Support for each MIDI API is encapsulated in specific MidiInApi or MidiOutApi subclasses, making it possible to compile and instantiate multiple API-specific subclasses on a given operating system. For example, one can compile both CoreMIDI and JACK support on the OS-X operating system by providing the appropriate preprocessor definitions for each. In a run-time situation, one might first attempt to determine whether any JACK ports are available. This can be done by specifying the api argument RtMidi::UNIX_JACK when attempting to create an instance of RtMidiIn or RtMidiOut. If no available ports are found, then an instance of RtMidi with the api argument RtMidi::MACOSX_CORE can be created. Alternately, if no api argument is specified, RtMidi will first look for JACK ports and if none are found, then CoreMIDI ports (in linux, the search order is JACK and then ALSA. In theory, it should also be possible to have separate instances of RtMidi open at the same time with different underlying API support, though this has not been tested.
The static function RtMidi::getCompiledApi() is provided to determine the available compiled API support. The function RtMidi::getCurrentApi() indicates the API selected for a given RtMidi instance.
\section apinotes API Notes
RtMidi is designed to provide a common API across the various supported operating systems and audio libraries. Despite that, some issues should be mentioned with regard to each.
\subsection linux Linux:
RtMidi for Linux was developed using the Fedora distribution. Two different MIDI APIs are supported on Linux platforms: ALSA and JACK. A decision was made to not include support for the OSS API because the OSS API provides very limited functionality and because ALSA support is now incorporated in the Linux kernel. The ALSA sequencer and JACK APIs allows for virtual software input and output ports.
\subsection macosx Macintosh OS X (CoreAudio):
The Apple CoreMIDI API allows for the establishment of virtual input and output ports to which other software applications can connect.
The RtMidi JACK support can be compiled on Macintosh OS-X systems, as well as in Linux.
\subsection windowsds Windows (Multimedia Library):
The \c configure script provides support for the MinGW compiler.
The Windows Multimedia library MIDI calls used in RtMidi do not make use of streaming functionality. Incoming system exclusive messages read by RtMidiIn are limited to a length as defined by the preprocessor definition RT_SYSEX_BUFFER_SIZE (set in RtMidi.cpp). The default value is 1024. There is no such limit for outgoing sysex messages via RtMidiOut.
RtMidi was originally developed with Visual C++ version 6.0 but has been tested with Virtual Studio 2010.
\section acknowledge Development & Acknowledgements
RtMidi is on github (https://github.com/thestk/rtmidi). Many thanks to the developers that are helping to maintain and improve RtMidi.
In years past, the following people provided bug fixes and improvements:
- Stephen Sinclair (Git repo, code and build system)
- amosonn
- Christopher Arndt
- Atsushi Eno (C API)
- Sebastien Alaiwan (JACK memory leaks, Windows kernel streaming)
- Jean-Baptiste Berruchon (Windows sysex code)
- Pedro Lopez-Cabanillas (ALSA sequencer API, client naming)
- Jason Champion (MSW project file for library build)
- Chris Chronopoulos
- JP Cimalando
- Eduardo Coutinho (Windows device names)
- Mattes D
- Michael Dahl
- Paul Dean (increment optimization)
- Francisco Demartino
- Luc Deschenaux (sysex issues)
- John Dey (OS-X timestamps)
- Christoph Eckert (ALSA sysex fixes)
- Thiago Goulart
- Ashley Hedges
- Sam Hocevar
- Rorey Jaffe
- jgvictores
- Martin Koegler (various fixes)
- Immanuel Litzroth (OS-X sysex fix)
- Bartek Lukawski
- Andi McClure
- Jon McCormack (Snow Leopard updates)
- Phildo
- Lane Spangler
- Axel Schmidt (client naming)
- Ryan Schmidt
- Saga Musix
- Bart Spaans
- Alexander Svetalkin (JACK MIDI)
- Ben Swift
- Casey Tucker (OS-X driver information, sysex sending)
- Bastiaan Verreijt (Windows sysex multi-buffer code)
- Dan Wilcox
- Yuri
- Serge Zaitsev
- Iohannes Zmölnig
\section license License
RtMidi: realtime MIDI i/o C++ classes
Copyright (c) 2003-2019 Gary P. Scavone
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Any person wishing to distribute modifications to the Software is
asked to send the modifications to the original developer so that
they can be incorporated into the canonical version. This is,
however, not a binding provision of this license.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/