Handy Hint: LUA external files #177
Replies: 5 comments 5 replies
-
Thx a lot for this tip that I didn't know. |
Beta Was this translation helpful? Give feedback.
-
Hmm, looked everywhere but can't find it in my version of Ctrlr (5.3.122 on Macintosh), only 'export as xml' among the export options. |
Beta Was this translation helpful? Give feedback.
-
@Godlike-Productions Which Ctrlr version are you using? |
Beta Was this translation helpful? Give feedback.
-
I'm in 6.02.26 (which is actually before the latest builds I think. They reverted back to V5. |
Beta Was this translation helpful? Give feedback.
-
I used this a lot in the past - but still things can get messed up. It's like one morning Ctrlr wakes up with the "right arse" and decides to hide stuff. I also simply put my panel into git and git commit it periodically. Working outside of Ctrl editor is a lot easier on a Pi simply because the fonts are so large. I have not managed to fix that yet - reverse engineering Zoom pedals takes my time. Version = 9597fad.0, Build date = Wed 06 Jan 2021 03:13:42 PM GMT, Branch = Stable, Juce = 5.4.1, libusb = 1.0.19, liblo = 0.28, lua = Lua 5.1.4, luabind = 0.9.0, boost = 1.67.0, I do hope Roman starts exposing the release tags so I can know what I am actually building. CAREFUL with 6.0 - the MemoryBlocks changed semantics. Caught me out big time. Thank heavens for Dnaldoog is all I can say. He helped explain the semantics. |
Beta Was this translation helpful? Give feedback.
-
Within the ctrlr LUA editor, there is a command under the file menu "convert to files"
My recommendations to all programmers is to use this. It saves all of your LUA methods as external files, and if you have your project synced to a repository on github or similar, it allows for version control and all of the normal github functionality.
It also means that your files are kept outside of Ctrlr, so if you do manage to crash Ctrlr, or otherwise stuff up your project so it can't be restarted, you can edit the .lua file offline to fix it. Also, if it ctrlr refuses to open your project (it has happened to me on more than one occasion), you can still access all of your work and rebuild things quickly.
You will need to repeat this each time you add a new method, and what(), how() etc seem to keep getting new versions added, which you can delete, but I'm finding it a much nicer way to develop, in conjunction with Visual Studio Code, than just using LUA. I use Visual Studio to handle version management, but code in the Ctrlr LUA editor. Coding in Visual Studio means that you need to reopen your panel to refresh the code, and you need to compile within Ctrlr anyway, so it makes sense to do it this way.
Beta Was this translation helpful? Give feedback.
All reactions