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

  1. /*********************************************************************
  2. *  mpuver               01 Aug 88            Copyright (c) 1988 cMIDI 
  3. *
  4. *  cMIDI function library demonstration.  File 1 of 20.
  5. *
  6. *********************************************************************/
  7. #include <cmidi.h>
  8. #include <stdio.h>
  9. #include <time.h>
  10.  
  11. main()
  12.    {
  13.    unsigned short i, result;
  14.  
  15.    /* Open cmidi */
  16.    CmidiOpen();
  17.    if (ERRORQUEUED()) { CmidiClose( CLOSE_PRINT_ERRORS ); exit( 1 );}  
  18.  
  19.    /* Print version (and revision) of mpu's software. */
  20.    result = MpuRead( MPU_READ_VERSION );
  21.    printf("\nMPU version = %d.%d", ((result&0xf0)>>4), result&0x0f );
  22.    if( (result=MpuRead(MPU_READ_REVISION)) == 0 )
  23.       printf("\n\n");
  24.    else
  25.       printf("%c\n\n", 'a'-1+result);
  26.  
  27.    /* Close cmidi */
  28.    CmidiClose( CLOSE_RESET_MPU | CLOSE_PRINT_ERRORS );
  29.    }
  30.