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

**URL:** <https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381>\
**Category:** Help, Support & Bugs\
**Created:** [November 6, 2010, 7:48pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381 "2010-11-06T19:48:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![LamptonWorm](https://forum.renoise.com/user_avatar/forum.renoise.com/lamptonworm/32/606_2.png) [@LamptonWorm](https://forum.renoise.com/u/LamptonWorm)\
**Post date:** [November 6, 2010, 7:48pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/1 "2010-11-06T19:48:51Z")

</div>

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 ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)

Cheers,  
LW.

---

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [November 6, 2010, 8:05pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/2 "2010-11-06T20:05:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LamptonWorm](https://forum.renoise.com/user_avatar/forum.renoise.com/lamptonworm/32/606_2.png) [@LamptonWorm](https://forum.renoise.com/u/LamptonWorm)\
**Post date:** [November 6, 2010, 8:17pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/3 "2010-11-06T20:17:00Z")

</div>

Thanks for the quick reply. I need to cut my teeth on the scripting ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)

Cheers,  
LW.

---

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [November 6, 2010, 8:19pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/4 "2010-11-06T20:19:08Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![vvoois](https://forum.renoise.com/letter_avatar/vvoois/32/6_449c533f586939b6e5f246632a46421f.png) [@vvoois](https://forum.renoise.com/u/vvoois)\
**Post date:** [November 6, 2010, 8:21pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/5 "2010-11-06T20:21:48Z")

</div>

> [@It-Alien](#):
>
> 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

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.

---

<div class="post-metadata">

**Author:** ![LamptonWorm](https://forum.renoise.com/user_avatar/forum.renoise.com/lamptonworm/32/606_2.png) [@LamptonWorm](https://forum.renoise.com/u/LamptonWorm)\
**Post date:** [November 6, 2010, 9:28pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/6 "2010-11-06T21:28:43Z")

</div>

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 ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)

- 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 ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif) 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.

---

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [November 7, 2010, 11:57am UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/7 "2010-11-07T11:57:30Z")

</div>

> [@vV](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![LamptonWorm](https://forum.renoise.com/user_avatar/forum.renoise.com/lamptonworm/32/606_2.png) [@LamptonWorm](https://forum.renoise.com/u/LamptonWorm)\
**Post date:** [November 7, 2010, 12:17pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/8 "2010-11-07T12:17:54Z")

</div>

Cool, thanks.

Cheers,  
LW.

---

<div class="post-metadata">

**Author:** ![LamptonWorm](https://forum.renoise.com/user_avatar/forum.renoise.com/lamptonworm/32/606_2.png) [@LamptonWorm](https://forum.renoise.com/u/LamptonWorm)\
**Post date:** [November 7, 2010, 12:26pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/9 "2010-11-07T12:26:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [November 7, 2010, 12:46pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/10 "2010-11-07T12:46:41Z")

</div>

glad to see you are getting into it. just in case, [here it is](https://forum.renoise.com/t/tool-select-track-shortcuts-2-7/30385) my script

---

<div class="post-metadata">

**Author:** ![LamptonWorm](https://forum.renoise.com/user_avatar/forum.renoise.com/lamptonworm/32/606_2.png) [@LamptonWorm](https://forum.renoise.com/u/LamptonWorm)\
**Post date:** [November 7, 2010, 1:56pm UTC](https://forum.renoise.com/t/solved-key-short-cut-or-midi-map-to-track-select/30381/11 "2010-11-07T13:56:20Z")

</div>

Thanks for your help ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)

Cheers,  
LW
