- Author
- Copyright © 2009-2010 Pedro López-Cabanillas <plcl AT users.sf.net>
- Date
- 2010-09-09
- Version
- 0.5.0
This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
Abstract
This is the reference documentation for drumstick. This library is a C++ wrapper around the ALSA library sequencer interface, using Qt4 objects, idioms and style. ALSA sequencer provides software support for MIDI technology on Linux.
- See also
- http://doc.trolltech.com/index.html
-
http://www.alsa-project.org/alsa-doc/alsa-lib/seq.html
-
http://cartan.cas.suffolk.edu/oopdocbook/opensource/index.html
-
http://www.midi.org/aboutmidi/tutorials.php
Disclaimer
This document is a work in progress, in a very early state. It will be always in development. Please visit the drumstick web site to read the latest version.
- See also
- http://drumstick.sourceforge.net
Introduction
For an introduction to design and programming with C++ and Qt4, see the book "An Introduction to Design Patterns in C++ with Qt 4" by by Alan Ezust and Paul Ezust. It is available published on dead trees, and also online.
Here is how a simple program playing a note-on MIDI message using drumstick looks like:
#include <QApplication>
int main(int argc, char **argv) {
QApplication app(argc, argv, false);
port->
setCapability( SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ );
ev.setSubscribers();
ev.setDirect();
delete client;
return 0;
}
void close()
Close the sequencer device.
void setClientName(QString const &newName)
Changes the public name of the ALSA sequencer client.
void output(SequencerEvent *ev, bool async=false, int timeout=-1)
Output an event using the library output buffer.
MidiPort * createPort()
Create and attach a new MidiPort instance to this client.
void open(const QString deviceName="default", const int openMode=SND_SEQ_OPEN_DUPLEX, const bool blockMode=false)
Open the sequencer device.
void drainOutput(bool async=false, int timeout=-1)
Drain the library output buffer.
void subscribeTo(PortInfo *port)
Subscribe to another port destination.
void setPortName(QString const &newName)
Sets the port name.
void setPortType(unsigned int newValue)
Sets the port type bitmap.
void setCapability(unsigned int newValue)
Sets the port capabilities.
int getPortId()
Gets the port number.
Event representing a note-on MIDI event.
The main header that a program can include to use all the drumstick features.
There are more examples in the source tree, under the utils/ directory, and you can also see applications using this library, as kmetronome and kmidimon.
- See also
- http://kmetronome.sourceforge.net
-
http://kmidimon.sourceforge.net
-
http://kmid2.sourceforge.net
Acknowledgments
Parts of this documentation are copied from the ALSA library documentation, whose authors are:
-
Jaroslav Kysela <perex AT perex.cz>
-
Abramo Bagnara <abramo AT alsa-project.org>
-
Takashi Iwai <tiwai AT suse.de>
-
Frank van de Pol <fvdpol AT coil.demon.nl>