(Here is a first draft post introducing the Middle Layer SDK. I will be expanding it over the next few days.)
The Middle Layer SDK allows you to construct Units using the Lua scripting language in the same way that the builtin units are constructed. In a nutshell, you construct a unit by:
- Required: Give your unit a title. (i.e. Override and implement the init method)
- Required: Building the unit’ internal DSP graph by instantiating DSP objects and connecting them together in useful ways. (i.e. Implement the onLoadGraph method of your unit.)
- Required: Building the unit’s GUI by creating controls and connecting them to the appropriate ports and parameters of your DSP graph. (i.e. Implement the onLoadViews method of your unit.)
- Optional: Adding any special-purpose serialization/deserialization code (i.e. stuff that you want to save in a preset that is not already handled automatically for you). (i.e. Override and implement the serialize and deserialize methods)
- Optional: Adding any special-purpose menu commands. (i.e. Implement the onLoadMenu method)
Once you have one (or more) units coded. Then you need to collect them into a library. This just means:
- Placing all necessary files in a folder.
- Creating a library description file called init.lua in the same folder. This init.lua file is where you name your library and list all of the units it contains as well as some other meta data.
Finally, you would copy this library folder (containing your unit files and the init.lua) to the ER-301/libs of your front SD card. The ER-301 will automatically detect the new library and load it. Now whenever you insert a unit, you will see your units added to the unit selection menu.
Here is an example library with just 1 unit (FM Operator) to get people started:
testlib-v0.4.25.zip (1.7 KB)
Unzipping this file and dropping the testlib folder into ER-301/libs on your SD card will give you access to a nifty little FM Operator unit which I was able to make in 10mins.
For your reference, here is the entire (Lua only) source code for the builtin library of units:
builtins-v0.4.25.zip (109.9 KB)
Doxygen of ER-301 Application Layer (App):
er-301-app-doxygen-v0.4.25.zip (5.0 MB)
- Very soon: Create some simple documented examples for people to follow.
- Soon: Create an SDK reference listing all of the available DSP objects and what they do.
- Further down the line: create a USB driver that lets you upload changes to a unit library while the ER-301 is running so that you don’t have keep swapping the SD card in and out.