Seems a few users would benefit from a Macro layer in Renoise.
Macro, instead of script, in the sense that you would be allowed to send keystroke combinations directly to Renoise, procedurally and programatically.
So instead of this:
function toggle_edit_mode()
if renoise.song().transport.edit_mode == true then
renoise.song().transport.edit_mode = false
else
renoise.song().transport.edit_mode = true
end
end
A user could do this:
renoise.macro().send({ name = 'esc' })
Or even better, this:
local key = renoise.macro().query("Pattern Editor:Play:Toggle EditMode")
renoise.macro().send(key)
hmmā¦ So one could have a macro which runs through multiple keyboard shortcuts, which each start a different script?
thisād be really swell for rather complex workflowsā¦ iād really have to think about what i want renoise to do which renoise isnāt capable of doing right now.
btw, your macro suggestion currently sends keycommands. what if it could also start buttons? I have a few in mind which cannot be accessed via LUA (Automatically Detect Transients and Place Slice Markers) (Sample_Recorder line-input and also channel)ā¦
The only problem with something like having a macro which sends esc is if the user has changed esc to do something else. (for me, esc is follow pattern toggle/on/off, for instance.).
I actually thought (and mentioned it) that a Macro-builder would be part of the Scripting when it was announced.
It shouldnāt matter if your keyboard shortcuts are different to somebody elses. Although building a Marco, and finding the command you want to do, may be easier with entering a keyboard shortcut, the Macro should be saved and made in a readable way using the names as they are displays in the Preferences -> Keys section.
Iāve been wanting this feature but didnāt know how to articulate how it would work.
I have script ideas that would be made possible/so much easier with this.
Iāve made my own hacky renoise macros using external software so that I could do processes like adding 50 instances of a device and then offsetting a parameter on each one. So many possibilities to control a lot of stuff and do tasks that might be cool but would waste too much time otherwise. If there were an implementation of macros in Renoise that supported recording mouse clicks, hotkeys etc, I would be thrilled. So many doors would open up in terms of sound design.
Edited for the format Iād personally prefer see it in
I see these letting you access (for eg) Pattern Editor keyboard shortcuts from the Sample Editor as well as making it easy to set up a Macro (list of functions/shortcuts executed in turn.)
+1, but I donāt fully understand the syntax in any of the (pseudo)scripting parts yāall posted. Conner, could you give an example 1on1 of what you want to get replaced by what?
The syntax comes from the existing spec for key_handler_func() in the current docs.
"key" is a table with the fields:
-- > key = {
-- > name, -- name of the key, like 'esc' or 'a' - always valid
-- > modifiers, -- modifier states. 'shift + control' - always valid
-- > character, -- character representation of the key or nil
-- > note, -- virtual keyboard piano key value (starting from 0) or nil
-- > repeated, -- true when the key is soft repeated (hold down)
-- > }
My pseudo example is simply:
renoise.macro().send(key)
Or:
local key = renoise.macro().query("Pattern Editor:Play:Toggle EditMode")
renoise.macro().send(key)
Not at all! We are talking about sending direct function shortcuts, not press-of-a-key shortcuts. Sure it does mean you could end up pasting a load of data into the Pattern Editor while you canāt currently see it (for one of a infinite number of examples) but it also means it will work on anybodyās install of Renoise, when whereas if you used key macros it wouldnāt work if your keyboard shortcuts were different from somebody elseās.
And as macros could be nested in functions you could well have if focus is x pane check then do y or z macro depending. I see no issue with this!
The problem is that you can assign the same shortcut combo more than once, depending on the selected view. An out of the box example:
Edit ā Preferences ā Keys:
Sample Editor:Edit:Paste = CTRL + V
Automation:Process:Paste = CTRL + V
Track DSPs Chain:Edit:Paste Device = CTRL + V
ā¦
So when I do
local key = { name = 'v', modifiers = 'control' }
renoise.macro().send(key)
Which one of am I doing? If I do:
local key = renoise.macro().query("Track DSPs Chain:Edit:Paste Device")
Then key is { name = āvā, modifiers = ācontrolā }, nothing more.
Thereās no magic āI see what you did there, you mean Pattern Editor?ā built into the query system. Itās just going to query the assignment table, and return the key, not the view.
Am I wrong? I havenāt looked at this in a while. Honest question.
But If Iām right we either have to add the view to the key table which is not there now, which could break backward compatibly, and so on. Or do something new which I have no good idea for.
Becasue the Macro does not ever refer to which key is being pressed!!! Then your Macros couldnāt be shared to people who use different keyobard shortcuts to you!! What I suggested is that they are always defined with the Track DSPs Chain:Edit:Paste Device type syntax, not by letter name/modifier combinations! Therefore there is never any mistaking what you are wanting to do!! And you can very easily set up shortcuts to do operations in areas which donāt currently have focus, which currently require a lot more lines of code to reprogram purely in the API!
So you above example:
You have created a macro with the name v with a junk bit of code called modifiers. So it will sit in the root levels of any macros list. But no sensible definitionā¦
My syntax is likely to be out here as not on a computer with a Renoise installā¦ Anyway this is a lot closer to what I would hope to see:
function pastefill()
renoise.macro():run(Pattern Editor:Edit:Copy Selection)
renoise.macro():run(Pattern Editor:Navigation:Goto Top of Pattern)
renoise.macro():run(Pattern Editor:Edit:Paste Continuously)
end
renoise.macro():create{
name = "Kaza's Test:Paste Fill"
invoke = function() pastefill end
}
Possibly all commands within the function could be part of the same macro():run call and separated by semi-colonsā¦