Inspect contents of a variable

So I’m trying to play around with Lua in Renoise, and trying to understand what’s inside of the various variables/properties listed in the API.

So let’s say I wanted to see what’s in I figured you would just do something like this, but:

>>> print("Hello");
>>> print(;
*** [string ";"]:1: '=' expected near ';' is a property, not a function, so you cannot simply call it directly and expect something to happen.

If you want to print the current file name, then you can do:


One important thing to keep in mind: If you’re running scripts on a new/empty song that has not yet been saved, then file_name will of course be empty, so printing it will result in nothing.

Also, the ; is not necessary at the end of each line, so you can skip that.

If you want to dig deeper into the structure of various objects, then you can use the oprint() function.

Take a look at the output from this:


Then start digging deeper into each property/function that you see listed.

Thank you! This makes more sense to me now.

Here’s a function that will print whatever you throw at it. Maybe it can help you?

Example: dbug(

-- Debug print
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

Thanks, man, very cool. I also found some code to print the parameters of an audio device (which I’ve turned into a helper function):

function deviceparams(track)                     
 local devices =[track].devices        
 for _ = 1, #devices do                       
  for __ = 1, #devices[_].parameters do              
   rprint ("Device [".._.."] Parameter ["..__.."] -> "..devices[_].

I’ve also started reading the documentation on the Github site and looking at the example tools (which I now realize aren’t installed by default), which has been super helpful.