IPatch p = new Patch(sysex, getDevice());
Patch p = new Patch(sysex, getDevice());
  public IPatch getPatch(IPatch b, int patchNum)   {  	Patch bank = (Patch)b;  try{     generateIndex(bank);     int patchSize;     if (patchIndex[patchNum]==0) return null;     int i=patchNum+1;     while((i<128)&&(patchIndex[i]==0)) i++;     patchSize=patchIndex[i]-patchIndex[patchNum];     patchSize+=10;     byte [] sysex=new byte[patchSize];     sysex[00]=(byte)0xF0;sysex[01]=(byte)0x40;sysex[02]=(byte)0x00;     sysex[03]=(byte)0x20;sysex[04]=(byte)0x00;sysex[05]=(byte)0x0A;     sysex[06]=(byte)0x00;sysex[07]=(byte)0x00;sysex[8]=(byte)0x00;     sysex[patchSize-1]=(byte)0xF7;     System.arraycopy(((Patch)bank).sysex,getPatchStart(patchNum),sysex,9,patchSize-10);     IPatch p = new Patch(sysex, getDevice());     p.getDriver().calculateChecksum(p);    return p;    }catch (Exception e) {ErrorMsg.reportError("Error","Error in K5000 Bank Driver",e);return null;}   }