void processInput() {
		saveUndo();
		
		println("procIn");
		Event e=getLastEvent();
		if (inputMode.equals("/")) {// input osc msg name
			if (!inputStr.startsWith("/") && !inputStr.startsWith("$") && !inputStr.startsWith("%")) {inputStr="/"+inputStr;}
			setEventSelection(Event.FIELD_OSCMSGNAME,inputStr,timeLineObject.selection); 
		} else if (inputMode.equals("v")) {// input value
			String valToSet=inputStr;
			if (valToSet.startsWith("%")) {
				exprUtil.setThis(timeLineObject, e);
				Object o=exprUtil.getValueExpr(valToSet);
				exprUtil.clearThis();
				if (o==null) {return;}
				valToSet=o.toString();
			}
			if ((editValueIndex>-1) &&(editValueIndex<editValueVector.size())) {
				//editValueVector.set(editValueIndex,Event.getValueFromStr(inputStr));
				valToSet=Event.getValueStr(editValueVector);
				setEventSelection(Event.FIELD_VALUEINDEX,editValueIndex+" " +inputStr,timeLineObject.selection);
			}
			else {
				setEventSelection(Event.FIELD_VALUE,valToSet,timeLineObject.selection);
			}
			//slidersDraw.setVisible(false);
		}  else if (inputMode.equals("V")) {// input value index
			try {
				editValueIndex=Integer.parseInt(inputStr);
			} catch (NumberFormatException n) {editValueIndex=-1;}
		}  else if (inputMode.equals("t")) {// inpput time line length
			try {
				timeLineObject.timeLineLength=Integer.parseInt(inputStr);
				timeLineObject.displayStart=0;
				timeLineObject.displayEnd= timeLineObject.timeLineLength;
			}  catch (NumberFormatException n) {showMessage("timeline length - bad int format: "+inputStr,LogWindow.TYPE_ERROR);}
		}
		else if (inputMode.equals("q")) {// input quantization step
			try {timeLineObject.quantize=Integer.parseInt(inputStr);}
			catch (NumberFormatException n) {showMessage("quantize - bad int format: "+inputStr,LogWindow.TYPE_ERROR);}
		}
		else if (inputMode.equals("k")) {// input color
			timeLineObject.setColor(inputStr);
		}
		else if (inputMode.equals("g")) {
			if (inputStr.lastIndexOf("-") == inputStr.length()-1) {
				timeLineObject.removeGroup(inputStr.substring(0,inputStr.length()-1));
			}
			else {timeLineObject.addGroup(inputStr);} 
		}
		else if (inputMode.equals("b")) {// input (quantisation steps/beat) - (beats/bar)
			timeLineObject.setBeats(inputStr);
		}
		else if (inputMode.equals("B")) {// input (quantisation steps/beat) - (beats/bar)
			try {
				calcUtil.setBPM(timeLineObject, Integer.parseInt(inputStr));
			}	catch (NumberFormatException n) {showMessage("bpm - bad int format: "+inputStr,LogWindow.TYPE_ERROR);}
		}
		else if (inputMode.equals("M")) {//set osc server index
			try {
				int chooseOsc=Integer.parseInt(inputStr);
				if (chooseOsc<oscServers.length) {
					timeLineObject.oscIndex=chooseOsc;
					//timeLineObject.oscP5= oscServers[ timeLineObject.oscIndex];
				}
			}
			catch (NumberFormatException n) {showMessage("set OscIndex(M) - bad int format: "+inputStr,LogWindow.TYPE_ERROR);}
		}
		else if (inputMode.equals("m")) {//set osc server index
			try {
				int chooseOsc=Integer.parseInt(inputStr);
				if (chooseOsc<oscServers.length) {
					setEventSelection(Event.FIELD_OSCINDEX,new Integer(chooseOsc),timeLineObject.selection);
					setEventSelection(Event.FIELD_OSCP5,oscServers[chooseOsc],timeLineObject.selection);
				}
			}
			catch (NumberFormatException n) {showMessage("set OscIndex(m) - bad int format: "+inputStr,LogWindow.TYPE_ERROR);}
		}
		else if ("Ff".indexOf(inputMode)>-1) {
			//input filename
			if (!isUnix) {inputStr=inputStr.replaceAll("/","\\\\");}
			String newFileName=inputStr.trim();
			if (!newFileName.endsWith(".xml")) { newFileName=newFileName+".xml";}
			// RM_FP: fix this so path get set, have to make compiler dirs here as well
			if ("F".equals(inputMode)) {fileUtil.loadAdditionalTimelines(newFileName);}
			else if ("f".equals(inputMode)) {
				if (newFileName.indexOf(this.dataFilePath)!=0) {
					String path=inputStr.substring( 0, inputStr.lastIndexOf(File.separator)+1 );
					setDataFilePath(path);
				}
				newFileName=newFileName.substring(this.dataFilePath.length(), inputStr.length());
				setFileName(newFileName);
			}
		}
		else if (inputMode.equals("n")) {
			TimeLineObject test = getTimeline(inputStr);
			TimeLineSet testSet = getTimelineSet(inputStr);
			if (test==null && testSet==null) {
				timeLineObject.setId(inputStr);
			} else {
				showMessage("Name exists: enter another", LogWindow.TYPE_WARN);
				setInputStr(getNextName(inputStr));
				return;
			}
		}
		else if (inputMode.equals("ne")) {
			setEventSelection(Event.FIELD_ID,inputStr,timeLineObject.selection);
			//getLastEvent().id=inputStr;
		}
		else if (inputMode.equals("w")) {// input superimpose timeline
			
			timeLineObject.pitch=Float.valueOf(inputStr).floatValue();
		}
		else if (inputMode.equals("W")) {// confirm delete timeline 
			if (inputStr.toLowerCase().equals("y")) {timeLineObject.normaliseOnPitch();}
		}
		else if (inputMode.equals("E")) {// confirm clear timeline
			if (inputStr.toLowerCase().equals("y")) {clearEveryThing();}
		}
		else if (inputMode.equals("d")) {// confirm delete event
			if (inputStr.toLowerCase().equals("y")) {deleteEvent();}
		}
		else if (inputMode.equals("D")) {// confirm delete timeline;
			if (inputStr.toLowerCase().equals("y")) {deleteTimeLine();}
		}
		else if (inputMode.equals("N")) {// iinput note, remove noter if trailed by a -
			if (inputStr.lastIndexOf("-") == inputStr.length()-1) {
				for (int i=0;i<notes.size();i++) {
					if (inputStr.indexOf((String)notes.get(i))==0) {notes.remove(i);}
				}
			} else {	notes.add(inputStr); }
		}
		else if (inputMode.equals("+")) {// iinput note
			if ("".equals(inputStr)) {midiUtil.dumpMidiNoteMap();}
			else midiUtil.setMidiNoteRange(inputStr);
		}
		else if (inputMode.equals("=")) {// iinput note
			if ("".equals(inputStr)) {midiUtil.dumpMidiCtlMap();}
			else midiUtil.setMidiControl(inputStr);
			currentMIDIInputDevice="";
		}
		else if (inputMode.equals("e")) {// input timeline target.
			if (e!=null) {     
				String[] input=inputStr.split(":");
				String targetPlayMode="p";
				if (input[0].equals(e.getTargetId())) {     
					if ("p".equals(e.targetPlayMode)){targetPlayMode="l";}
					else if ("l".equals(e.targetPlayMode)){targetPlayMode="";}
					//else if ("l".equals(e.targetPlayMode)){targetPlayMode="b";}
					//else if ("b".equals(e.targetPlayMode)){targetPlayMode="";}
					else if ("".equals(e.targetPlayMode)){targetPlayMode="p";}
				}
				setEventSelection(Event.FIELD_TARGET,getTimeline(input[0]),timeLineObject.selection); 
				setEventSelection(Event.FIELD_TARGETPLAYMODE,targetPlayMode,timeLineObject.selection);
				if (input.length==2) { 
					setEventSelection(Event.FIELD_TARGETDATA,input[1],timeLineObject.selection);
				}
			}
		}else if (inputMode.equals("I")) {
			timeLineObject.followOnExpr=inputStr;
		}else if (inputMode.equals("i")) {
			midiUtil.importMIDI(inputStr.trim());
		}else if (inputMode.equals("J")) {
			loadInterface(inputStr.trim());
		}else if (inputMode.equals("y")) {
			//add filter.
			boolean delete=false;
			boolean found=false;
			if (inputStr.endsWith("-")){delete=true;inputStr=inputStr.substring(0,inputStr.length()-1);}
			String filterSplit[] = inputStr.split(" ");
			Vector v=(Vector)filters.get(filterSplit[0]);
			if (v==null && !delete) {
				v=new Vector();
				filters.put(filterSplit[0],v);
			}
			for (int i=0;i<v.size();i++){
				FilterBean fb=(FilterBean)v.get(i);
				if (fb.getExpr().equals(filterSplit[1])){
					found=true;
					if (delete) {
						v.remove(fb);
					} //else {
					//	   fb.setActive(!fb.isActive());
					//   }
				}
			}
			if (!found && filterSplit.length>1) {
				FilterBean fb=new FilterBean() ;
				fb.setExpr(filterSplit[1]);
				v.add(fb);
			} else {
				showMessage("filter(y): '<src> <tgt>' expected.",LogWindow.TYPE_ERROR);
			}
		}else if (inputMode.equals("T")) {
			if (editValueIndex>-1) {
				if (timeLineObject.parameters.size()>editValueIndex) {
					timeLineObject.parameters.set(editValueIndex,Event.getValueFromStr(inputStr));
				}
			}
			else {
				Vector v=new Vector();
				String newVals[]=inputStr.split(" ");
				for (int i=0;i<newVals.length;i++) {
					v.add(Event.getValueFromStr(newVals[i]));
				}
				timeLineObject.parameters=v;
			}
		}else if (inputMode.equals("h")) {
			if (!"".equals(inputStr)) {
				String currMapEdit=midiWin.getCurrMapEdit();
				if (currMapEdit.indexOf("=")==0) {
					HashMap ctlDevMap=(HashMap)allMidiControlMaps.get(midiWin.getCurrMIDIDev());
					if (ctlDevMap.get(inputStr)!=null){showMessage("Name exists:"+inputStr+" ... delete first.");return;}
					Object o=ctlDevMap.get(currMapEdit.substring(1));
					ctlDevMap.remove(currMapEdit.substring(1));
					ctlDevMap.put(inputStr,o);
					if (currentMidiControlMapIds.get(midiWin.getCurrMIDIDev()).equals(currMapEdit.substring(1))) {
						currentMidiControlMapIds.put(midiWin.getCurrMIDIDev(),inputStr);
					}
				} else if (currMapEdit.indexOf("+")==0) {
					HashMap noteDevMap=(HashMap)allMidiNoteMaps.get(midiWin.getCurrMIDIDev());
					if (noteDevMap.get(inputStr)!=null){showMessage("Name exists:"+inputStr+" ... delete first.");return;}
					Object o=noteDevMap.get(currMapEdit.substring(1));
					noteDevMap.remove(currMapEdit.substring(1));
					noteDevMap.put(inputStr,o);
					if (currentMidiNoteMapIds.get(midiWin.getCurrMIDIDev()).equals(currMapEdit.substring(1))) {
						currentMidiNoteMapIds.put(midiWin.getCurrMIDIDev(),inputStr);
					}
				}
			}
		} else if (inputMode.equals("H")) {
			if ("yY".indexOf(inputStr)>=0) {
				String currMapEdit=midiWin.getCurrMapEdit();
				if (currMapEdit.indexOf("=")==0) {
					HashMap ctlDevMap=(HashMap)allMidiControlMaps.get(midiWin.getCurrMIDIDev());
					ctlDevMap.remove(currMapEdit.substring(1));
					if (currentMidiControlMapIds.get(midiWin.getCurrMIDIDev()).equals(currMapEdit.substring(1))) {
						currentMidiControlMapIds.put(midiWin.getCurrMIDIDev(),null);
						currentMidiControlMaps.put(midiWin.getCurrMIDIDev(),null);
					}
				} else if (currMapEdit.indexOf("+")==0) {
					HashMap noteDevMap=(HashMap)allMidiNoteMaps.get(midiWin.getCurrMIDIDev());
					noteDevMap.remove(currMapEdit.substring(1));
					if (currentMidiNoteMapIds.get(midiWin.getCurrMIDIDev()).equals(currMapEdit.substring(1))) {
						currentMidiNoteMapIds.put(midiWin.getCurrMIDIDev(),null);
						currentMidiNoteMaps.put(midiWin.getCurrMIDIDev(),null);
					}
				}			
			}
		} else if ("123456789".indexOf(inputMode)>-1) {
			String bindingVar= inputStr.trim();
			if ( bindingVar.lastIndexOf("-")==bindingVar.length()-1) {
				midiKeyBindings.remove(inputMode);
			}
			else if (!"".equals(bindingVar)) {midiKeyBindings.put(inputMode, bindingVar);}
		} else if (inputMode.equals("R")) {// set the recording granularity in ms.
			try {
				this.recordGranularity=Integer.parseInt(inputStr);
			} catch (NumberFormatException e1) {
				showMessage("recordGranularity - must be int.",LogWindow.TYPE_ERROR);
			}
		} else if (inputMode.equals("r")) {// set the recording granularity in ms.
			boolean checkValid=(inputStr.indexOf("/")==0);
			for (int i=0;i<midiDeviceNames.length && !checkValid;i++) {
				if (!"".equals(inputStr) && midiDeviceNames[i].indexOf(inputStr)==0) {checkValid=true;} 
			}
			if (checkValid || "".equals(inputStr)) {this.recordInput=inputStr;}
		}	else if (inputMode.equals("S")) {
			inputStr = inputStr.trim();
			if (!"".equals(inputStr)) {
				if (inputStr.charAt(inputStr.length()-1)=='-') {
					TimeLineSet s = getTimelineSet(inputStr.substring(0,inputStr.length()-1));
					if (s!=null ) {timeLineSets.remove(s);}
				} else {
					TimeLineObject testTimeLine = getTimeline(inputStr);
					TimeLineSet testSet = getTimelineSet(inputStr);
					if (testTimeLine==null && testSet==null) {
						if (timeLineSet!=null) {
							timeLineSet.setId(inputStr);
						}	else {
							boolean add=false;
							TimeLineSet s = getTimelineSet(inputStr);
							if (s==null)   {s = new TimeLineSet(this);add=true;} 
							s.clear();
							s.addAll(timeLineSelection);
							s.setId(inputStr);
							if (add) timeLineSets.add(s);
						}
					} else {
						showMessage("Name exists: enter another", LogWindow.TYPE_WARN);
						setInputStr(getNextName(inputStr));
						return;
					}
				}
			} else {showMessage("Nothing entered.", LogWindow.TYPE_ERROR);}
		}	else if (inputMode.equals("O")) {
			if (inputStr.lastIndexOf("-")==inputStr.length()-1) {
				String key = inputStr.substring(0,inputStr.length()-1);
				if (!stdObjectClasses.containsKey(key)) {
					dynamicObjects.remove(key);
				}else {
					showMessage("Do not delete standard objects.", LogWindow.TYPE_ERROR);
				}
			}
		} 
		cancelInput();
	}