Help! (With Custom Osc Mappings)

I’ve been looking into LUA scripting for a while now
& I can’t figure out how to write my script.

I want to add a function to the default OSC message set
that would allow me to set the “position in pattern”

So far I wrote that (close to nothing) :

[b]-- /song/pattern/line

add_global_action {
pattern = “/song/pattern/line”,
description = “Set playback pos to the specified line”,

arguments = { argument(“song_pos.line”, “number”) },
handler = function(song_pos.line)[/b]

& I can’t figure out how to do it.
I went through the documentation.
If anyone can suggest me the answer I’d really appreciate!

Cheers

song_pos is an object and the foul part about this is in a general script you need to transfer the object to a self-made variable, then change the values in that variable and then transfer the variable back to the object.

So it should be something like (this is quickly from the back of my head!):
handler = function(
local my_songpos = renoise.song().song_pos
my_songpos.line = number
renoise.song().song_pos = my_songpos
)

But i think you get the raw idea of what i do above.

No luck,

I tried for hours…

This allows to start the pattern at desired line :

[b]-- /song/pattern/line

add_global_action {
pattern = “/song/pattern/line”,
description = “Set playback pos to the specified line”,

arguments = { argument(“pattern_pos”, “number”) },
handler = function(pattern_pos)
song().transport:start_at(pattern_pos)
end,
}[/b]

Then what I intended was to be able to set the line while
playing the pattern. When I see all these amazing tweaks
people script in LUA I’m sure that what I want to do is
really simple but I almost got a brain stroke from trying
to get it done. But I’m learning at least.

I’m spending already lots of time building a homemade DAW
for live performance, I want to extend the basic osc communication
with a few things like the one mentionned above.

I’d really need a “tutorial” example of how to create a new control
over Renoise’s API to get started, I bet then I could fully understand
the scripting concept.

Thanks