home *** CD-ROM | disk | FTP | other *** search
/ Kids Cube / 2_Music.iso / mel / playbg.c < prev    next >
C/C++ Source or Header  |  1992-07-27  |  1KB  |  45 lines

  1. /*
  2.   PLAYBG.C function, Copyright 1990,91 by A.A.Efros.
  3.   This function is a part of MELODY MASTER v2.1 Programmer Support Files.
  4.   It is used to play *background* music in C language. The music is
  5.   generated using MELODY MASTER's output to "C bck-gr". This routine
  6.   makes use of a great Public Domain program SoudSys.C!
  7.  
  8.   INSTRUCTIONS:
  9.     1. Run MELODY MASTER main program (MM.EXE or MMCGA.EXE).
  10.     2. Load (F3) the melody you want.
  11.     3. Output (F7) the melody choosing "C bck-gr" option.
  12.     4. Exit MELODY MASTER (Alt-X).
  13.     5. Edit this file so the include statement {#include ...} will have
  14.        the name of your music file.
  15.     6. #include "playbg.c" file in YOUR program.
  16.     7. When you want the music to be played, call play_backgound()
  17.        function (dont't forget to put your foreground code in the
  18.        play_backgound() function).
  19.  
  20.   NOTE: For more detailed information about this routine, please, see
  21.     SOUNDSYS.C file.
  22. */
  23.  
  24.  
  25. #include "soundsys.c"
  26. #include "filename.c" /* <----- Insert the name of your music file here!   */
  27. void play_background()
  28. {
  29.   int i;
  30.  
  31.   init_sound();
  32.   back_sound = OFF;
  33.  
  34.   for (i=0;i<MAX;i++)
  35.   {
  36.     submit_sound(melody[i][0],melody[i][1]);
  37.   }
  38. /*
  39.   . . . Put your foreground code here . . .
  40. */
  41.  
  42.   getch();        /* You may take this away */
  43.   restore_sound();
  44. }
  45.