for(int i=10; i<sysexpayload.length; i+=10) { sysexmsg.setMessage(sysexpayload,i); msgList.addElement(sysexmsg.clone());
if (testSysexMessage) {  SysexMessage sysexmsg = new SysexMessage();  byte[] sysexpayload = new byte[MAX_SYSEX_SIZE];   sysexpayload[0] = (byte) 0xF0; for(int i=1; i<sysexpayload.length; i++) { sysexpayload[i] = (byte) (i % 128); }    for(int i=10; i<sysexpayload.length; i+=20) { sysexmsg.setMessage(sysexpayload,i); msgList.addElement(sysexmsg.clone()); }
	private static Vector getMidiMessages() throws Exception {		Vector msgList = new Vector();		ShortMessage msg = new ShortMessage();		// Make a bunch of messages and try sending them. Why use data bytes 0x4B, 0x70?		// Well, it's binary 0100110001110000 (a zero, a one, two zeroes, two ones, etc.)		// I wanted to pick some sequence that, if it was shifted a little bit, wouldn't		// match iteself - emenaker 2003.03.20		// Channel Voice Messages		msg.setMessage(ShortMessage.NOTE_OFF,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.NOTE_ON,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.POLY_PRESSURE ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.CONTROL_CHANGE ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.PROGRAM_CHANGE ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.CHANNEL_PRESSURE ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.PITCH_BEND ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		// System Real-Time Messages		msg.setMessage(ShortMessage.TIMING_CLOCK ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.START ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.CONTINUE ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.STOP ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		// Active sensing didn't work on for me with JavaMidi... so I'm omitting it here - emenaker 2003.03.20		//msg.setMessage(ShortMessage.ACTIVE_SENSING ,(byte)0x4B, (byte)0x70);		//msgList.addElement(msg.clone());				// System Common Messages		msg.setMessage(ShortMessage.MIDI_TIME_CODE ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.SONG_POSITION_POINTER ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());		msg.setMessage(ShortMessage.SONG_SELECT ,(byte)0x4B, (byte)0x70);		msgList.addElement(msg.clone());				// Sysex messages		SysexMessage sysexmsg = new SysexMessage();					byte[] sysexpayload = new byte[500];		// Initialize the buffer... making sure that no bytes are greater than 128		sysexpayload[0] = (byte) 0xF0; // Sysex-Start command		for(int i=1; i<sysexpayload.length; i++) {			sysexpayload[i] = (byte) (i % 128);		}		// Start with a message of a certain size and keep increasing until we get to the		// biggest size we've got - emenaker 2003.03.20		for(int i=10; i<sysexpayload.length; i+=10) {			sysexmsg.setMessage(sysexpayload,i);			msgList.addElement(sysexmsg.clone());		}		return(msgList);	}