BeOS MIDI Architecture | |
BeOS supports MIDI devices and applications via a simple, flexible and
powerful software architecture. Every piece of hardware or software which
sends or receives MIDI data is represented by a set of endpoints.
All endpoints have descriptive names and unique integer IDs.
Endpoints internal to an application may be invisible to the outside, but
applications can make endpoints public to provide an interface to the outside.
MIDI device drivers also provide public endpoints. Each endpoint is either a producer or a consumer, depending on the direction in which MIDI data passes through the endpoint. Producers and consumers can be freely interconnected; a producer can send data to an arbitrary number of consumers, and a consumer can receive data from multiple producers. Connections between producers and consumers can be made or broken at any time. The following diagram shows some examples of interconnections between MIDI devices and applications:
(Note that the diagram does not accurately represent the way in which MIDI devices are connected. In reality, MIDI devices are connected physically to MIDI interfaces, and the hardware endpoints shown in the diagram actually reside in the device drivers.)
|
|
MIDI Input to Csound | |
Csound can process MIDI data coming from a standard MIDI file (although it
doesn't support all possible file formats). MIDI events coming from a file
are processed like ordinary score events; the mechanisms mentioned above
play no part in this process. To let Csound read MIDI data from a file,
specify the file name in the MIDI Input text entry field and switch
the Realtime MIDI input check box to off:
|
|
Input from a known MIDI producer | |
The simplest way to use Csound as a MIDI synthesizer is to take input from
a MIDI producer which is publically visible, e.g., a hardware MIDI input.
To do this, select the producer from the pop-up menu in the MIDI Input
text entry field. Make sure the Realtime MIDI input check box is
switched on.
|
|
Input from other MIDI sources | |
You may want to use Csound as a consumer of MIDI data produced by an application
which doesn't provide a public endpoint. As long as the application allows
you to redirect its MIDI output to a known consumer, this is still possible:
|
|
MIDI Output from Csound | |
Csound:BMidiSynth identifies a consumer
residing in the Csound Server, which allows you to send data to the software
MIDI synthesizer provided by the BeOS.
|
|
Ouput to a known MIDI consumer | |
To send MIDI data from Csound to a publically visible MIDI consumer, e.g.,
a hardware MIDI output, select the consumer from the pop-up menu in the
MIDI Output text entry field. (There should always be at least one
entry that you can use, since Csound:BMidiSynth is available
as long as the Csound Server is running.)
|
|
Output to other MIDI receivers | |
You may want to use Csound as a producer of MIDI data for another application
which doesn't provide a public endpoint. As long as the application allows
you to take MIDI input from a known producer, this is still possible:
|
|
Manipulating MIDI Endpoints | |
Besides the methods outlined above, the BeOS MIDI architecture allows you
a variety of other ways to connect Csound to other MIDI applications.
Csound publishes its MIDI input and output endpoints using readily
identifiable names (the string Csound: followed by whatever
name you want to use). Various third-party applications are available that
let you connect these public endpoints to other MIDI producers and consumers.
One very simple (but useful) program is PatchBay, a small sample
application by Be, Inc., which lets you make or break connections between
any consumer or producer in the system.
MIDI producers appear at the left side of the window, with small gauges that give an indication of the number of events produced by each. MIDI consumers are shown along the top edge; the matrix of check boxes indicates which producers are connected with which consumers (note that multiple connections are perfectly OK). The check boxes can also be used to change the connections. (Names of endpoints are not shown in the window, but they appear as "tip" windows when the mouse moves over one of the icons.) For your convenience, PatchBay is bundled in the Csound distribution for BeOS. Please note that the licensing conditions for the rest of the distribution do not apply to this program; it is covered by the Sample Code License from Be, Inc.
|