keeping play-position while triggering different patterns


(greg11) #1

Hello Everyone!

i am looking for a way to switch pattern via midi and keeping the play position (like right-click on the pattern editor play button).

there seems to be a osc tool “jumper” which can do it but no other way.

is there a way for this :

GlobalMappings/Seq-Triggering/Trigger/Sequence XX (set) with the only difference that it keeps the play-position ?

i believe its necessary to change the play position in this code from “globalmidiactions.lua”:

add_action(“Seq. Triggering:Trigger:Sequence XX [Set]”,
function(message)
if message:is_abs_value() then
local sequence_pos = clamp_value(
message.int_value, 1, song().transport.song_length.sequence)

song().transport:trigger_sequence(sequence_pos)
end
end)

there is this similar thread:

https://forum.renoise.com/t/possible-to-switch-pattern-without-resetting-position/37864

talking about the same stuff. the user kazacore submitted a tool but the tool doesn’t seem to work anymore and it was “sequence XX (trigger)” where you map a Midi-CC number for each pattern.

i think for everyone with scripting capabilitys that problem is trivial but i just don t get abd begin to go crazy…

I would be very glad if someone could help me,

bye!

(p.s

i hope this should not be in the beginners thread)


(James Britt / Neurogami) #2

If you’re referring to my OSC Jumper tool, the code for that can be adapted to respond to MIDI just as well. OSC has an advantage in that you can pass along numerous values with the message. You’d have to look at what values are passed form the OSC into Lua functions that do the jumping, and use that in you GlobalMidiActions file


(greg11) #3

@Neurogami:

thx for replying.

i want to trigger renoise with logic so as far as i know i can’t profit of the osc advantages.

i changed the code of kazakore ( you can find it here: https://forum.renoise.com/t/possible-to-switch-pattern-without-resetting-position/37864 ) and it does work as i want now.

add this in the globalmidiactions.lua :

add_action(“Seq. Triggering:Trigger:SequenceJump XX [Set]”,
function(message)
if message:is_abs_value() then

local function jseq(seq)
local pos = song().transport.playback_pos
pos.sequence = seq
–die funktion
song().transport.playback_pos = pos
end

jseq (message.int_value)
end
end)


(James Britt / Neurogami) #4

My point was that you could take the Lua code and change it from being triggered by OSC to being triggered by MIDI (working off the values of channel, note, and velocity).

But I’m glad you found a solution.


(greg11) #5

didnt got that!

i want to trigger patterns with notes and set the starting position in the pattern with the velocity information - so this could be a way.

at the moment i understand absolutely nothing in the lua code but i will try it.