Best way to bootstrap custom patches?

This forum is for developers of Rack Extensions to discuss the RE SDK, share code, and offer tips to other developers.
sschoener
Posts: 11
Joined: 25 Dec 2020

Post 30 Dec 2020

Hello there!

I'm trying to create a device with custom patches, and the official SDK docs state:
It is not necessary for a 45 to support patches. If it does, however, the Public resources folder must contain a default patch (which is specified in info.lua). Creating a default patch manually (by editing an XML file) is not recommended. Instead, set default_patch in info.lua to any patch and create an instance of the 45 in Reason. Reason will fail to load the patch (and show an error message) but will not blow the fuse. Since your 45 is now running, it is now straightforward to create a patch, save it to the Public resources folder, and point to it in info.lua.
This sounds easy enough, but (as I've grown to expect from the docs by now) doesn't work. Specifically, Reason/Recon will first complain that the device IDs don't match and immediately deletes my device. OK, easy enough - fixed it in the XML. Now Reason complains:
The Rack Extension is too old to handle this patch/song.
OK, let's bump the device version from 1.0.0.0b1 to 1.1.0.0f1 for testing. Still doesn't work. Then I downgraded the patch file format from version 2 to version 1 (which is the version that is documented in the SDK docs). Still doesn't work, because of course it still deletes my device once it fails to load the patch.

So in short, the best way that I have found is to ignore the SDK docs and start with this template instead (assuming your device version for development is 1.0.0.0b1 or similar):

Code: Select all

<?xml version="1.0"?>
<JukeboxPatch version="1.0">
    <DeviceNameInEnglish>
        YOUR DEVICE NAME HERE
    </DeviceNameInEnglish>
    <Properties deviceProductID="YOUR.DEVICE.ID"  deviceVersion="0.9">
        <Object name="custom_properties" >
        </Object>
        <Object name="transport" />
    </Properties>
</JukeboxPatch>
Is there a better way?

User avatar
rcbuse
RE Developer
Posts: 921
Joined: 16 Jan 2015
Location: SR388

Post 31 Dec 2020

You shouldn't have to hand edit anything. If Recon is complaining about device IDs not matching, there is a higher level issue going on.

All you should have to do it load up your device, save a patch to YourREDirectory/Resources/Public/Init.repatch.
Edit YourREDirectory/info.lua and set
default_patch = "/Public/Init.repatch"

I've never had to hand edit any repatch file to get things working.

I suspect you are not saving your file to the proper location or you have some stale repatch files somewhere.

sschoener
Posts: 11
Joined: 25 Dec 2020

Post 31 Dec 2020

Thanks!

I'm not sure I see how I can save out a patch without first setting a default patch? If I set my device to support patches, I need to supply a default patch (otherwise Recon will complain that I haven't set a default patch). If I don't set my device to support patches, I cannot save patches. Or at least that were my assumptions so far - sounds like one of them is wrong.

User avatar
buddard
RE Developer
Posts: 900
Joined: 17 Jan 2015
Location: Stockholm

Post 04 Jan 2021

sschoener wrote:
31 Dec 2020
Thanks!

I'm not sure I see how I can save out a patch without first setting a default patch? If I set my device to support patches, I need to supply a default patch (otherwise Recon will complain that I haven't set a default patch). If I don't set my device to support patches, I cannot save patches. Or at least that were my assumptions so far - sounds like one of them is wrong.
If the default patch is missing, Recon will complain with a popup window, but it won't stop you from loading the RE. Just see it as warning.
Then set up the state of your device and save the patch with the name specified in info.lua.

If you get a message about mismatching IDs it means you have a .repatch somewhere with the wrong data.
First check in your Resources/Public directory and remove any .repatch files you might find there.
Also check the RackExtensions_dev folder (in different locations on Mac and Windows), which is where the locally built devices are installed. Just delete the sub folder for your RE under RackExtensions_dev, it will be rebuilt next time you build your local45.

  • Information
  • Who is online

    Users browsing this forum: CommonCrawl [Bot] and 0 guests