home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / midi / cmtcmu / prog.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-28  |  758 b   |  40 lines

  1. /* prog.c -- this is a little test of cmtprog.h and moxc.  
  2.  * Musically, it doesn't even rate any comments.
  3.  */
  4.  
  5. #include "cmtprog.h"
  6.  
  7. mainscore()
  8.     begin
  9.         repeat(i, 10)
  10.             p1();
  11.         when random(0, 1) == 1 then
  12.             pnote(51, 300);
  13.             pnote(54, 300);
  14.             pnote(58, 300);
  15.             minor(50, 300);
  16.         otherwise
  17.         endwhen
  18.         p1();
  19.     endrep
  20.     end
  21.  
  22. p1()
  23.     begin
  24.         midi_program(1, random(1, 32));
  25.     rest(20);
  26.         note(48, 15);
  27.         note(59, 25);
  28.         note(56, 23);
  29.         repeat(j, 3)
  30.         minor(random(36, 48), 20);
  31.     endrep
  32.     end
  33.  
  34. minor(tonic, duration)
  35.     begin
  36.         pnote(tonic, duration);
  37.     pnote(tonic + 3, duration);
  38.     note(tonic + 7, duration);
  39.     end
  40.