public void addFile(InputStream stream) throws InvalidMidiDataException, IOException {		
		Sequence seq = MidiSystem.getSequence(stream);

		for( Track t : seq.getTracks()) {
			for( int i = 0; i < t.size(); i++) {
				MidiEvent event = t.get(i);	
				MidiMessage m = event.getMessage();
				
				/*
				 * We do not want to add zero notes, since they destroy the flow
				 * inbetween two midi measure files
				 */
				if( m.getStatus() == MIDI_NOTE_ON) {					
					if( m.getMessage()[1] == 0 || m.getMessage()[2] == 0) {
						break;
					}
				}
				
				long tick = event.getTick();
				event.setTick(tick + offset);
				track.add(event);				
			}
		}		
		offset = sequence.getTickLength();
	}