*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> midi/mdReceive (3d)              


mdReceive(3dm)							mdReceive(3dm)

NAME    [Toc]    [Back]

     mdReceive - Accept	MIDI events from a port

SYNOPSIS    [Toc]    [Back]

     #include <dmedia/midi.h>

     int mdReceive(MDport port,	MDevent	*evbuf,	int count)

DESCRIPTION    [Toc]    [Back]

     mdReceive reads MIDI events from the MIDI interface associated with port
     into the evbuf array.  evbuf must be allocated by the user	and must
     contain space for count MDevent structures. For most events, the actual
     MIDI event	is stored in the msg array of the MDevent, and the stamp field
     is	set to a stamp value whose format is determined	by the port's stamping
     mode (see mdSetStampMode).

     In	addition, when a system	exclusive event	is received, the MIDI library
     allocates a block of memory for the system	exclusive data and places a
     pointer to	the block of memory in the sysexmsg field of the event
     structure.	 The msg[0] byte in the	MDevent	structure contains a 0xF0
     (MD_SYSEX)	to indicate that a system exclusive message has	arrived.  The
     msglen field contains a count of the bytes	in data	buffer.	 Long system
     exclusive messages	may be decomposed into smaller chunks; the last
     message will have an 0xF7 (EOX) at	the end	of the sysexmsg	buffer.

     The application must release the sysexmsg buffer with mdFree(3dm) once it
     is	finished processing the	message.

     If	no events are available	when mdReceive is called, the routine will
     block until one or	more events arrive.  The application can avoid
     blocking by calling select(2) on the file descriptor returned by
     mdGetFd(3dm) before calling mdReceive.  mdReceive returns the number of
     events read.

RETURN VALUE    [Toc]    [Back]

     mdReceive returns the number of messages read from	the given port,	or -1
     on	error.	The following error codes are expected:

     ENOMEM   -	No memory was available	for incoming message storage.

     EFAULT   -	An invalid address was passed to the MIDI driver

     EINVAL   -	An undefined operation was called.

SEE ALSO    [Toc]    [Back]

     mdIntro(3dm), mdFree(3dm),	mdSend(3dm), mvdSetStampMode(3dm)

									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
mdPrintEvent IRIX Generate a descriptive string for MIDI events
mdTell IRIX Return the MIDI port-specific timing information
passthru IRIX pass audio sample data from an input port to an output port
lpenabled IRIX monitor printer output port and enable printer when port is writable.
mdSend IRIX send out MIDI data
mdGetStatus IRIX manipulate MIDI messages
umidi OpenBSD USB support for MIDI devices
startmidi IRIX start MIDI daemon
midisynth IRIX software MIDI synthesizer
mdGetName IRIX return a MIDI interface name
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service