Enter emulation trick

Sorry, I’m searching for a snippet or something like that allowing me to perform the same result as the “Enter” key when pressing a simple viewbuilder button.
I’ve searched in the Renoise.Song.API.lua’s documentation and did not found a function like :

renoise.song().transport:play_line(line)  

I’d like to know if someone has found a valid trick. The problem comes from the fact that when I usually hit the Enter key it plays the line without moving continuously the edit cursor nor the playback position, and without stopping the sound. But when I try to do it within a script, and if I use :

 renoise.song().transport:stop()  

the edit cursor stops moving, but also the sound stops completely, that’s not what I want. And if I use :

renoise.song().transport:start(mode)  

… it starts the sound, but always moves the playback position, and that’s not what I want.

When I use the start and then the stop function, I hear nothing (what’s logical in some way, the stop cancels the start).

When I use a notifier, that stops the sound when the observed transport is playing, it’s too fast, I can play the line a small fraction of a second…
How the hell can I play a line, without moving the edit block or the song playback position…?

The only thing i can think of, is simply grabbing the pattern contents of that line fast and then resend it as note-data through OSC
It would require you to emulate delay as well (when delay column or dx / dxx commands are used).
Other pattern effects wouldn’t be applicable, so the function is hard to emulate.

a simple solution, yeah or why not use the server_socket:wait(timeout_ms) between the start & stop playback ???

well, you can add

renoise.song().transport:play_line(line)  

to the API wishlist.

If I define the ld = “line duration” value, in miliseconds.

then

local clock = os.clock  
  
function sleep(md)   
 local ti = clock()  
 while clock() - ti <= md do -- nuthin  
 end  
 end  
  
renoise.song().transport:start_at(line)  
sleep (ld)  
renoise.song().transport:stop()  
  

it doesn’t work for the same reasons,
the start & stop must work “separately”.

I’ve seen in the code.google.com site that gridpie uses a class named onshotidle class, seems usefull to delay the transport.stop() thing, but I don’t get the way to use it in my situation

https://code.google…lbox.lua?r=1068

+1!!!

This would also make it possible to add a function that plays the current line and advances “editstep” lines instead of one <_</>

I wrote about the idea of Macros once, a bump for this idea? (click me)

you had my bump