Is the preset documentation up2date?

I want to write my own presets and just had a look at a very simple preset generated by the browser app. It looks like the preset format changed from what is documented here. For example, the tiles attribute is missing. When I’m looking at the schema linked in the documentation it seems to match the documentation. What’s going on there?

yup, it is up to date. The button on the Preset detail downloads a project file, which is a data structure that holds both, the preset data and the lua script. The project file is handy and easy to use for non-developers. But I agree that an option to to download the preset should be there. @jhh, run into the same issue recently. I will try to improve this somehow.

Ok I need some time to wrap my head around this. Quite confusing to me. Presets and projects can both have similar features like pages and devices and it’s also possible to define controls within both formats so they seem not to be hierarchal (like a 1 to n relationship). But there’s actually a projectId field in the preset but a project is obviously something different and it’s also not 100% clear if it’s referring to a project. If it refers to a project, then the preset itself wouldn’t have an ID and would also somehow imply a hierarchy. After all my guess is that the data structures are somehow merged which is not very intuitive.

Ok, I will try to explain :slight_smile:

Electra hardware controller understands three types of files (data structures):

  1. Preset JSON (.epr file)
  2. Lua script (.lua file)
  3. Config JSON (.cfg)

These are documented on https://docs.electra.one/

Electra does not care what software created these files. Once they are transferred to the controller, they will define what the controller does. So, from the developer perspective, the main interest should be around these files.

The Project JSON (.eproj file) is a data structure that Web editor running at https://app.electra.one/ uses to store the state of the editor. The Project JSON is never transferred to the controller. When the “Send to Electra” button is hit, app.electra.one will use the information in the Project JSON to generate the Preset JSON and the Lua script and will transfer these to the controller using the SysEx transfers. The Project JSON consists of extra meta info that is needed for the editing, categorizing, describing the actual Preset and Lua in it. On contrary, the Preset JSON and Lua that is transferred to Electra are compact info that can be run by the hardware. (no meta info, deduplicated overlays, minified ids, etc).

I think that there is basically no need for anybody besides people who develop app.electra.one (me :slight_smile: to understand and use the Project JSON. That is the main reason why it is not documented on the web. The option to download the project is really meant towards the users to give them a chance to save the project file locally on the computer for backup purposes or for importing that to different account.

The projectId in the Preset JSON is text field that allows to reference whatever the composer app/editor of the Preset JSON finds useful. A snippet from the Preset JSON documentation:

In case of the app.electra.one, I use the projectId to keep a reference for the Project in the web editor and also link snapshots to the presets.

I hope this helps. If not, please keep asking. Thx!

5 Likes