[Solved] Key Short Cut Or Midi Map To Track Select?

Hi everyone,

I’ve been reading the short cut keys and trying to see if there is a way to map a qwerty and/or MIDI to select a specific track. I guess like you can use CTRL + NUM PAD to select instruments, can I set up something to move the cursor to a specific track? I know I can move left/right, but after something more direct, e.g. CTRL + 2 moves to track 2. Thoughts welcome :)

Cheers,
LW.

this cannot be done as of version 2.6, but can be added with a script, since this feature allows you to modify the edit position and also create MIDI/keyboard shortcuts to associate functions to

Thanks for the quick reply. I need to cut my teeth on the scripting :)

Cheers,
LW.

this is an example to add a shortcut key for track #1. fo other tracks is of course almost identical:

  
-- tool registration  
  
renoise.tool():add_keybinding {  
 name = "Pattern Editor:Track:Select Track #1",  
 invoke = function() set_selected_track(1) end  
}  
  
  
--------------------------------------------------------------------------------  
-- processing  
--------------------------------------------------------------------------------  
  
function set_selected_track(num_track)  
  
 renoise.song().selected_track_index = num_track;  
  
end  
  
  

Current line and sequence positions are supported, but the selected track positions are still read-only values as far as i can track in the docs.

Hi,

Thanks for the snippet, I’m right at the start of the LUA curve, I only just launched renoise with the flags to go into script land. Not sure this is the right time to turn this thread into a ‘hello world’, I need to put some effort into reading up, but I’ll let you know what I did so far :)

  • started renoise 2.6 with the --scripting-dev flags
  • go to Tools > Scripting Editor & Terminal
  • File > New
  • Paste the snippet
  • Save the file locally
  • Execute
  • Output is…

*** Track Select Test.lua:3: attempt to call field ‘tool’ (a nil value)
*** stack traceback:
*** Track Select Test.lua:3: in main chunk[/code]

Not sure what to do next to be honest :) I checked prefs and mappings but couldn’t find the new mapping option for track1.

95% sure user/scripty-newbie error - I need to rewind and read up!

Cheers,
LW.

you have probably replied while I was writing the example. In case you missed it, look above

@LamptonWorm: I’ll be publishing a complete script in minutes so you will understand it better

Cool, thanks.

Cheers,
LW.

Btw, with a clear head this morning (ahem!) taking apart the example XRNX is helping a lot, i.e. I just found the example key binding in there and can see where your snippet fits.

Cheers,
LW.

glad to see you are getting into it. just in case, here it is my script

Thanks for your help :)

Cheers,
LW