Learning LUA for E1

Hey everyone.

Hope you are doing good.
I wanna learn some LUA with focus on the E1.
Where should i go or what should i read to maybe get a bit of understanding?

Kalle

1 Like

Following.

My suggestion is to have a goal or a problem to solve. I use an on-line Lua compiler to try out a lot of ideas.

Get familiar with the string.format() function and all it can do. It’s very useful in the formatter routines section of a control to make the display more useful.

Also spend time learning about tables (arrays) since that is the foundation of Lua.

Don’t forget to download and study what others have done. There are so many cool presets out there now. Try to find some simpler ones to start so you can more easily see what is going on.

2 Likes

Thx for the input i will try look at these things i am very basic in coding started sadly maybe a bit to late compared to age but the will to learn is there so thx!

Well, I’m in my 60’s and still learning. Having a goal rather than just abstract learning helps quite a bit.

2 Likes

Chat GPT is good for getting started. It usually explains why it’s written the code in a particular way, so you can learn. Obviously it’s far from foolproof and some familiarity with coding helps, but I’ve co-authored several presets with chat GPT now!

The info you find on line on lua is very useful. Lua is not specially written for E1 so it’s universal. For E1 specifics check out the the documentation offered by Martin on his website.

Also relevant: do understand the MIDI protocol. If you are not into MIDI a lot, start with controlling only MIDI CC on a monotimbral device. Ensure you grasp those concepts before working with RPN, NRPN. Then top it off with MIDI clock and Sysex.

When will lua be very handy:

  • hiding controls when not relevant: f.i only show a PWM control, when the chosen waveform is a pulse
  • when the range , name or color of a control is dependent on some condition. For instance, changing a parameter according to the chosen effect type
  • when you want to reuse a set of controls for many timbres , each with its own MIDI channel, for instance on a multi-timbral synth
  • When you want to make a set of controls to browse or select a patch, so you can reuse it on different presets
  • When multiple controls (usually a set of switches) are to be recombined into one MIDI CC value, before being sent .
  • when sysex parameters you want to parse are using different value ranges than their MIDI CC counterparts. In such case you will need to build some logic to convert one value range in the other. In my experience it is more efficient to build the controls based on the values in the SysEx,than those found in CC. For that reason, do not start building presets in which you eventually will parse SysEx, before having worked a bit with lua. It happens more than you think.
  • The moment you start using byte-strings, peek commands, and/or constructing your own sysEx strings, you’ll need a good lua understanding.
1 Like