renoise.song().file_name 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:
print(renoise.song().file_name)
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:
oprint(renoise.song())
Then start digging deeper into each property/function that you see listed.
Here’s a function that will print whatever you throw at it. Maybe it can help you?
Example: dbug(renoise.song().file_name)
-- 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
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 = renoise.song().tracks[track].devices
for _ = 1, #devices do
for __ = 1, #devices[_].parameters do
rprint ("Device [".._.."] Parameter ["..__.."] -> "..devices[_].
end
end
end
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.