public void invert(int invDir){
	int lown = -1;
	int highn = -1;
	for(int i=0; i < highnote-lownote+1; i++){
	    if(keyon[i] == true){
		lown = i;
		break;
	    }
	}
	if(lown >= 0){
	    for(int i=highnote-lownote; i>lown; i--){
		if(keyon[i] == true){
		    highn = i;
		    break;
		}
	    }
	}
	if(highn >= 0){
	    if(invDir > 0){
		stopNote(lownote+lown);
		while(lown <= highn)
		    lown += 12;
		playNote(lownote+lown);
	    }
	    else{
		stopNote(lownote+highn);
		while(highn >= lown)
		    highn -= 12;
		playNote(lownote+highn);
	    }
	}
    }