mdPanic man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



mdPanic(3dm)							  mdPanic(3dm)

NAME
     mdPanic - flush MIDI output and transmit (obsolete)

SYNOPSIS
     #include <dmedia/midi.h>

     int mdPanic(MDport port)

DESCRIPTION
     mdPanic is an obsolete routine which sends ALL NOTES OFF and RESET ALL
     CONTROLLERS messages on all channels.

     The following program illustrates the prefered method of silencing stuck
     notes (the code is also available in
     /usr/share/src/dmedia/midi/simple/panic.c if the MIDI example code is
     installed).

     #include <stdio.h>
     #include <dmedia/midi.h>

     long long stamp = 0;

     char *usage = "Usage: panic [-f] [-a | interface name]"

     /*
      * Transmit ALL NOTES OFF, ALL SOUND OFF, and RESET ALL CONTROLLERS
      * messages on all 16 channels.
      */
     void
     send_control_messages(MDport port)
     {
	  int channel, byte;
	  MDevent ev;
	  char data_byte[] = { MD_RESETALLCONTROLLERS, MD_ALLNOTESOFF,
			 MD_ALLSOUNDOFF };

	  for (channel = 0; channel < 16; channel++) {
	       for (byte = 0; byte < 3; byte++) {
		    ev.stamp = stamp++;
		    ev.msg[0] = MD_CONTROLCHANGE | channel;
		    ev.msg[1] = data_byte[byte];
		    ev.msg[2] = 0;
		    mdSend(port, &ev, 1);
	       }
	  }
     }

     /*
      * Transmit explicit NOTE OFF events on all channels.
      */
     void

									Page 1

mdPanic(3dm)							  mdPanic(3dm)

     send_note_off_events(MDport port)
     {
	  int channel, note;
	  MDevent ev;

	  for (channel = 0; channel < 16; channel++) {
	       for (note = 0; note < 128; note++) {
		    ev.stamp = stamp++;
		    ev.msg[0] = MD_NOTEOFF;
		    ev.msg[1] = note;
		    ev.msg[2] = 0;
		    mdSend(port, &ev, 1);
	       }
	  }
     }

     void
     main(int argc, char **argv)
     {
	  int  num_interfaces;
	  MDport    port;

	  /* First initialize the MIDI library */
	  num_interfaces = mdInit();
	  if (num_interfaces == 0) {
	       fprintf(stderr, "panic: no interfaces configured0);
	       exit(1);
	  }

	  /* Open the port */
	  outport = mdOpenOutPort(name);
	  if (outport == NULL) {
	       fprintf(stderr, "panic: Could not open interface0);
	       exit(1);
	  }

	  /* Transmit 1 event every millisecond */
	  mdSetStampMode(outport, MD_RELATIVETICKS);
	  mdSetDivision(outport, 1);
	  mdSetTempo(outport, 1000);

	  send_note_off_events(outport);
	  send_control_messages(outport);

	  /* Wait for messages to go out */
	  while (mdTellNow(outport) < stamp) ;
     }

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net