I create this last code for navigate/jump per groups in Pattern Editor, but it is incomplete:
(ignore the prints, are for tests with the terminal…)
PREVIOUS JUMP PER GROUPS:
-- renoise.song():select_previous_track()
-- renoise.song():select_next_track()
-- song.sequencer_track_count
function tool_03_G01( i , A , B ) -- Navigate per Groups toward left
print ( '\nSTART PREVIOUS ---- ---- ---- ---- ---- ---- ---- ----' )
local song = renoise.song()
local selected_track = song.tracks[song.selected_track_index] -- object
local sel_tr = song.selected_track_index -- number
print ( 'select: ---> ' ..sel_tr )
print ( 'first: 1' )
-- loop
if ( selected_track.type == renoise.Track.TRACK_TYPE_GROUP or selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
for i = sel_tr , 1 , - 1 do -- loop: of the selected to first Track/Group
i = i - 1
print ( '---- ---- \n ' )
print ( 'loop i : ' ..i )
A = song.tracks[i] -- object = number (Group)
B = song.tracks[i - 1] -- object = number (Track)
print ('i: ' ..i) -- number
print ('A : ') print ( A ) -- object
print ('B : ') print ( B ) -- object
if ( A.type == renoise.Track.TRACK_TYPE_GROUP and B.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
return ----<<<< HERE!!!
end
end -- for i
end -- if
print ( 'END ---- ---- ---- ---- ---- ---- ---- ----\n ' )
end
NEXT JUMP PER GROUPS:
function tool_03_G02( i , A , B ) -- Navigate per Groups toward right
print ( '\nSTART NEXT ---- ---- ---- ---- ---- ---- ---- ----' )
local song = renoise.song()
local selected_track = song.tracks[song.selected_track_index] -- object
local sel_tr = song.selected_track_index -- number
print ( 'select: ---> ' ..sel_tr )
print ( 'last: ' ..song.sequencer_track_count )
-- loop
if ( selected_track.type == renoise.Track.TRACK_TYPE_GROUP or selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
for i = sel_tr , song.sequencer_track_count do -- loop: of the selected to last Track/Group
i = i + 1
print ( '---- ---- \n ' )
print ( 'loop i : ' ..i )
A = song.tracks[i] -- object = number (Group)
B = song.tracks[i - 1] -- object = number (Track)
print ('i: ' ..i) -- number
print ('A : ') print ( A ) -- object
print ('B : ') print ( B ) -- object
if ( A.type == renoise.Track.TRACK_TYPE_GROUP and B.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
return ----<<<< HERE!!!
end
end -- for loop
end -- if
print ( 'END ---- ---- ---- ---- ---- ---- ---- ----\n ' )
end
I think I need a line to finish in ----<<<< HERE!!! in both codes.
“renoise.song():select_previous_track()” and “renoise.song():select_next_track()” can they serve here?
The desired result is simple: jump to a group with a track inside (index - 1).
Are there any simple code to do this?
It may be silly, but please help to finish…