i am writing a controller setup for my Arturia Keylab mkii and has been going well. I have written a custom function to overwrite the way duplex lights buttons as the keylab handles them differently, however i haven’t been able to get any of my print() to show in the terminal from my custom lua scripts so i cant see whats going wrong.
been searching around for an answer. i have managed to get the testpad.lua to print to terminal but none of my other scripts. is there something i am missing? do i need to connect the scripted i created to terminal somehow? i am running Windows 10.
i am writing a controller setup for my Arturia Keylab mkii and has been going well. I have written a custom function to overwrite the way duplex lights buttons as the keylab handles them differently, however i haven’t been able to get any of my print() to show in the terminal from my custom lua scripts so i cant see whats going wrong.
been searching around for an answer. i have managed to get the testpad.lua to print to terminal but none of my other scripts. is there something i am missing? do i need to connect the scripted i created to terminal somehow? i am running Windows 10.
Any information is greatly appreciated
Use the Renoise native terminal for scripting.
You can create any function, and within it invoke a print (). If you invoke the function, print () will work.
For example:
--define the function
local function the_print()
local text = "The long text 1."
print("Print inside the function:", text)
end
--invoke the function
the_print()
--or...
print("The long text 2.")
--or...
print(renoise.song().selected_line_index) --return a index number
To do tests, you can use the file TestPad.lua (“Execute” button), or your main.lua, after of write the code save the file.
You can use print(), oprint(), or rprint(), depending on what you need. Look in the documentation for what everything is.
Maybe you would find it more comfortable to use auto_reload_debug(“your_dialog”) inside your main.lua.Thus, each time you modify anything, it will autoexecute itself.
There are 3 types of prints in Renoise. oprint for objects, rprint for tables, print for everything else.
Here’s a dbug print (from Grid Pie) that may help you. (It figures out which print to use automatically)
function dbug(msg)
local base_types = {
["nil"]=true, ["boolean"]=true, ["number"]=true,
["string"]=true, ["thread"]=true, ["table"]=true
}
if not base_types[type(msg)] then oprint(msg)
elseif type(msg) == 'table' then rprint(msg)
else print(msg) end
end