: dev = mididevice (mididev)
: dev = mididevice (mididir, mididev)
: dev = mididevice ("input", midiindev, "output", midioutdev)

Create a midi device using the input parameters.

When a single device name or id is provided, attempt to create the midi device using the same name for both input and output.

Otherwise, use the name or device id for the given input or output direction.

Inputs

mididev - name or id of device to load.
mididir - midi direction of "input" or "output"
midiindev - midi input name or id
midioutdev - midi output name or id

Outputs

dev - octave_midi class for opened device

Properties

Input - Input device name (read only).
Output - Output device name (read only).
InputID - Input device id (read only).
OutputID - Output device id (read only).

Examples

Open midi device with ID of 0.

> dev = mididevice(0);

 mididevice connected to
   input: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (1)
   output: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (0)

Open a named midi device:

> dev = mididevice("SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0");

 mididevice connected to
   input: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (1)
   output: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (0)

See also: mididevinfo.

Package: audio