Isn’t Renoise automatically appending these, if set? Maybe you will then have to add the menu entry after you added the shortcut in the code or something?
afaik it has never done that and i’ve never seen them, cos shortcuts + menu entries are considered separate entities or something.
IF there is a way of doing this, please let me know.
but it needs to be provable “this is how you do, this is the result”, not theories.
Afraid not, the screenshot is just the native one from the scripting ed. just welcoming the Un/commenting feature now in scripting terminal.
AFAIK In order to show shortcuts that user added in script you would have to make a gui where the user could input the shortcuts they set manually (duplicate what they set in renoise prefs), then you use the input to append into your menu-building. But that is not much fun and open to user error…
Would be a nice addition to the API to get the string of user set shortcuts though.
absolutely would be pretty neat. i’ve solved it in other ways though, but it’s not a menu entry solve
are these suggestions for the user to assign in renoise?
no, this is a dialog that dynamically grabs all the midimappings, menu entries + keybindings from Paketti, into something that you can use fuzzy search for, for finding a feature, and then use cursorkeys + enter, or write your own shortcut macro, or click on the mouse to run a function.
so just type. i made it read the keybindings.xml and show the bound-to-shortcuts keys as green and show the keys they are bound to.
I did have a thought about this after posting originally, so if you are capturing the user set shortcuts from keybindings.xml , can’t you just add the keybindings you find into menus i.e. check/ filter where shortcuts are set vs their menus and add in to renoise Paketti menus?
or are you trying to do something else?
i mean, yes, i wanna look at it later, but i also feel like it’d look pretty ugly, cos it would not look like this:

it’d look like this:
and it’s just not…
I see, not possible to justify them to the right…
Today I realized that property getters can take arguments. Never thought of it for some reason, and I always reverted to methods in these cases…
MyClass.line_volume = property(
function(obj)
return function(line_index)
return obj.pattern_track:line(line_index):note_column(1).volume_value
end
end
)
local vol = my_object.line_volume(4)
More stupid syntax for less cognitive load = success.
EDIT:
Or, if you want properties that can be get/set like so:
my_object.line_volume[64] = 50
print(my_object.line_volume[64])
It becomes a bit more convoluted:
MyClass.line_volume = property(
function(obj)
return setmetatable({},
{
__index = function(table, line_index)
return obj.pattern_track:line(line_index):note_column(1).volume_value
end,
__newindex = function(table, line_index, value)
obj.pattern_track:line(line_index):note_column(1).volume_value = value
end
}
)
end
)
TIL:
If you want to declare shortcuts at top of file but want the functions below to not be global you can use this:
local snazzy
function snazzy()
snazzy code!
end
“local snazzy” var declared first means that snazzy() function remains local and is assigned to the local snazzy
local snazzy --comment this line out and function becomes global
--we now have an upvalue to reference
renoise.tool():add_keybinding {
name = "Global:Tools:My Snazzy Shortcut",
invoke = function() snazzy() end
}
function snazzy()
snazzy code!
end
Tested by oprint from main.lua while snazzy is in a different file.
Also, if you make function local aswell this doesn’t work and causes upvalue probs again.
local snazzy
--keybind wont work here--
local function snazzy() --won't work now as re-localised
snazzy code!
end
what are the usecases for this, specifically?
Personal preference of how you want to organise your files, but also worth knowing regards to global vs locals and how this declaration style effects that.
Maybe also interesting in this regard, self-referencing:
local toolIdle = function()
Notifiers:remove(Tool.app_idle_observable, toolIdle)
…
will not work, butt:
local toolIdle
toolIdle = function()
Notifiers:remove(Tool.app_idle_observable, toolIdle)...

