I thought I would share a small lesson I learned as a novice developer of E1 presets. Today I modified my PCM preset for the Integra that I had based on the @NewIgnis version for the XV5080. I deleted all the long list items in the preset and replaced them with lua tables and overlays instead. That eliminated close to 4000 lines from the JSON file while adding just 300 lines to the lua file. I may well be imagining it but scrolling through the newly formed lists felt a little snappier too. This is probably not an issue for most applications, and the preset editor is very handy. But if you are in a situation where you are running out of memory, as I was, it may be something to consider.
Cheers
3 Likes
Good to know you’re building and improving on it. The XV5080 was WIP and it is super that I can learn from your findings now ! Do you have both versions still ? the one before and after the modification? I’d like to peek
Here is old. Here is new. Not quite apples to apples because I made several other changes to the preset layout and parsed some additional parameters in the new version. Still WIP. But you should see how I adjusted the formatting of the lists. The only downsides I see to the lua approach are
- The need to do some set up work. I created the list data and formatted it in excel (using pdf lists as the source when available) and then just cut and pasted into the lua editor.
- To transfer the list tables and overlays to another preset you will need to change the controller ids to match those in the other preset.
- Not sure how to handle bitmaps. But it may be doable.
John
PS. It is amazing how much the Integra borrowed from the XV5080 for the PCM engine. In the parameter map doc you can even see where the few parameters that are in the XV5080 but not in the Integra are shown as reserved in the Integra parameter map - so the parameter numbers line up exactly. I have not tested whether or not the Integra will respond to those reserved parameters.
The is another preset I made,where I create large, complex overlays in lua and then assign them to the right controls. Maybe that is then best of both worlds? It s the one for the Zoom CDR70 pedal. A lot of specific overlays were needed there for each type of effect.
1 Like
Your preset is great! It would be great if you could post one example of how to use excel formatted data in a lua script to define text overlays for controls. I thought it could be possible to import the text overlays from a text file in the editor but apparently it’s not and I’m a total newbie to scripting
Will do. I’ll post an example excel file (if that is allowed) and the associated Lua script. It would be great to be able to store Lua tables as files and call them when needed. But don’t think that is possible. Currently the Lua file is bloated with tables of text making it a bit hard to navigate. Perhaps in future firmware.
Here you go. I had to rename the excel file as a .txt for the app to allow posting. You will have to rename it with the .xlsx extension if you are using excel in Windows. The formatting in excel is mostly to do with adding a bunch of “” and concatenating objects with the & symbol until you get it the way you want it. Look at the formula to see what I did. The source data are from a pdf doc. I have a pdf app that converts pdf to excel which is very handy.
The other text file is example lua script for implementing an overlay for a list control and a formatter function for a fader using the data from the excel file. A word of warning. My experience is that formatter functions are very delicate beasts and the E1 can react violently if you mess up by having too few elements in the format array. The overlay function is more forgiving but you have to be careful that you are not accidentally creating an overlay Id that already exists. Otherwise you will see the other control populated with the overlay data as well (I’m still untangling from that mess
)
I am relatively new to using lua and so there are probably much better ways to do things and to avoid problems. Asking the forum is the way to go if the online documentation for the lua api doesn’t help. Its a good thing the forum is so fantastic.
Pleased you like the preset. There is a new version in the works that has significantly increased functionality.
overlay and formatter example lua code.txt (1.4 KB)
Excel file for patch name list overlay and wave name fader format function.txt (10.7 KB)
1 Like
Thanks a lot it worked! I was able to write 128 Fader Levels in Excel and have them displayed on the E1 for the Cubase controller I’m working on; and yes you were right, the formatter function is really a delicate beast, I initially forgot one value on the formatter array and the E1 crashed, I had to reboot it to make it work again
1 Like