So, searching for this, i only found some old posts from 2011.

What i’d like to do is add keybindings that move the cursor to the note column or last fx column of selected track IF not already on it, ELSE move elsewhere, etcetc…

Doesn’t seem like it was possible to script this in lua 2-3 years ago. Has such functionality been added to the API since then? It would be greatly appreciated :D

You should be looking at things like: ```lua

You can also manipulate the pattern editor selection with: ```lua  

A nice tip: To get a list of all the properties and methods available in the Renoise song object, open up the scripting Terminal and input: ```lua


You can also do this for any other object, for example: ```lua  

I find this a great way to look through the API and remind myself where everything is. Even if you don’t know the exact name for something (or you simply forgot), you can start at the top level by examining the song, then find the thing you want, then dig a bit deeper by examining that object and its properties, and so on…

As always, you should refer to the full documentation to find out exactly how everything works, what values they expect, etc.

ah, thanks =)

What’s the difference between oprint() and sprint() and just print() ?

…object print? structure print? wild guess =)

I’m assuming you meant rprint() and not sprint()? Yeah, pretty much I recommend just using this function:

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

Where dbug(foo) will print out something useful every time.


Thanks again :D

(and yeah i meant rprint(), not sprint())

Is there a quick reference for which functions get called by which keybindings? For example, if i wanted to write a function that did “Play current line” or “Jump to master track” …how could i quickly tell what the function call in lua would be, if it exists?

Not easy, all tool links start with a tilde sign (~) which makes tool specific shortcuts recognisable but search turns up nothing if you enter this sign in the searchbox.

Actually it’s not a tilde, it’s a sine.

…of the times :lol:/>

Actually, i really should write a xmodmap file that maps this character to a key and paste it here, for other linux users -)

/* EDIT */

On a related (actually back on) topic, this may seem retarded, but i can’t seem to find the function that tells your script whether the song is playing or not :? :? i tried and variants thereof…

That’s because it’s not a function, it’s a variable.  


And I really wish it was a Tilde so that it would be easy to enter in the Search Box!!!

This is very, very useful indeed. Question: where would i put this so i don’t have to copy/paste it into renoise’s scripting term window every time i load up renoise?

For bonus points, another question about scope of functions/variables: how, if possible, would i directly call “tool_function_x” in script “mytool”, from the scripting terminal?

…so, has this been updated in the 3.0 api?

i mean, is it possible for a lua script to tell if the cursor is on the note, or octave, or volume, etc…?

Would this do?
→ [read-only, enum = SUB_COLUMN]

-------- Constants



Still read only (you can’t move the cursor) but you can manipulate the pattern data anyway without having to move the cursor.

Seems like it’s exactly what i was looking for, but shame it’s read-only =(