# Ctrl-K - Clear Track From Cursor

**URL:** <https://forum.renoise.com/t/ctrl-k-clear-track-from-cursor/35207>\
**Category:** Ideas & suggestions\
**Created:** [February 1, 2012, 3:46pm UTC](https://forum.renoise.com/t/ctrl-k-clear-track-from-cursor/35207 "2012-02-01T15:46:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yiNXs](https://forum.renoise.com/letter_avatar/yinxs/32/6_449c533f586939b6e5f246632a46421f.png) [@yiNXs](https://forum.renoise.com/u/yiNXs)\
**Post date:** [February 1, 2012, 3:46pm UTC](https://forum.renoise.com/t/ctrl-k-clear-track-from-cursor/35207/1 "2012-02-01T15:46:30Z")

</div>

CTRL-K removed everything in the current track from cursor position to the bottom. I used that function so much in protracker while composing a new track. I still find myself pressing it.

Love to see this simple but production boosting function return in renoise.

---

<div class="post-metadata">

**Author:** ![dblue](https://forum.renoise.com/user_avatar/forum.renoise.com/dblue/32/153_2.png) [@dblue](https://forum.renoise.com/u/dblue)\
**Post date:** [February 1, 2012, 4:40pm UTC](https://forum.renoise.com/t/ctrl-k-clear-track-from-cursor/35207/2 "2012-02-01T16:40:20Z")

</div>

[ALT] + [Z] to mark the entire track below the current line.  
[ALT] + [F3] to cut/delete the selection.

Not quite as simple as a single keystroke, but still pretty easy.

It would also be quite simple to make a custom Lua tool shortcut that could do it all in one keystroke.

---

<div class="post-metadata">

**Author:** ![Jonas](https://forum.renoise.com/user_avatar/forum.renoise.com/jonas/32/6937_2.png) [@Jonas](https://forum.renoise.com/u/Jonas)\
**Post date:** [February 1, 2012, 10:58pm UTC](https://forum.renoise.com/t/ctrl-k-clear-track-from-cursor/35207/3 "2012-02-01T22:58:24Z")

</div>

> [@dblue](#):
>
> It would also be quite simple to make a custom Lua tool shortcut that could do it all in one keystroke.

yes please! ![B)](https://forum.renoise.com/uploads/default/original/3X/1/9/196bd4662947e797ef8567d4c1de4c4d84512d32.gif)

---

<div class="post-metadata">

**Author:** ![yiNXs](https://forum.renoise.com/letter_avatar/yinxs/32/6_449c533f586939b6e5f246632a46421f.png) [@yiNXs](https://forum.renoise.com/u/yiNXs)\
**Post date:** [February 2, 2012, 3:54pm UTC](https://forum.renoise.com/t/ctrl-k-clear-track-from-cursor/35207/4 "2012-02-02T15:54:49Z")

</div>

This does the job, thanks! I thought I knew all the shortcuts, guess I need an updated cheatsheet ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)

P.S. I’ve given the lua tool a quick try, but all I managed so far is clearing the entire pattern. Is there any way of reading the cursor position? I couldn’t find it.

---

<div class="post-metadata">

**Author:** ![dblue](https://forum.renoise.com/user_avatar/forum.renoise.com/dblue/32/153_2.png) [@dblue](https://forum.renoise.com/u/dblue)\
**Post date:** [February 2, 2012, 4:26pm UTC](https://forum.renoise.com/t/ctrl-k-clear-track-from-cursor/35207/5 "2012-02-02T16:26:44Z")

</div>

> [@yiNXs](#):
>
> Is there any way of reading the cursor position?

renoise.song().transport.edit\_pos

```lua
  
function clear_track(start_line, end_line)  
 local pattern_track = renoise.song().selected_pattern_track   
 for line_index = start_line, end_line do  
 pattern_track:line(line_index):clear()   
 end  
end  
  
function clear_track_above_cursor()  
 local start_line = 1  
 local end_line = renoise.song().transport.edit_pos.line - 1  
 if (end_line >= 1) then  
 clear_track(start_line, end_line)  
 end  
end  
  
function clear_track_below_cursor()  
 local start_line = renoise.song().transport.edit_pos.line  
 local end_line = renoise.song().selected_pattern.number_of_lines  
 clear_track(start_line, end_line)  
end  
  

```

In your tool, you can map the functions clear\_track\_above\_cursor() and clear\_track\_below\_cursor() to different shortcuts.

clear\_track\_above\_cursor() will clear everything above the current edit cursor position.

clear\_track\_below\_cursor() will clear everything below (and including) the current edit cursor position.

I think it makes sense this way, but you can obviously tweak the logic if it doesn’t quite suit your needs.

Hope this helps ![:)](https://forum.renoise.com/uploads/default/original/2X/f/f31646767a12ff3f4d6b8c4766d2ea41b23d4ab9.gif)
