![]() The description of the standard functions is covered by the official Lua documentation (opens new window) and this document.Ī print function is a typical example of a standard function. These functions cover vast range of functionality from printing, doing math, MIDI messaging to working with UI components. The standard functions are functions from the Lua standard libraries and the Electra One extension libraries. If you intend to use your own user functions in the setup, you will need to place the setup part below the definition of the user functions. It does not matter where the setup part is located in the script, it is not required to be at the top. The setup is executed immediately after the preset is loaded. The primary purpose of the setup is to prepare your extension for handling the application events at the later stage. group 0 is displayed - define assignment of controls to groupsĬontrolGroups = showGroup (controlGroups, 0 ) print ( "Lua ext initialized" ) channel, 10 ) end - set the initial state. onRequest (device ) print ( "Requesting patches from device ". Display controls related to specific value of another control - a function to hide all controls within the groups function hideAllGroups (groups ) for groupId = 0, #groups do for i, controlId in ipairs (groups ) doĬontrol : setVisible ( false ) end end end - show given control group function showGroup (groups, groupId ) for i, controlId in ipairs (groups ) doĬontrol : setSlot (i + 1 ) end end - the callback function called from the preset function displayGroup (valueObject, value ) hideAllGroups (controlGroups ) showGroup (controlGroups, value ) end - a standard callback function to handle PATCH REQUEST event function patch. The Lua script can be also uploaded with the Preset editor (opens new window) or the Development sandbox tool (opens new window). From this perspective a preset can be seen as a combo of the JSON preset. This effectively means that one preset may have one Lua script assigned. If there already exists a Lua script for given preset, the upload SysEx call will overwrite it. The script is uploaded and assigned to currently active preset. It can be done with the Lua script upload SysEx call. In order to make a Lua script extension functions accessible from the preset, the Lua script file needs to be uploaded first. # ExamplesĮxamples of presets with the Lua Extensions are available at Github Electra.One repository (opens new window) # SysEx Implementation # Uploading the scripts It can, however, modify, move, and change visibility of existing objects. ![]() This is enforced by the fact that the Lua Extension API cannot create new objects. Once, the preset is loaded, the Lua Extension can be used to manipulate all objects to fulfill a particular purpose. The JSON preset is used to pre-load all pages, lists, devices, groups, and controls. The main idea is to have a clear split between the static data defined with the declarative JSON and the dynamic processing of this data in the run-time with the Lua script. Generate sequences of MIDI data, clock messages, and MIDI LFOs.Trigger Lua functions on MIDI clock and transport control.Decode packed and nibbelized SysEx data.Calculate checksums and custom SysEx template bytes.Running custom patch dump request calls.Changing visibility, location, name, and color of controls.Triggering Lua functions on control value changes.Current implementation provides following functionality: The Electra One Preset Lua extension allows you to embed Lua function calls to presets. Firmware version 3.1 or later is required to use the Electra One Lua Extension described in this document. Local present, null_ls = pcall ( require, "null-ls" ) if not present then return end local b = null_ls. Verifying DISA STIG Compliance with OpenSCAP - Part 2 Host-based Intrustion Detection System (HIDS)īash - Conditional structures if and case Building and Installing Custom Linux KernelsĪutomatic Template Creation - Packer - Ansible - VMware vSphere
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |