New Tool (3.4) command_palette v2.0.3

version 2.0 - lists :keyboard:

Hello masters of the keyboard! I rewrote this tool to allow for more complex behaviours and commands. See the top post here for more details.

In short you can now search all available commands and have palettes for listing tracks, samples, instruments, devices or sections in a song, as well as new commands for managing dsp devices, views, renaming things and so on. Overall it now functions much more like a command palette that one would find in a code editor while also keeping the workflow from the previous version.

As every command has to be implemented in the tool there are still many things not accessible via the palette. If you want to do something that isn’t available please comment it and I’ll try including it in a future update.

Have fun!

9 Likes

Whoops! Awesome tool! I’ll try the new version ASAP

1 Like

woot woot

1 Like

thanks @unless ! Just registered in the forum to discuss about this.
Do you think a more future-full command palette would be possible to implement though? Meaning:

  • list all commands that are available to key bindings
  • show key binding (if there’s one) next to the command name

One of the conveniences of a command palette is the ability to run a command even if you don’t remember it’s binding. Also, you can quickly remember its key binding. Right now is quite cumbersome to go to preferences > keys > …

I’ve just taken a brief look through the api docs & it seems that it’s not doable.
If so, has something like this been mentioned as a feature request?

Welcome to the forum @actondev!

Unfortunately what you ask is not doable with the current API, every command has to be essentially reimplemented.

Key-bindings themselves and names of built-in commands are possible to get as you can parse the bindings file, there was a tool that did this (it didn’t execute commands, just listed them with the bindings) but I can’t find it now.

New Tool: Keybindings Speed Bar

This might help?

1 Like

Thanks @slujr, that’s the one.

Thank you @slujr ! That’s helpful and a compromise until (if ever) proper API support is added for actions.

v2.0.1 fixes

Fixing errors reported here: deselection and crashes related to trying to select non-existent stuff, for example samples when no samples exists in the instrument.

4 Likes

This is really good!
I am getting much faster with it, loving it. It gives me a vim feel :slight_smile:

Would it be possible to give focus to the renaming popup when entering them?
Currently the focus is back to the editor and it slow down the process a bit, forcing to use mouse and also adding mistakes sometimes.

2 Likes

Hey, glad you enjoy it @neutron!

Unfortunately tools currently don’t have a way to set focus AFAIK.

However on my setup the rename popup receives the focus when opened. Do you have to click on the command palette as well when it opens?

The palette itself gets the focus.
So let’s say I open the palette with a shortcut, then type in ni<enter> (rename instrument), the popup for renaming opens up with the text highlighted as if pressing a key would modify it, however the focus is back to the editor and as soon as I press a key for the new name the editor receives it.
I hope that makes sense.

I am using a macbook pro m1

I see, thanks for the report. Once I have a bit of time I’ll make a test tool with just a text window to see if it’s something about the tool or something specific to the fairly new Mac port of Renoise.

In the meantime if anyone else could tell me how this behaves on their setup it would be useful to narrow it down.

Just updated to the latest version…just wanted to say thanks again for the tool. I use it daily!

I’m affected this issue too (on mac) and believe i’ve found the source:

@unless if I comment out this line, leaving the command palette open, the newly opened text dialogue is focused.

What I think is happening, is the new text prompt is opened, then the old dialogue is closed - on mac, this makes the main window regain focus.

I’m working on a fix for this now and will probably open a PR against your repo if that’s cool with you!

OK, here’s the code for a working fix,

main.lua:

elseif msg.type == "finish" then
		--  set callback to execute command after dialog is closed
		o.callback = function(exit_code, m, o)
			local command = m.list[m.selected]
			-- print(m.initial)
			local result = command.run(song, m.argument, m.initial)
			if m.argument ~= nil then
				command.finish(renoise.song(), m.argument, m)
				table.insert(m.history, 1, command_call(command.alias, m.argument))
			else
				if command.type == "action" or command.type == "string" then
					command.finish(renoise.song(), nil, m)
					remember(command.alias, nil)
				end
			end
		end

		return CommandExitCode.SUCCESS
	elseif msg.type == "crawl_history" then

The command execution logic has been moved into the handly callback you provided. This callback is invoked after the command palette is closed (I can’t remember how much of this i added, will consolidate into a PR when I have time)

lui.lua:

  o.process = function(m, msg, o)
    local exit_code = o.update(m, msg, o)
    if exit_code == CommandExitCode.CONTINUE then
      o.render(m)
    else
      if o.window.visible then
        o.window:close()
      end
      if o.callback then
        o.callback(exit_code, o.model, o)
      end

Hey, thanks @muximori! Give me a few days to check this, I am not at my PC right now.

1 Like

PR is up here: -Fix an issue on mac where text prompts aren't initially focused by deferring... (!1) · Merge requests · unless games / unless_renoise · GitLab, I’ve applied the fix to the main palette and the paramater palette, I believe there are still some unfixed cases.
I’ve also expanded the “load plugin” feature to be able to select “none”, i.e unload the plugin. Unsure if it should be included in this PR

EDIT: This tool is making me enjoy renoise a whole not more, especially now I have a handle on the code. I’ve added a “new sample” command and my next goal is to add a palette similar to the DSP/fx parameter palette for sample properties and modulation sets.

version 2.0.2 - focus on Mac

Merging the fixes provided by @muximori to handle secondary popups not receiving focus on Mac.

While the fixes are simple and make complete sense from the code, unfortunately I don’t have access to a Mac to actually verify they work as intended (on Linux both the previous and post-fix versions work fine for me).

@neutron hopefully this will solve the problems you’ve reported previously!

1 Like

Thanks again, your commits are merged now, I also added you in the readme and a GPL license file to make the legalities of code contributions clear for the future.

Unloading a plugin makes sense, haven’t thought about that, but maybe it should be a separate command?

Being able to set samples and their properties would be handy as well.

Feel free to send more pull requests.

1 Like