示例#1
0
void	inpmon()
{
	int	a,b,c,f=0;

	all_note_off(1);outch=0;prog=0;

	fill(0,544,767,1001,0);box(0,564,767,1001,14,65535);
	sdis(0,548," MIDI INPUT MONITOR",20,15,8);
	home2(512);

	C_WINDOW(0,32);

	B_LOCATE(2,31);B_PRINT("MIDI IN:");B_PRINT(mdinport());

	B_LOCATE(25,31);B_PRINT("OUT MIDI CH.:THRU");
	B_LOCATE(76,31);B_PRINT("[ESC]�ŏI�����܂��B");
	C_WINDOW(4,26);B_LOCATE(0,0);
	midi_clr();

	while(1){
		if(f==0){a=midi_inout();}else{a=f;f=0;}
		if( a<0 ){break;}

		if( a>127 && a<0xf0){B_PRINT("\r\nch=");B_PRINT(fstr((a&15)+1,2));B_PRINT(" : ");}

		if( a>=0x80 && a<=0x9f){
			if( a<0x90 ){B_PRINT("note off :");}else{B_PRINT("note on  :");}
			while(1){
				b=midi_inout();if(b>127 ||b<0){f=b;break;}
				c=midi_inout();
				B_PRINT(keystr(b));B_PRINT(fstr(b,3));B_PRINT(",");
				B_PRINT(fstr(c,3));B_PRINT(":");
			}
			a=-1;
		}
		if( a>=0xa0 && a<=0xaf){
			B_PRINT("after key:");
			while(1){
				b=midi_inout();if(b>127 ||b<0){f=b;break;}
				c=midi_inout();
				B_PRINT(fstr(b,3));B_PRINT(",");
				B_PRINT(fstr(c,3));B_PRINT(":");
			}
			a=-1;
		}
		if( a>=0xb0 && a<=0xbf){
			B_PRINT("control  :");
			while(1){
				b=midi_inout();if(b>127 ||b<0){f=b;break;}
				c=midi_inout();
				B_PRINT(fstr(b,3));B_PRINT(",");
				B_PRINT(fstr(c,3));B_PRINT(":");
			}
			a=-1;
		}
		if( a>=0xc0 && a<=0xcf){
			b=midi_inout();
			B_PRINT("prog ch. : no.=");B_PRINT(fstr(b+1,3));
			a=-1;
		}
		if( a>=0xd0 && a<=0xdf){
			B_PRINT("after ch.:");
			while(1){
				b=midi_inout();if(b>127 ||b<0){f=b;break;}
				B_PRINT(fstr(b,3));B_PRINT(":");
			}
			a=-1;
		}
		if( a>=0xe0 && a<=0xef){
			B_PRINT("pitch    :");
			while(1){
				b=midi_inout();if(b>127 || b<0){f=b;break;}
				c=midi_inout();
				B_PRINT(fstr((c*128+b)-8192,5));
				B_PRINT(":");
			}
			a=-1;
		}
		if( a==0xf0 ){
			B_PRINT("\r\n exclusive : ");
			while(1){
				b=midi_inout();if(b>127 || b<0){f=b;break;}
				B_PRINT(hex_s(b,2));
				B_PRINT("H ");
			}
			a=-1;
		}
		if( a>=0 ){B_PRINT(fstr(a,4));}
	}
	C_WINDOW(0,32);B_CLR_AL();home2(0);
}
示例#2
0
void
comline(void)
{
	long c1, c2;

	while(C==' ' || c=='\t')
		;
comx:
	if((c1=c) == '\n')
		return;
	c2 = C;
	if(c1=='.' && c2!='.')
		inmacro = NO;
	if(msflag && c1 == '['){
		refer(c2);
		return;
	}
	if(c2 == '\n')
		return;
	if(c1 == '\\' && c2 == '\"')
		SKIP;
	else
	if (filesp==files && c1=='E' && c2=='Q')
			eqn();
	else
	if(filesp==files && c1=='T' && (c2=='S' || c2=='C' || c2=='&')) {
		if(msflag)
			stbl(); 
		else
			tbl();
	}
	else
	if(c1=='T' && c2=='E')
		intable = NO;
	else if (!inmacro &&
			((c1 == 'd' && c2 == 'e') ||
		   	 (c1 == 'i' && c2 == 'g') ||
		   	 (c1 == 'a' && c2 == 'm')))
				macro();
	else
	if(c1=='s' && c2=='o') {
		if(iflag)
			SKIP;
		else {
			getfname();
			if(fname[0]) {
				if(infile = opn(fname))
					*++filesp = infile;
				else infile = *filesp;
			}
		}
	}
	else
	if(c1=='n' && c2=='x')
		if(iflag)
			SKIP;
		else {
			getfname();
			if(fname[0] == '\0')
				exits(0);
			if(Bfildes(&(infile->Biobufhdr)) != 0)
				Bterm(&(infile->Biobufhdr));
			infile = *filesp = opn(fname);
		}
	else
	if(c1 == 't' && c2 == 'm')
		SKIP;
	else
	if(c1=='h' && c2=='w')
		SKIP; 
	else
	if(msflag && c1 == 'T' && c2 == 'L') {
		SKIP_TO_COM;
		goto comx; 
	}
	else
	if(msflag && c1=='N' && c2 == 'R')
		SKIP;
	else
	if(msflag && c1 == 'A' && (c2 == 'U' || c2 == 'I')){
		if(mac==MM)SKIP;
		else {
			SKIP_TO_COM;
			goto comx; 
		}
	} else
	if(msflag && c1=='F' && c2=='S') {
		SKIP_TO_COM;
		goto comx; 
	}
	else
	if(msflag && (c1=='S' || c1=='N') && c2=='H') {
		SKIP_TO_COM;
		goto comx; 
	} else
	if(c1 == 'U' && c2 == 'X') {
		if(wordflag)
			Bprint(&(bout.Biobufhdr), "UNIX\n");
		else
			Bprint(&(bout.Biobufhdr), "UNIX ");
	} else
	if(msflag && c1=='O' && c2=='K') {
		SKIP_TO_COM;
		goto comx; 
	} else
	if(msflag && c1=='N' && c2=='D')
		SKIP;
	else
	if(msflag && mac==MM && c1=='H' && (c2==' '||c2=='U'))
		SKIP;
	else
	if(msflag && mac==MM && c2=='L') {
		if(disp || c1=='R')
			sdis('L', 'E');
		else {
			SKIP;
			Bprint(&(bout.Biobufhdr), " .");
		}
	} else
	if(!msflag && c1=='P' && c2=='S') {
		inpic();
	} else
	if(msflag && (c1=='D' || c1=='N' || c1=='K'|| c1=='P') && c2=='S') { 
		sdis(c1, 'E'); 
	} else
	if(msflag && (c1 == 'K' && c2 == 'F')) { 
		sdis(c1,'E'); 
	} else
	if(msflag && c1=='n' && c2=='f')
		sdis('f','i');
	else
	if(msflag && c1=='c' && c2=='e')
		sce();
	else {
		if(c1=='.' && c2=='.') {
			if(msflag) {
				SKIP;
				return;
			}
			while(C == '.')
				;
		}
		inmacro++;
		if(c1 <= 'Z' && msflag)
			regline(YES,ONE);
		else {
			if(wordflag)
				C;
			regline(YES,TWO);
		}
		inmacro--;
	}
}