Clues on implementing a "Jump To Next/Prev Sub-Column"?


(thunk) #1

I want to write a command that will jump by sub-column, so calling “Jump To Next Sub-Column” repeatedly would go:

[Note Column] -> [Instrument Column] -> [Volume Column (if visible)] -> [Pan Column (if visible)] -> [Delay Column (if visible)] ->
[Local FX Column (if visible)] -> [repeat through next note column, etc.] ... -> [Master FX Column 1 (if visible)] -> [Master FX Column 2 (if visible)] ... ->
[repeat through next track, etc.] ...

Any pointers or clues?

Thanks in advance!

Edit: Just in case, here’s some ASCII art. “Next Sub-Column” would move through the numbered entries:

|----+--------------------------------|
| 00 | ---.. .. .. -- ---- ---- ---- |
|----+--------------------------------|
   ^ ^ ^ ^ ^ ^ ^ ^
   | | | | | | | |
   | | | | | | | --> 8. Master FX 2
   | | | | | | --> 7. Master FX 1
   | | | | | --> 6. Local FX
   | | | | --> 5. Delay
   | | | --> 4. Pan
   | | --> 3. Vol
   | --> 2. Instrument
   --> 1. Note

Pattern Editor Envelope Editing, Device Automation Copy/Paste, More
(joule) #2

A few rough pointers…

My first thought is that I would:

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

  2. Depending on next or prev, check what element is previous or next in the array.

  3. Re-interprate to lua api structure

  4. Make sure to handle special cases without errors.

PS. I’d be surprised if there isn’t already a native shortcut for this :wink:


(thunk) #3

A few rough pointers…

My first thought is that I would:

PS. I’d be surprised if there isn’t already a native shortcut for this :wink:

Thank you!

I’m new to Lua (but old to coding).

I will research each item on your list and update this thread later with (hopefully) a solution (or a post-mortem).

AFAIK, there is no factory shortcut, which surprised me, too.

For me, “Move To Next/Prev Column” is too slow, and “Jump To Next/Prev Column” skips over waaaayyy too much.

There’s no way to reach most of the middle sub-columns except step by step by step …


(joule) #4

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 :frowning: 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.


(thunk) #5

Thank you for that information. That’s actually still pretty good news.

I included the Vol/Pan/Dly columns for completeness, but they’re only 2 characters wide, if they’re even there.

And it’s only 1 step from the note to the instrument column.

Which is all to say that what I REALLY wanted was quick sideways navigation to/from/around the note and FX columns.

Which sounds like it’s possible! So I’ll give that a shot.

Thanks again


(joule) #6

Any luck so far? I’m keen on looking into it if you haven’t already!


(danoise) #7

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


(thunk) #8

Ooh, yeah, a toggle sounds like the Right Thing.

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:

  1. Defining selections in the Pattern Matrix via keyboard (delimited by the current position and a roving boundary corner)
  2. 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.
  3. 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!


(thunk) #9

Any luck so far? I’m keen on looking into it if you haven’t already!

I got derailed by my lack of Lua knowledge. Have at it if you want!

I’ll take a crack at it soon, too


(joule) #10

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:

  1. 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…

  1. A tab/shift-tab that includes fx columns.

(joule) #11

@danoise,

Here is a very simple toggle shortcut :slight_smile: Is this what you expected?

Shortcut can be found in Pattern Editor:Navigation:Toggle between fx/note columns

6671 joule.no0b.ToggleColumnType.xrnx


(danoise) #12

@danoise,

Here is a very simple toggle shortcut :slight_smile:

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

(thunk) #13

Thanks joule and danoise! Already using it :slight_smile:

Potentially interesting code incoming eventually. Probably in another thread.


(joule) #14

@danoise,

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?

:slight_smile:

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…


(joule) #15

Added “Jump to next column (note/fx)” and “Jump to previous column (note/fx)” shortcuts.

Let’s add phrase editor support and announce it as the new standard tab-shortcut? :slight_smile:

6672 joule.no0b.BetterColumnNavigation.xrnx

EDIT: I can’t see any selected_note_column variable being available for phrases in the lua API.