Midi Map To Trigger Next Pattern

Hi,
is there any way to trigger the pattern next to the current one?

In my songs I often loop one pattern, so at some point I need to exit the loop and go to the next pattern. I looked through the available mappings but it seem no one does this.
Ideas?

A script with a very simple function…

Though somebody needs to help me out here, because i don’t have an extensive midi controller with trigger buttons…

  
--[[============================================================================  
main.lua  
============================================================================]]--  
  
renoise.tool():add_midi_mapping{  
name = "Global:Tools:JumpNextSequence:Function:Jump to next sequence",  
invoke = function(message)  
 if (message:is_switch()) then   
 jump_to_next_sequence()  
 end  
 end  
}  
  
function jump_to_next_sequence()  
 local position = renoise.song().transport.playback_pos  
 position.line = 1  
 position.sequence = renoise.song().selected_sequence_index +1  
 if position.sequence > #renoise.song().sequencer.pattern_sequence then  
 position.sequence = 1  
 end  
  
 renoise.song().transport.playback_pos = position   
end  
  

Crap forum editor…
Adjusted with checking for the last sequence available (else you would get an error if you would attempt to go beyond the last sequence)

thanks for the script, I’ll take it as a starting point to learn lua and Renoise API.