{do {source=getRandomPatch(); } while ((source.driverNum!=father.driverNum)||(source.sysex.length<i));
{do {source=getRandomPatch(); } while ((source.driverNum!=father.driverNum)||(source.sysex.length<i) || source.deviceNum!=father.deviceNum);
  public void generateNewPatch()  {  try {     Patch father=getRandomPatch();     Patch source;     byte [] sysex= new byte[father.sysex.length];     p=new Patch(sysex);     p.comment=new StringBuffer(); // Clear the wrong "Invalid Manufacturer" comment!     for (int i=0;i<father.sysex.length;i++)       {do {source=getRandomPatch(); } while ((source.driverNum!=father.driverNum)||(source.sysex.length<i));         p.sysex[i]=source.sysex[i];       }     p.driverNum=father.driverNum;     p.deviceNum=father.deviceNum;     PatchEdit.getDriver(p.deviceNum,p.driverNum).calculateChecksum(p);     //((Driver)(PatchEdit.DriverList.get(p.driverNum))).calculateChecksum(p);   }catch (Exception e) {ErrorMsg.reportError("Error", "Source Library Must be Focused",e);}  }