thread to talk about and exchange knowledge on Lua and how to use it to program for norns and er-301
also see: https://forum.orthogonaldevices.com/t/middle-layer-sdk-aka-patching-with-lua/1235
thread to talk about and exchange knowledge on Lua and how to use it to program for norns and er-301
also see: https://forum.orthogonaldevices.com/t/middle-layer-sdk-aka-patching-with-lua/1235
Another helpful thread from O|D forum:
So (is this ānew thingā) is this written with lua??
No one knows, but my guess is its innards are largely C and there are some built-ins written in Lua against the same API that users will have access to. Lua is popular as a scripting-language add-on for C-based projects that value performance.
Iāve had some experience with Lua in regards to pure data but I guess as soon as Tehn releases the source weāre off to the races
Can we have an ELI5 description of Lua? Had a quick look at that O|D thread, and the Lua site, but Iām none the wiser beyond scripting DSP.
Lua is a simple scripting language - itās not particularly complex to use, but itās more like a language like Javascript than like, say, the Teletype script language. It has things like data structures and loops and logic and so forth. It is a long while since Iāve written any, so take this all with a pinch of salt. It is close-ish to what Iād call a ācurly brace languageā.
Lua is particularly popular because the interpreter is very small can be embedded inside C programs. One place you see it a lot is the games industry: the games engines are all C#/C++, but they often expose Lua as a scripting language for level designers to just drop things in ad-hoc, and so that scripting changes can be made very quickly - because itās interpreted, you donāt need to run compilation for every alteration, just reload the scripts. Sorry, that paragraph was a bit complex.
Lua is a general purpose language. Itās not designed for DSP per-se. But just like the games example, if the DSP-type hooks are exposed, you could control DSP with it. (In the games example - the engine developers can add things that can be controlled by the Lua, and return data to it). So here, Teletype, if you know it, is a good example: Teletype itself is written in C. To add new functions to it, developers write some C. But once theyāve written that, anybody can access that functionality through the TT language as an end-user.
So: Norns itself is probably not written in Lua. Itās probably a lot of C, and itās all sat atop Linux. But: my bet would be it then lets end-users write scripts/apps/whatever the term will be in Lua, if youād like. (This basically solves one of the issues with Aleph - despite all the work to make things more straightforward, you still had to write a bunch of C to write apps).
I hope thatās a starting point, more an ELI12, @philmaguire, but maybe a start.
That makes a load of sense. Developing for Aleph always looked a bit intimidating to me.
@infovore is spot on. We have used a subset of Lua for our design scripting on the last 2 games we shipped. (Shadow of Mordor, Shadow of War) We implemented it because the embedded compiler was small with not a lot of overhead, and the language itself was very easy to for people to get their heads around (if they had done any scripting previously).
We have had a few hiccups in the last 9 years though (many may be on our implementation, and not a direct critique of the language). The first is that Lua is not type safe. This has lead to a number of weird bugs that were hard to track down. Which is directly tied to our second issue; we never implemented a run time Lua debugger. Which meant that debugging Lua scripts while the engine/game is running became particularly brutal.
All that being said Iām super happy this little guy is going to be running Lua, since it means I dont have to learn yet another scripting syntax.
A fun and easy way to get to know Lua is to trying making simple animations and interactive programs with LĆVE.
Iām pretty surprised this UCSB project hasnāt been mentioned, some someones must really like Lua over there
http://lua-av.mat.ucsb.edu/gallery.html
EDIT: https://github.com/LuaAV
shree@shree-linux2:~$ svn co https://svn.mat.ucsb.edu/svn/luaAV/trunk
svn: E170013: Unable to connect to a repository at URL āhttps://svn.mat.ucsb.edu/svn/luaAV/trunkā
svn: E670002: Name or service not known
shree@shree-linux2:~$
I have really zero experience with coding, but just started watching this:
And his approach seems pretty comprehensible, doesnāt it? Just for the very basics? He just released a episode 2 as well, so maybe itāll be a more frequent thing. Anyways, thought this could be helpful for other beginners.
aspiring norns/grid owner here. wanted to share a couple open source projects for those interested in brushing up on lua who are on macos:
https://www.hammerspoon.org
lua powered ui scripting for working with macos apis.
http://commandpost.io
for any video editors, lua powered plugins for interacting with appleās FCPX. already pretty useful but supports user created plugins. built on hammerspoon. use it frequently at work.
i am a hobbiest programmer and have been trying to wrap my head around moving my busted up applescript/python scripts over to lua since discovering these. watching the space with interest and hope i can pull the trigger soon.
found some fun stuff on youtube