Yes, here is a function that should cycle to next group. Maybe you can wrap your head around it and make the slightly trickier jump_to_prev_group() ?
(Also, I’m not sure if you want to tweak it to jump to the next group even when the selected track is part of a group.)
local song = renoise.song()
local tracks_count = song.sequencer_track_count
-- iterate thru all non-send/master tracks
for i = 1, tracks_count - 1 do
-- if send/master track is selected, start searching from first track
if song.selected_track_index > tracks_count then
start_track = 1
start_track = song.selected_track_index
-- define what track index to check. modulo is used to make it cycle
-- and behave like the normal next/prev shortcuts around boundaries.
-- -1/+1 operation is needed since renoise indices start at 1, while
-- modulo cycles via 0.
local track_index = ((start_track + i - 1) % tracks_count) + 1
-- goto track if it's a group track
if (song:track(track_index).type == renoise.Track.TRACK_TYPE_GROUP) then
song.selected_track_index = track_index
return -- stop iteration by exiting function