home *** CD-ROM | disk | FTP | other *** search
- /*
- replace a set of notes
-
-
- */
-
-
- init ()
- {
-
- const C4=48;
- const C#4=49;
- const D4=50;
- const D#4=51;
- const E4=52;
-
- const C3=36;
- const C#3=37;
- const D3=38;
- const D#3=39;
- const E3=40;
-
- var nbremp;
- var orig_note[100], orig_chan[100];
- var remp_note[100], remp_chan[100];
-
- nbremp=5;
-
- orig_note[0]=C4;
- orig_chan[0]=-1; /* put -1 for any channel */
- remp_note[0]=C3;
- remp_chan[0]=-1; /* put -1 to not change the channel */
-
- orig_note[1]=C#4;
- orig_chan[1]=4; /* C#4 of the channel 4 only */
- remp_note[1]=C#3;
- remp_chan[1]=3; /* put it back to channel 3 */
-
- orig_note[2]=D4;
- orig_chan[2]=-1; /* put -1 for any channel */
- remp_note[2]=D3;
- remp_chan[2]=-1; /* put -1 to not change the channel */
-
- orig_note[3]=D#4;
- orig_chan[3]=-1; /* put -1 for any channel */
- remp_note[3]=D#3;
- remp_chan[3]=-1; /* put -1 to not change the channel */
-
- orig_note[4]=E4;
- orig_chan[4]=-1; /* put -1 for any channel */
- remp_note[4]=E3;
- remp_chan[4]=-1; /* put -1 to not change the channel */
-
-
- savein (0);
-
- /* do not save the incoming notes */
- }
-
-
-
- main ()
- {
- var i;
- for (i=0;i<nbremp;i++)
- {
- if ( ((orig_chan[i]==-1) || (orig_chan[i]==chan))
- && ( orig_note[i]==note) )
- {
- note = remp_note[i];
- if (remp_chan[i]!=-1) chan = remp_chan[i];
- }
- }
-
- outmidi ();
-
-
- descript ("Replace a set of channel/note");
- descript ("by an another");
- }
-