New Tool (2.8): Shortcut Wizard

Hiya.

I went and cobbled this together:com.kmaki.Shortcutwizard_Rns280_V0.1.xrnx
And then i updated it: com.kmaki.Shortcutwizard_Rns280_V0.2.xrnx (Removed link, because it’s doing something fishy with my keyboard shortcuts)

IMPORTANT NOTE IF YOU UPDATE! YOU’LL LOSE ANY SHORTCUTS YOU HAVE YOURSELF DEFINED OR MODIFIED FOR v0.1 SO BACK UP, UPDATE, COPY PASTE ANY MODS BACK TO 0.2.

It’s just a generalized way to make shortcuts to set renoise internal values (or simply call functions). It was made for my personal use, but maybe someone would find use for it.

The shortcuts are defined in the shortcuts.lua file, and it has some example ones there already. It’s not really super user-friendly (you need to edit the shortcuts.lua to add your shortcuts), but offers a framework to help you reach those unreachable renoise internal values with your keyboard, and to define ‘quickies’ quikcly. The main benefit with this tool is the hassle-free creation of the dialog to set the value.

The argument descriptions in the comments and examples included in the shortcuts.lua should cover the basics to get your own stuffs and mods running. Go ahead and edit the shortcuts.lua to suit your needs!

What’s in my list:

-Global:Transport:Set BPM…

-Global:Transport:Set LPB…

-Global:Transport:LPB + 1
-Global:Transport:LPB - 1

-Global:Transport:Toggle Comp. KB velocity
-Global:Transport:Set Comp. KB Velocity…

-Mixer:Navigation:Toggle Pre/Post fx

-Mixer:Track Control:Set Track Volume…

-Pattern Editor:Insert/Delete:Set Pattern Length…

-Pattern Editor:Track Control:Rename Track…
-Pattern Matrix:Tracks:Rename Track…
-Mixer:Track Control:Rename Track…

-Pattern Sequencer:Edit:Rename Pattern…

-Sample Editor:Rename Instrument…

-Sample Editor: Rename Sample…

-Automation:Navigation:Move to Next Sequence

-Automation:Navigation:Move to Prev Sequence

-Pattern Editor:Track Control:Un-alias

-Pattern Editor:Track Control:Create alias

-Pattern Editor:Track Control:Coll./Exp. All Tracks in Group
-Mixer:Track Control:Coll./Exp. All Tracks in Group
-Pattern Matrix:Tracks:Coll./Exp. All Tracks in Group

-Pattern Editor:Track Control:Exp. Group (fixed behaviour)
-Mixer:Track Control:Exp. Group (fixed behaviour)
-Pattern Matrix:Tracks:Exp. Group (fixed behaviour)

-Pattern Editor:Track Control:Smart Collapse/Expand
-Mixer:Track Control:Smart Collapse/Expand
-Pattern Matrix:Tracks:Smart Collapse/Expand

-Global:View:Toggle Pattern Matrix

(NOTE: The renaming needs no actual shortcuts, as these are provided natively. These are just examples of what can be done. Also I actually prefer these ones, as I can change track or pattern name even when track is collapsed, or the pattern names don’t show.)

If anyone would like to take this further with something like preferences.xml -handling or something else, please be my guest. I don’t think I’ll have the enthusiasm for that, as this suffices for me!

im interested in this. can we hear more about it and further developments?

Well, no real development has happened since. I’ve added a couple of shortcuts for my own use for controlling and setting channel pre/post volume. I still think the framework is sufficient for my own needs.
Was there something specific thing you would’ve been interested in hearing more?

P.S. Here’s the pre/post channel volume stuff I use

  
-------------------------------  
--Toggle Pre/Post-FX Volume Display in Mixer  
-------------------------------  
local toggle_prepostvol = Shortcut {  
 ["shortcut_names"] = {"Mixer:Navigation:Toggle Pre/Post fx"},  
 ["shortcut_type"] = "CALL FUNCTION",  
 ["renoise_property_set"] = function()  
 renoise.app().window.mixer_view_post_fx = not renoise.app().window.mixer_view_post_fx   
 end,  
}  
-------------------------------  
--Set Track Pre/Post-FX Volume in Mixer  
-------------------------------  
local set_track_vol = Shortcut {  
 ["shortcut_names"] = {"Mixer:Track Control:Set Track Volume..."},  
 ["shortcut_type"] = "SET VALUE DIALOG",  
 ["renoise_property_get"] = function()  
 local post_fx = renoise.app().window.mixer_view_post_fx  
 local device  
 local track = renoise.song().selected_track  
 if post_fx then  
 device = track.postfx_volume  
 else  
 device = track.prefx_volume  
 end  
 return math.lin2db(device.value)  
 end,  
 ["renoise_property_set"] = function(value)  
 local post_fx = renoise.app().window.mixer_view_post_fx  
 local device  
 local track = renoise.song().selected_track  
 if post_fx then  
 device = track.postfx_volume  
 else  
 device = track.prefx_volume  
 end  
 device.value = math.db2lin(value)  
 end,  
 ["renoise_property_type"] = "number",  
 ["dialog_numberbase"] = 10,  
 ["dialog_stringformat"] = "%1.3f",  
 ["dialog_title"] = "Set Track Volume",  
 ["renoise_property_min"] = math.infdb,  
 ["renoise_property_max"] = 3,  
}  
  

