New Tool: (3.1) Group Nudge (Sep 2018)

New tool


v 0.34 (bug fixes)

ledger.scripts.GroupNudge_V0.34.xrnx

-v0.33

  • added transpose buttons to transpose all the notes in a group (whole song) and selected track. Useful for example when tuning drums layered in different tracks .

Grp nudge 0.33

v0.32

  • Added specialised soloing function that cyles through every member (track/ sub-group) of a group one at a time and solos it.
  • Removed the Group FX bypass buttons
  • Tool automatically updates the group selection as you navigate around the tracks in renoise

v0.31

For when your renoise preference for right-click soloing is ‘mute others’:

  • added a new menu entry/ shortcut: Unmute Groups With Active Tracks. In renoise, if you solo a track then unmute a track from a separate group you still need to unmute that separate group/groups. This function scans all tracks and makes all unmuted tracks audable by unmuting the parent groups for you. The menu is under the pattern editor ‘Group’ menu. The shortcut has the same name.

A simple tool to help extend group tracks leftwards.

Made as I got fed up with dragging multiple tracks into groups, as when creating a large ‘LFO sidechain’ group.

NOTE: track order should be preserved with this. Let me know if anything starts going out of place.


Shortcut Group Nudge

Menu: Tools: Ledger`s Scripts: Group Nudge

Menu: Pattern Editor: Group : Group Nudge


-Choose target group track from the popup

-nudge its left border with [<<] and [>>] buttons

Recommended companion tool, originally done by Cas:

Group Selected Tracks:


changelog:

v0.3

-Added menu in pattern editor under: Group : Group Nudge

-Modified menu start behaviour. Menus no longer toggle but re-start the tool bringing GUI to the front of the screen. Keyboard shortcut still toggles

/////

SCRIPTING NOTE:

Thread where API swap_tracks() bug is reported/ discussed:

https://forum.renoise.com/t/lua-api-bug-swap-tracks/49534

The function used as a workaround:

Workaround Function
--extend left border of group leftwards by one track
    ---------------------------------------  
    function extend_group_left(group_index)  
    ---------------------------------------
      
      local song = renoise.song()
      local group_track = song:track(group_index)
     
      --get the index of the track to the left of the group. This is the track we want to add to the group
      local left_of_grp_idx = (group_index - #group_track.members - 1) 
      
      --if left_of_grp_idx == 0 then there are no more tracks to the left so return early 
      if left_of_grp_idx == 0 then 
        return
      end
      
      --if group has no members already, then it is a simple add track to group operation and
      --no re-organisation is needed
      if #group_track.members == 0 then
        song:add_track_to_group(left_of_grp_idx,group_index)
        return
      end
      
      --1) Add 2 dummy tracks into group
      ----------------------------------
      --NOTE We need to insert 2 dummy tracks to account for bugs with the renoise swap tracks behaviour within groups
      --see: https://forum.renoise.com/t/lua-api-bug-swap-tracks/49534
      
      --set member_idx to the first member track of the group
      local member_idx = left_of_grp_idx + 1
     
      --loop group members to find insert point for dummy tracks (after first legitimate member; i.e. not a track in a further sub-group)
      for i = 1,#group_track.members do
        --check if member is not in a sub group by checking its parent
        if rawequal(song:track(member_idx).group_parent,group_track) == true then
          break
        end
        --if here then member was in a sub- group so increment member_idx until we get to a legitimate track
        member_idx = member_idx + 1
      end
      
      --again due to insert_track behaviour we need to insert the dummy tracks after the first present and legitimate member of the group
      --so + 1
      local insert_point = member_idx + 1
      
      --insert 2 dummy tracks at member_idx 
      local dummy_trk_2 = song:insert_track_at(insert_point)
      local dummy_trk_1 = song:insert_track_at(insert_point)
      
      --name the tracks for bug hunting i.e. if they are not deleted we will see them in pattern ed
      dummy_trk_1.name = "Dummy Track 1"
      dummy_trk_2.name = "Dummy Track 2"
      
      --2) Swap Dummy tracks to members 1 and 2 of group (this works re. the swap bug as we are not swapping two groups)
      song:swap_tracks_at(member_idx,member_idx+1)
      song:swap_tracks_at(member_idx+1,member_idx+2)
      
      --3) Preparation done, so bring the track we want into the group
      --Swap dummy member 2 with target track outside group (left_of_grp_idx was found near beginning of function)
      --note: if we were to swap dummy member 1 then both tracks get ejected from group
      song:swap_tracks_at(left_of_grp_idx,(left_of_grp_idx + 2))
     
      --4) Tidy up: delete dummy tracks by looping objects 
      --(as we are deleting tracks it is safer to loop and find the dummy track objects specifically as
      --we might lose wanted song tracks if we were calculating indexes and a mistake made)
      --As indexes can change when a track is deleted, it is simpler to use 2 loops
      for i = 1,#song.tracks do
        if rawequal(song:track(i),dummy_trk_1) then
          --delete dummy 1
          renoise.song():delete_track_at(i)
          break
        end
      end
      
      for i = 1,#song.tracks do
        if rawequal(song:track(i),dummy_trk_2) then
          --delete dummy 2
          renoise.song():delete_track_at(i)
          break
        end
      end
    end

v0.3
-Added pattern editor menu.
-Changed menu calling behaviour so calling from menus no longer acts as toggle. This means that when you call tool from a menu it will either open the tool or bring the currently opened tool to the front of the screen.

I`ll probably change most of my tools to this menu behaviour as it seems unlikely that you would want to close a tool via a menu. However you may have it lost beneath other windows, so you can now rely that the menu call always results in GUI at front and centre.

Great tool, this certainly one of the more tedious aspects of renoise so this is fantastic. Only tested it a little but seems to do what it should so far.

Great tool, this certainly one of the more tedious aspects of renoise so this is fantastic. Only tested it a little but seems to do what it should so far.

This one required a lot more to get right than it would appear due to an API bug,

The thing that could potentially go wrong is track ordering, but no tracks should be lost. I think its all fine now but let me know if your testing brings up anything.

Just did a fix update on an older Cas tool that is related for anyone interested:

It groups the selected tracks in the pattern editor. A good replacement for Ctrl + G in renoise.


Keyboard Shortcut:
~Group Selected Tracks

nl.jeweett.GroupSelectedTracks_V0.21.xrnx


2 Likes

v0.31

In first post

For when your renoise preference for right-click soloing is ‘mute others’:

  • Added a new menu entry/ shortcut: Unmute Groups With Active Tracks. In renoise, if you solo a track then unmute a track from a separate group you still need to unmute that separate group/groups. This function scans all tracks and makes all unmuted tracks audable by unmuting the parent groups for you.
    The menu is under the pattern editor ‘Group’ menu.

Workflow:

Solo one track
Unmute tracks you want to hear with it
Press shortcut/ menu entry

No hunting for parent groups to unmute.

1 Like

In first post

v0.32

  • Added specialised soloing function that cyles through every member (track/ sub-group) of a group, one at a time and solos it.
  • Removed the Group FX bypass buttons
  • Tool automatically updates the group selection as you navigate around the tracks in renoise

group nudge

1 Like

In First Post

-v0.34 (bug fixes)

-v0.33

  • added transpose buttons to transpose all the notes in a group (whole song) and selected track. Useful for example when tuning drums layered in different tracks .

Grp nudge 0.33

2 Likes