This seems to work perfectly fine here…
local button = vb:button {
text = tostring(note_value),
pressed = function()
local stored_edit_mode = renoise.song().transport.edit_mode
if stored_edit_mode then
renoise.song().transport.edit_mode = false
end
osc_client:trigger_instrument(true, instrument, track, note_value, velocity)
if stored_edit_mode then
local timer_func
timer_func = function()
renoise.song().transport.edit_mode = true
renoise.tool():remove_timer(timer_func)
end
renoise.tool():add_timer(timer_func, 40)
end
end,
released = function()
osc_client:trigger_instrument(false, instrument, track, note_value, velocity)
end,
}
A practical example is attached.
joule.no0b.testpad.xrnx
Is there a problem with setting the value “15” or “10” or “5” instead of 40?Why 40?With value <16 edit_modenot blinking, but I do not know if it depends on the hardware.
The “left click repeat rate” in preferences/Keys/Mouse Wheel has something to do?
I’ll try to build a new piano based on your code, even if it means starting over. I want the tool to work as fine as possible. I believe that with all this I can move forward.I also have another option in mind, edit the notes without using edit_mode.In this case, osc server would be canceled, and the notes would not sound if active edit_mode. As I have my code, I have a separate configuration for each button.I think I understand all your code, and I can use it to compress it to the maximum (within my possibilities).
Thank you very much for all this!I think it’s the best solution for this case.
…withmy_player:play() and my_player.stop(),I had an error in the terminal, by using them separately in “pressed” and “released” of the button.I was doing something wrong.
I will continue to build, and when I have something fine I will comment here, maybe this weekend.