surely a +1/-1 for this would be good? :)
at least i found it immensely useful with midimappings and keyboard shortcuts. especially midimapping. could just keep playing and use an imaginary pedal to control velocity.

Yeah, that does makes sense. I’m not actively using midi gear at all, but it would probably make sense to cram a “create midi mapping” option in this too. Good idea!

This was inteded more like a ‘create your own shortcuts with ease’ -solution. Don’t know how much people actually use it, but if anyone has done some shortcuts that are useful, it would of course be nice if they’d be posted in this thread for example. :)

The +1 -1 for Comp KB velocity really is a no-brainer, I’ll try to do those on my lunch break. :D

yeah, i’ve enjoyed +1 / -1 for comp kb and midi keyboard immensely in my private version of Paketti. it’s really quite decent.

Didn’t have time in my lunch break :D, but anyways here’s the +1 -1 for compkbvel in shortcut wizard

  
-------------------------------  
--Computer Keyboard Velocity +1  
-------------------------------  
local compkbvel_plusone = Shortcut {  
 ["shortcut_names"] = {"Global:Transport:Comp. KB Velocity +1"},  
 ["shortcut_type"] = "CALL FUNCTION",  
 ["renoise_property_set"] = function()  
 renoise.song().transport.keyboard_velocity = math.min(renoise.song().transport.keyboard_velocity+1, 127)  
 end,  
}  
-------------------------------  
--Computer Keyboard Velocity -1  
-------------------------------  
local compkbvel_minusone = Shortcut {  
 ["shortcut_names"] = {"Global:Transport:Comp. KB Velocity -1"},  
 ["shortcut_type"] = "CALL FUNCTION",  
 ["renoise_property_set"] = function()  
 renoise.song().transport.keyboard_velocity = math.max(renoise.song().transport.keyboard_velocity-1, 0)  
 end,  
}  
  

Just made a couple of enhancements on the track group handling you could find useful.

  
-------------------------------  
--Expand/Collapse all tracks in group  
-------------------------------  
--There is no native toggle for this, only  
--collapse/expand dedicated shortcuts.  
  
local toggle_group_tracks_collapse = Shortcut {  
 ["shortcut_names"] = {  
 "Pattern Editor:Track Control:Coll./Exp. All Tracks in Group",  
 "Mixer:Track Control:Coll./Exp. All Tracks in Group",  
 "Pattern Matrix:Tracks:Coll./Exp. All Tracks in Group",  
 },  
 ["shortcut_type"] = "CALL FUNCTION",  
 ["renoise_property_set"] = function()  
 --Get this track collapse/expand state  
 local this_track_collapsed = renoise.song().selected_track.collapsed  
 --Get track group siblings   
 local this_group_parent  
 if renoise.song().selected_track.type == renoise.Track.TRACK_TYPE_GROUP then  
 --this is the parent  
 this_group_parent = renoise.song().selected_track  
 else  
 this_group_parent = renoise.song().selected_track.group_parent  
 end  
  
 if not this_group_parent then  
 return  
 end  
 local all_sub_tracks = this_group_parent.members  
 local track_siblings = table.create()  
 for _, track in pairs(all_sub_tracks) do  
 if rawequal(track.group_parent, this_group_parent) then  
 if track.type ~= renoise.Track.TRACK_TYPE_GROUP then  
 table.insert(track_siblings, track)  
 end  
 end  
 end  
 --Set collapse/expand state for siblings  
 for _, track in pairs(track_siblings) do  
 track.collapsed = not(this_track_collapsed)  
 end  
 --and the parent  
 this_group_parent.collapsed = not(this_track_collapsed)  
 end,  
}  
  
-------------------------------  
--Fixed Group collapse toggle  
-------------------------------  
--This does not jump upwards in groups  
--as the native collapse/expand group does when 'toggling'  
  
local toggle_group_collapse = Shortcut {  
 ["shortcut_names"] = {  
 "Pattern Editor:Track Control:Coll./Exp. Group (fixed behaviour)",  
 "Mixer:Track Control:Coll./Exp. Group (fixed behaviour)",  
 "Pattern Matrix:Tracks:Coll./Exp. Group (fixed behaviour)",  
 },  
 ["shortcut_type"] = "CALL FUNCTION",  
 ["renoise_property_set"] = function()  
 --Get group track  
 local target_track  
 local this_track = renoise.song().selected_track  
 if not(this_track.type == renoise.Track.TRACK_TYPE_GROUP) then  
 --get nearest parent group  
 local this_track_parent = renoise.song().selected_track.group_parent  
 if not this_track_parent then  
 return  
 --this is not group track and it has no parent group track. exit.  
 else  
 target_track = this_track_parent  
 end  
 else  
 target_track = this_track  
 end  
  
 --Set group collapse/expand state  
 target_track.group_collapsed = not(target_track.group_collapsed)  
 end,  
}  
  
  

