Jump to content


Photo

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


  • Please log in to reply
14 replies to this topic

#1 thunk

thunk

    Advanced Member

  • Normal Members
  • PipPipPip
  • 76 posts
  • Gender:Male
  • Location:grotto, unknow
  • Interests:Long walks on the abyssal plain

Posted 29 April 2016 - 21:49

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

Edited by thunk, 29 April 2016 - 22:36.


#2 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1322 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 29 April 2016 - 22:19

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


Edited by joule, 30 April 2016 - 08:24.

  • thunk likes this

#3 thunk

thunk

    Advanced Member

  • Normal Members
  • PipPipPip
  • 76 posts
  • Gender:Male
  • Location:grotto, unknow
  • Interests:Long walks on the abyssal plain

Posted 29 April 2016 - 22:33

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

 

 

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


Edited by thunk, 29 April 2016 - 22:36.


#4 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1322 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 30 April 2016 - 08:25

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.


Edited by joule, 30 April 2016 - 08:26.

  • thunk likes this

#5 thunk

thunk

    Advanced Member

  • Normal Members
  • PipPipPip
  • 76 posts
  • Gender:Male
  • Location:grotto, unknow
  • Interests:Long walks on the abyssal plain

Posted 30 April 2016 - 09:05

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



#6 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1322 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 02 May 2016 - 09:20

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


  • thunk likes this

#7 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 02 May 2016 - 11:14

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 and Abissus like this

Tracking with Stuff. API wishlist | Soundcloud


#8 thunk

thunk

    Advanced Member

  • Normal Members
  • PipPipPip
  • 76 posts
  • Gender:Male
  • Location:grotto, unknow
  • Interests:Long walks on the abyssal plain

Posted 03 May 2016 - 22:57

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! </plug>


Edited by thunk, 03 May 2016 - 23:05.


#9 thunk

thunk

    Advanced Member

  • Normal Members
  • PipPipPip
  • 76 posts
  • Gender:Male
  • Location:grotto, unknow
  • Interests:Long walks on the abyssal plain

Posted 03 May 2016 - 23:14

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



#10 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1322 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 04 May 2016 - 09:13

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

 

2) A tab/shift-tab that includes fx columns.


Edited by joule, 04 May 2016 - 09:18.


#11 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1322 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 04 May 2016 - 10:29

@danoise,

 

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

 

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

 

Attached File  joule.no0b.ToggleColumnType.xrnx   775bytes   40 downloads


Edited by joule, 04 May 2016 - 10:30.

  • thunk likes this

#12 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 04 May 2016 - 11:39

@danoise,
 
Here is a very simple toggle shortcut :)

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

Edited by danoise, 04 May 2016 - 18:32.

  • joule and thunk like this

Tracking with Stuff. API wishlist | Soundcloud


#13 thunk

thunk

    Advanced Member

  • Normal Members
  • PipPipPip
  • 76 posts
  • Gender:Male
  • Location:grotto, unknow
  • Interests:Long walks on the abyssal plain

Posted 04 May 2016 - 22:03

Thanks joule and danoise! Already using it :)

 

Potentially interesting code incoming eventually. Probably in another thread.



#14 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1322 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 05 May 2016 - 10:20

@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?

 

:)

 

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


Edited by joule, 05 May 2016 - 10:24.


#15 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1322 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 05 May 2016 - 13:45

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? :)

 

Attached File  joule.no0b.BetterColumnNavigation.xrnx   1.39KB   38 downloads

 

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


Edited by joule, 05 May 2016 - 15:37.

  • thunk likes this