View Single Post
Old 08-06-2016, 06:52 PM   #75
Nz0
Human being with feelings
 
Nz0's Avatar
 
Join Date: May 2016
Location: Switzerland
Posts: 19
Default

Quote:
Originally Posted by Lokasenna View Post
That's good to know - I got really frustrated trying to come up with a more reasonable way to do that.
I think that I found a way to reduce your frustration even more

I came across a lua library called "lupy", a simple Python-like OO implementation for lua. It does a lot of things that I don't even understand, nevertheless I made a toy example with encapsulation.

You can define virtual functions, not sure if the term is correct. I mean you define the function in the object file and then override it in your main script.

Extract the Zip-File under "C:\Program Files\REAPER (x64)". For simplicity I also included the lupy code. Load AKAI_MPK25_Track_Control.lua in Reaper as usual. Try left and right clicking on the pads.

lupy: https://github.com/uleelx/lupy
other OO libs: http://lua-users.org/wiki/ObjectOrientedProgramming

HTH
Nz0
Attached Files
File Type: lua AKAI_MPK25_Track_Control.lua (965 Bytes, 317 views)
File Type: zip Pad.zip (11.8 KB, 174 views)
Nz0 is offline   Reply With Quote