Figured out how I want the track/Group collapsing to work. Like this:

One key to toggle collapse/expand with anything under it.

  
-------------------------------  
--Smart Collapse  
-------------------------------  
--Will collapse/expand group when on group track,  
--And collapse/expand track when on normal track  
local toggle_smart_collapse = Shortcut {  
 ["shortcut_names"] = {  
 "Pattern Editor:Track Control:Smart Collapse/Expand",  
 "Mixer:Track Control:Smart Collapse/Expand",  
 "Pattern Matrix:Tracks:Smart Collapse/Expand",  
 },  
 ["shortcut_type"] = "CALL FUNCTION",  
 ["renoise_property_set"] = function()  
 --Get track  
 local target_track  
 local this_track = renoise.song().selected_track  
 if not(this_track.type == renoise.Track.TRACK_TYPE_GROUP) then  
 --this track is not a group track  
 --get nearest parent group  
 local this_track_parent = renoise.song().selected_track.group_parent  
 if not this_track_parent then  
 target_track = this_track  
 else  
 if this_track_parent.group_collapsed == true then  
 --if group is collapsed, hitting smart collapse on any included  
 --track will expand the group, not try to expand the track.  
 target_track = this_track_parent  
 else  
 target_track = this_track  
 end  
 end  
 else  
 target_track = this_track  
 end  
  
 --Set collapse/expand state  
 if target_track.type == renoise.Track.TRACK_TYPE_GROUP then  
 target_track.group_collapsed = not(target_track.group_collapsed)  
 else  
 target_track.collapsed = not(target_track.collapsed)  
 end  
 end,  
}  
  

This was missing, I think; A way to alias and un-alias with keyboard, from pattern editor.

  
-------------------------------  
--Un-Alias Pattern (handy to use without switching to matrix)  
-------------------------------  
local unalias_pattern = Shortcut {  
 ["shortcut_names"] = {"Pattern Editor:Track Control:Un-alias"},  
 ["shortcut_type"] = "CALL FUNCTION",  
 ["renoise_property_set"] = function()  
 local pattern = renoise.song().selected_pattern  
 local track_index = renoise.song().selected_track_index  
 local pattern_track = pattern:track(track_index)  
  
 local was_alias_to_index = pattern_track.alias_pattern_index  
  
 --un-alias  
 pattern_track.alias_pattern_index = 0  
  
 --copy from original  
 local mother_pattern = renoise.song():pattern(was_alias_to_index)  
 local mother_pattern_track = mother_pattern:track(track_index)  
 pattern_track:copy_from(mother_pattern_track)  
  
 end,  
}  
-------------------------------  
--Alias Pattern (handy to use without switching to matrix)  
-------------------------------  
local alias_pattern = Shortcut {  
 ["shortcut_names"] = {"Pattern Editor:Track Control:Create alias"},  
 ["shortcut_type"] = "SET VALUE DIALOG",  
 ["renoise_property_get"] = function()  
 local pattern = renoise.song().selected_pattern  
 local pattern_track = pattern:track(renoise.song().selected_track_index)  
 local is_alias_to = pattern_track.alias_pattern_index  
 if is_alias_to ~= 0 then  
 return is_alias_to - 1  
 else  
 return 0  
 end  
 end,  
 ["renoise_property_set"] = function(value)  
 local pattern = renoise.song().selected_pattern  
 local pattern_index = renoise.song().selected_pattern_index  
 local pattern_track = pattern:track(renoise.song().selected_track_index)  
 if value + 1 == pattern_index then  
 renoise.app():show_status("Cannot alias pattern track to itself")  
 --aaand nothing  
 else  
 pattern_track.alias_pattern_index = value + 1  
 end  
 end,  
 ["renoise_property_type"] = "number",  
 ["dialog_numberbase"] = 10,  
 ["dialog_stringformat"] = "%i",  
 ["dialog_title"] = "Create alias",  
 ["renoise_property_min"] = 0,  
 ["renoise_property_max"] = #renoise.song().sequencer.pattern_sequence - 1,  
}  
  

–EDIT AW SHUCKS-- Referencing to renoise song before it’s loaded… classic. Trying to fix.

–Ended up rewriting the tool to an extent. - Putting the new tool version available at first post now. Also Fixed the aliasing and unaliasing code above, which… was not well.

Lol

Lol
Props 2u dude. Makin stuff happen for renoise using mouse haters and mouse hatin renoise users alike. And stayin funny while doin that.
You’re even typing your edits here in lua comment style :P

Bout the bug, it’s annoyed me a couple of times especially because you gotta always fail to notice it until you quit and restart renoise one day. Could be the next year. :P

Thanks for the kind words! :) and honestly I didn’t even notice I commented with Lua comments, but now that you mention it, it’s a bit scary…

Exactly! :D