StringBuffer patchString= new StringBuffer ("F0"); for (int i=1;i<16;i++) { if (sysex.length>i) { if (sysex[i]<16) patchString.append ("0"); patchString.append (intg.toHexString (sysex[i]&0xff)); } }
StringBuffer patchString=this.getPatchHeader();
    public void ChooseDriver ()    {        Device dev;        driverNum=0;        deviceNum=0;        Integer intg=new Integer (0);        StringBuffer patchString= new StringBuffer ("F0");        for (int i=1;i<16;i++)        {            if (sysex.length>i) {                if (sysex[i]<16)                     patchString.append ("0");               patchString.append (intg.toHexString (sysex[i]&0xff));            }        }        StringBuffer driverString=new StringBuffer ();        for ( int i2 =0;i2<PatchEdit.appConfig.deviceCount (); i2++)        {            // Outer Loop, iterating over all installed devices            dev=(Device)PatchEdit.appConfig.getDevice (i2);            for (int j=0;j<dev.driverList.size ();j++)            {                // Inner Loop, iterating over all Drivers of a device                if (((Driver)dev.driverList.get (j)).supportsPatch (patchString,this))                {                    driverNum=j;                    deviceNum=i2;                    getDriver().trimSysex(this);                    return;                }            }        }        // Unkown patch, try to guess at least the manufacturer        comment=new StringBuffer("Probably a "+LookupManufacturer.get(sysex[1],sysex[2],sysex[3])+" Patch, Size: "+sysex.length);            }