home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / turbo_c / tcmusic.arc / MUSIC.C next >
C/C++ Source or Header  |  1987-06-20  |  3KB  |  97 lines

  1. #include            <stdio.h>
  2. #include            <music.h>
  3. #include            <video.h>
  4. #include            <string.h>
  5. #include            <process.h>
  6.  
  7.  
  8. void    arg_error( void );
  9.  
  10. void    arg_error( void )
  11.     {
  12.         clrscrn();
  13.         poscurs( 10, 10 );
  14.         printf("\nUSAGE IS: music [1 or 2]\n");
  15.         printf("\n1 for BUGLE call or  2 for HORN");
  16.         exit(1);
  17.     }
  18.  
  19. main( int argc, char * argv[] )
  20.  
  21. {
  22.  
  23.  
  24. /*
  25. **  play list for victory bugle call
  26. */
  27.  
  28.     static  unsigned    char    bugle[] =
  29.                     {
  30.                         'T',60,
  31.                         'N',55,32,128,
  32.                         'N',60,32,128,
  33.                         'N',64,32,128,
  34.                         'N',67,48,228,
  35.                         'N',67,16,228,
  36.                         'N',67,32,228,
  37.                         'N',64,48,228,
  38.                         'N',64,16,228,
  39.                         'N',64,32,228,
  40.                         'N',60,32,128,
  41.                         'N',64,32,128,
  42.                         'N',60,32,128,
  43.                         'N',64,32,128,
  44.                         'N',60,32,128,
  45.                         'N',55,96,240,
  46.                         'X','\0'
  47.  
  48.                     };
  49.  
  50.     static  unsigned    char    horn[] =
  51.                     {
  52.  
  53.                         'T',28,
  54.                         'N',58,24,192,
  55.                         'N',62,8,192,
  56.                         'N',65,96,192,
  57.                         'N',62,24,192,
  58.                         'N',67,8,192,
  59.                         'N',65,32,192,
  60.                         'N',62,24,192,
  61.                         'N',58,8,192,
  62.                         'N',53,32,192,
  63.                         'N',58,24,192,
  64.                         'N',62,8,192,
  65.                         'N',60,32,192,
  66.                         'N',58,24,192,
  67.                         'N',53,8,192,
  68.                         'N',50,32,192,
  69.                         'N',46,24,192,
  70.                         'N',55,8,192,
  71.                         'N',53,64,192,
  72.                         'N',41,64,192,
  73.                         'X','\0'
  74.  
  75.                     };
  76.  
  77.     /*
  78.     **  at least 1 argument must be entered
  79.     */
  80.  
  81.  
  82.     if( argc != 2 )
  83.         arg_error();
  84.  
  85.     /*
  86.     **  if not 1 or 2 show usage
  87.     */
  88.  
  89.     if( strcmp( argv[1], "1" ) == 0 )
  90.         play( bugle );
  91.     else
  92.     if( strcmp( argv[1], "2" ) == 0 )
  93.         play( horn );
  94.     else
  95.         arg_error();
  96. }
  97.