home *** CD-ROM | disk | FTP | other *** search
/ Computer PanorĂ¡ma / computer_panorama_1997-12-hibas.iso / SHARE / SOUND / MIDILANG.ZIP / REPLACE.XPL < prev    next >
Encoding:
Text File  |  1997-09-27  |  1.4 KB  |  81 lines

  1. /* 
  2.     replace a set of notes
  3.  
  4.  
  5. */
  6.  
  7.  
  8. init ()
  9. {
  10.  
  11.     const C4=48;
  12. const C#4=49;
  13.     const D4=50;
  14. const D#4=51;
  15.     const E4=52;
  16.  
  17.     const C3=36;
  18. const C#3=37;
  19.     const D3=38;
  20. const D#3=39;
  21.     const E3=40;
  22.  
  23.     var nbremp;
  24.     var orig_note[100], orig_chan[100];
  25.     var remp_note[100], remp_chan[100];
  26.  
  27.     nbremp=5;
  28.  
  29.     orig_note[0]=C4;
  30.     orig_chan[0]=-1;  /* put -1 for any channel */
  31.     remp_note[0]=C3;
  32.     remp_chan[0]=-1; /* put -1 to not change the channel */
  33.  
  34. orig_note[1]=C#4;
  35.     orig_chan[1]=4;  /* C#4 of the channel 4 only */
  36. remp_note[1]=C#3;
  37.     remp_chan[1]=3; /* put it back to channel 3 */
  38.  
  39.     orig_note[2]=D4;
  40.     orig_chan[2]=-1;  /* put -1 for any channel */
  41.     remp_note[2]=D3;
  42.     remp_chan[2]=-1; /* put -1 to not change the channel */
  43.  
  44.     orig_note[3]=D#4;
  45.     orig_chan[3]=-1;  /* put -1 for any channel */
  46.     remp_note[3]=D#3;
  47.     remp_chan[3]=-1; /* put -1 to not change the channel */
  48.  
  49.     orig_note[4]=E4;
  50.     orig_chan[4]=-1;  /* put -1 for any channel */
  51.     remp_note[4]=E3;
  52.     remp_chan[4]=-1; /* put -1 to not change the channel */
  53.  
  54.  
  55.     savein (0);
  56.  
  57.     /* do not save the incoming notes */
  58. }
  59.  
  60.  
  61.  
  62. main ()
  63. {
  64.     var i;
  65.     for (i=0;i<nbremp;i++)
  66.     {
  67.         if ( ((orig_chan[i]==-1) || (orig_chan[i]==chan))
  68.             && ( orig_note[i]==note) )
  69.         {
  70.             note = remp_note[i];
  71.             if (remp_chan[i]!=-1) chan = remp_chan[i];
  72.         }
  73.     }
  74.  
  75.     outmidi ();
  76.  
  77.  
  78.     descript ("Replace a set of channel/note");
  79.     descript ("by an another");
  80. }
  81.