home *** CD-ROM | disk | FTP | other *** search
/ Sound Sensations! / sound_sensations.iso / demos / midif / silence.c < prev    next >
Text File  |  1988-09-03  |  876b  |  36 lines

  1. /*********************************************************************
  2. *  silence              01 Aug 88            Copyright (c) 1988 cMIDI 
  3. *  cMIDI function library demonstration.  File 2 of 20.
  4. *
  5. *********************************************************************/
  6. #include <cmidi.h>
  7.  
  8. main()
  9.    {
  10.    struct cm_message m1, m2;
  11.    int channel;
  12.  
  13.    /* Open cmidi */
  14.    CmidiOpen();
  15.  
  16.    /* Create all notes off messages. */
  17.    m1.status = m2.status = MIDI_CONTROL_CHANGE;
  18.    m1.data1 = 0x7b;
  19.    m1.data2 = 0x00;
  20.    m2.data1 = 0x7c;
  21.    m2.data2 = 0x00;
  22.  
  23.    /* On each midi channel */
  24.    for (channel=0; channel<=15; channel++)
  25.       {
  26.       m1.status = m2.status = (m1.status & 0xf0) | channel;
  27.       TxMidiChan( m1 );
  28.       TxMidiChan( m2 );
  29.       }
  30.  
  31.    /* Close cmidi */
  32.    CmidiClose( CLOSE_PRINT_ERRORS | CLOSE_RESET_MPU );
  33.    }
  34.