Make an ordered array including last column in previous track (if exists) + all columns in selected track +first column in next track (if exists). This way we have all the scope we need. Mark the current column somehow. Be careful to do this array in a good way, making all elements have subelements with info about track, column_type and column_order possibly.
Depending on next or prev, check what element is previous or next in the array.
Re-interprate to lua api structure
Make sure to handle special cases without errors.
PS. I’d be surprised if there isn’t already a native shortcut for this
After investigating a bit further, I can’t actually find a way to move the cursor the way you want to in the API.
These are available:
renoise.song().selected_track_index
renoise.song().selected_note_column_index
renoise.song().selected_effect_column_index
I have not found a way to set the cursor to a vol/pan/dly column What it means is that you could refine the shortcut to also include effect columns, but I doubt it’s possible for it to move to vol/pan/dly columns.
EDIT: I also edited point 3 in my initial post as is_selected has nothing to do with the cursor position.
One shortcut I would find particularly useful was jumping between back and forth between whatever note/master-fx column you’re currently at in the pattern editor.
Ever dealt with a lot of notecolumns? Reaching the tracks master-effect-columns can be a bit cumbersome…
I’d envision it as a toggle, a bit like how the shortcut for toggling focus between the matrix/pattern editor works (shift+esc).
I have at this point fallen all the way down the Lua rabbit hole, so it’ll be a while before I surface with anything polished enough to show.
But with my (meager, accented) Lua, I’ve made basic tools for:
Defining selections in the Pattern Matrix via keyboard (delimited by the current position and a roving boundary corner)
Automation editing directly from the Pattern Editor via keyboard (which feels oh-so-natural and Right), with plans for using the sub-line grid to encode segment shapes, like actual tension curves and hold segments.
DSP Pane and Mixer shortcuts for copying and pasting all envelopes (song-wide) from one device to another
Man, the API is awesome. But there are gaps where you just hit a wall.
Devs: Empower the API-hungry user-dev community! Extend the API and reap exponential gains! Huge Benefit-to-DevCost ratio!
One shortcut I would find particularly useful was jumping between back and forth between whatever note/master-fx column you’re currently at in the pattern editor.
Ever dealt with a lot of notecolumns? Reaching the tracks master-effect-columns can be a bit cumbersome…
I’d envision it as a toggle, a bit like how the shortcut for toggling focus between the matrix/pattern editor works (shift+esc).
OK. I could do that. So:
Toggling between note columns/fx columns. Ideally the tool should intelligently remember what note column / fx column you last toggled from, so if you’re currently working mostly in fx2, it should toggle to that column. However, that is not 100% sensible (how should a manual switch from last note col to first fx col then be remembered? Things can easily be confusing from a user perspective. Ok, a data change could be interpreted as a “remember it was this column”, but still it would appear slightly unpredictable).
EDIT: Most simple and sensible thing would be a tab-like shortcut going to the the next or previous “column group”. No toggle per se. But then we don’t gain very much, do we…
Hey, cool. It’s a little too simplistic if you ask me -I would want to remember the active column as I navigate around.
So I took the liberty of modifying it a bit…fixing an edge case as well: when there are zero effect columns available.
Edit: also added check for missing renoise.song() on startup…
-- joule.no0b.ToggleColumnType.xrnx
-- modified main.lua
local cached_note_column_index = nil
local cached_effect_column_index = nil
function toggle_column_type()
local rns = renoise.song()
if rns.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER then
if rns.selected_note_column_index ~= 0 then
local col_idx = (cached_effect_column_index ~= 0) and
cached_effect_column_index or 1
if (col_idx <= rns.selected_track.visible_effect_columns) then
rns.selected_effect_column_index = col_idx
elseif (rns.selected_track.visible_effect_columns > 0) then
rns.selected_effect_column_index = rns.selected_track.visible_effect_columns
else
-- no effect columns available
end
else
local col_idx = (cached_note_column_index ~= 0) and
cached_note_column_index or 1
if (col_idx <= rns.selected_track.visible_note_columns) then
rns.selected_note_column_index = col_idx
else -- always one note column
rns.selected_note_column_index = rns.selected_track.visible_note_columns
end
end
end
end
function cache_columns()
-- access song only once renoise is ready
if not pcall(renoise.song) then return end
local rns = renoise.song()
if (rns.selected_note_column_index > 0) then
cached_note_column_index = rns.selected_note_column_index
end
if (rns.selected_effect_column_index > 0) then
cached_effect_column_index = rns.selected_effect_column_index
end
end
renoise.tool():add_keybinding {
name = "Pattern Editor:Navigation:Toggle between note/fx columns",
invoke = toggle_column_type
}
renoise.tool().app_idle_observable:add_notifier(cache_columns)
cache_columns()
Good enough! That’s probably the most sensible implementation.
I will add a “tab-replacer” that includes fx columns. Actually, any kind of fx column “tabbing” seems to be nonexistent in Renoise today, as far as I can tell. That’s a hell of an oversight workflow wise. I mean… navigating through heaps of columns with right/left-arrow… wtf?
Sleekest navigation would probably be to rely on prev/next track + prev/next column shortcuts. Current prev/next notecolumn shortcut is pretty awkward, thinking about it…