Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Hi,

Is it now possible to assign keyboard shortcuts to mircotonal accidentals in Dorico 3, basically the main reason why I would upgrade!

Best,

Ben

1 Like

No, I’m afraid not yet, Ben, but it’s still in the plans.

1 Like

Ok, great, thanks for letting me know. B

Doesn’t anyone have any external solutions to make keyboard shortcuts for this or is it a waiting game? I’m starting to get further into Dorico now that it has enough features, with the view of replacing my Sibelius use, but this is one area that really slows down putting music in, especially now that I’m starting to understand how good Dorico is for not touching the mouse!

You can bind shortcuts for these manually if you’re prepared to edit your keycommands.json file manually.

Warnings first:
Do use a decent text editor (BBEdit, Sublime Text, SciTE etc.)
Do backup your keycommands file somewhere safe before you edit it
Do close Dorico before you edit your keycommands file
Do ensure you match the existing syntax of the JSON file exactly, and run the whole thing through www.jsonlint.com and hit Validate (and ensure you get a green result) before you save and reload Dorico.
When assigning shortcuts, type “Ctrl” if you want to use “Cmd” on mac, type “Alt” if you want to use “Opt” on mac and type “Meta” if you want to use “Control” on mac. Note that “Meta” is often problematic and is best avoided

The way to uncover the underlying functions is

  1. Select a note.
  2. Go Script > Start Recording Macro.
  3. Add the accidental manually.
  4. Go Script > End Recording Macro.
  5. Go to your user folder ( %appdata%\Steinberg\Dorico 2 or Dorico 3 on Windows, /Users/your-username/Library/Application Support/Steinberg/Dorico 2 or Dorico 3 on mac) and open the resulting Script Plug-ins\Usermacro.lua file in a text editor.

You should see something like this (I clicked through a few microtonal accidentals here):

local app=DoApp.DoApp()
app:doCommand([[UI.InvokePaletteButton?PaletteIndicatorID=kKeySigPanel.accidental.24et.western.triple-flat.gould&PaletteSectionID=kKeySigAccidentalsPanel&PropertyButton=false&SetOldValue=false&Set=true&UseLocalOverride=0]])
app:doCommand([[NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.triple-flat.gould]])
app:doCommand([[UI.InvokePaletteButton?PaletteIndicatorID=kKeySigPanel.accidental.24et.western.double-flat-down.gould&PaletteSectionID=kKeySigAccidentalsPanel&PropertyButton=false&SetOldValue=false&Set=true&UseLocalOverride=0]])
app:doCommand([[NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.double-flat-down.gould]])
app:doCommand([[UI.InvokePaletteButton?PaletteIndicatorID=kKeySigPanel.accidental.24et.western.double-flat.gould&PaletteSectionID=kKeySigAccidentalsPanel&PropertyButton=false&SetOldValue=false&Set=true&UseLocalOverride=0]])
app:doCommand([[NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.double-flat.gould]])

Now get your keycommands_en.json file loaded in a text editor and add in each of the commands that start “NoteInput.SetAccidental”, ensuring you match the existing syntax of the JSON. You’ll need to allocate shortcuts that you’re not using elsewhere. For ease of understanding, I make a point of using the kGlobal context (at the top of the JSON file), though I guess if you want to use the same shortcuts for different things in different modes you’d want to use the kWriteMode context for these. Just by way of example, you should end up with something that looks like the middle line of this, for each accidental:

Note: this use of Dorico’s (currently rather limited) script recording can get you access to pretty much anything in the properties panel and much of the stuff in the right panel, at least in Write mode. If something doesn’t work initially, you’re either reusing a keyboard shortcut that’s already in use, or you’ll need to try stripping some of the arguments out.

Now go and read those warnings again.

1 Like

Well, if you’re willing to get down and dirty you should be able to do this, but it’s not super-easy.

Quit and restart Dorico (so that you will have a new application.log file created, which will make it easier to find the info you need). Start a new project that contains your favoured tonality system, and add a single player holding an instrument. Input a series of notes with your chosen accidentals, clicking on the buttons in the Accidentals panel. Quit Dorico: you can discard the project file.

Now go to your user application data folder, which on Windows is %APPDATA%\Steinberg\Dorico 3 and on Mac is /Users/your-username/Library/Application Support/Steinberg/Dorico 3. Find the file called application.log and open it in a good text editor (e.g. VS Code, BBEdit, SciTE, et al.). This logs everything that you did in the last session, including the commands that you invoked while editing your score. You’ll see some commands for each accidental you created, of the form:

2019-10-11 09:08:54.674 : Executing command: UI.InvokePaletteButton?PaletteIndicatorID=kKeySigPanel.accidental.24et.western.triple-flat.gould&PaletteSectionID=kKeySigAccidentalsPanel&PropertyButton=false&SetOldValue=false&Set=true&UseLocalOverride=0
2019-10-11 09:08:54.675 : Posting command (force): NoteInput.SetAccidental AccidentalDefinitionID=accidental.24et.western.triple-flat.gould
2019-10-11 09:08:54.685 : notifyPostCommandExecute: UI.InvokePaletteButton?PaletteIndicatorID=kKeySigPanel.accidental.24et.western.triple-flat.gould&PaletteSectionID=kKeySigAccidentalsPanel&PropertyButton=false&SetOldValue=f
2019-10-11 09:08:54.686 : Executing command: NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.triple-flat.gould
2019-10-11 09:08:54.700 : notifyPostCommandExecute: NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.triple-flat.gould (13 ms)
2019-10-11 09:12:36.015 : Posting command (requested): File.AutoSave Post=true

The line you need is the one that says Executing command and the crucial bit is the following, e.g. NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.triple-flat.gould. We’ll call this latter half of the line a command string, and this is what you need to create a custom key command.

If you’re using the built-in 24-EDO tonality system you’ll see recognisable names for the AccidentalDefinitionID parameter but if you’re using your own custom accidentals, I’m afraid they’ll be long strings of gibberish. But they will each be unique, at least.

Pull out the command string for each of the accidental types you’re interested in. Now, in that same good text editor, open the file keycommands_en.json. This is the tricky bit: if you mess up the format of the JSON file, Dorico won’t be able to load any keyboard shortcuts at all. You can check that the format of the file is still valid by copying and pasting the whole contents into this web site and clicking the Validate JSON button.

Your goal now is to add some new entries to the kWriteMode section of this file. Look for a section that looks like this:

			{
				"context" : "kWriteMode",
				"shortcuts" : [

You now need to carefully add new entries for each of the accidentals to which you want to define new key commands, being sure to get the syntax right. Follow the example of the key commands directly above. It’s very important that you do not have a trailing comma after the last closing curly brace before the closing square bracket. The JSON linter will point out this error if you make it.

The section might end up looking a bit like this (though there will be more commands shown):

			{
				"context" : "kWriteMode",
				"shortcuts" : [
					{
						"NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.triple-flat.gould" : [ "Meta+1" ]
					},
					{
						"NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.triple-sharp.gould" : [ "Meta+2" ]
					}
				]
			}

Once you’ve added the desired accidentals, you can save the JSON file, validate it, and then run Dorico to see whether you got it right.

Heh, I see Leo was on the same journey at the same time I was…

…and fools seldom differ :wink:

This is amazing, thank you both so much. I think I’ll give it a go.

So if I totally mess it up, very likely … Can I just close Dorico, move the orignal backed up JSON file back into place and load up Dorico again to restore things back to normal?!

By the way, my post was meant to say “Does anyone have” not “Doesn’t”, it wasn’t meant to sound accusatory!

Yes, you can indeed just restore the original JSON file and forget the whole sorry affair ever happened.

Great, thanks, that’s good to know… Will let you know how I get on!

When I open a new project the tonality system I’m using isn’t among the options I’m given (still just the two standard ones.) Am I missing something about how additional tonality systems work. Are they only attached to one file? So I have to open my file with the system in it delete all the music and use it as a template for all future pieces where I want that tonality system?

Don’t worry, found the save as default button mentioned in another thread … Now it’s there …

Ok, so I have it working! Thank you so much for this, no longer shall I touch the mouse …

I’d be happy to put up my dorico file with my 1/4 tone system (back to front flats, 1 and 3 stroke sharps etc as in Sibelius standard 1/4 tones) so it can be imported in.

  • then you just copy this into the kWriteMode as indicated above:

{
“NoteInput.SetAccidental?AccidentalDefinitionID=accidental.user.user.8fc6e640-2935-4ff8-baa8-26e840de50c0” : [ “Shift±” ]
},

{
“NoteInput.SetAccidental?AccidentalDefinitionID=accidental.user.user.214a4124-713d-4398-b00f-567711a6a61d” : [ “Shift+=” ]
},

{
“NoteInput.SetAccidental?AccidentalDefinitionID=accidental.user.user.0a4c3148-6b7b-4603-8b36-dcd9528e776e” : [ “Shift+Alt±” ]
},

{
“NoteInput.SetAccidental?AccidentalDefinitionID=accidental.user.user.ea312556-49df-4fad-ac44-3cdd60539026” : [ “Shift+Alt+=” ]
},

The largest problem I had with all this was that it really didn’t want to work for along time until I realised I was changing the dorico 1 keycommand file rather than the dorico 2! :wink: Good to watch out for that, saves an hour or so … Otherwise I found it pretty easy to implement from the instructions provided so I would suggest anyone in my position to give it a go …

Really glad this is working for you, Ben.

Is it somehow also possible to use a midi keyboard for recording quarter tones?
The possible options I see would be:

  1. having quarter tones on a different midi channel
  2. using midi 60 for C, 61 = C+, 62=C# etc.
  3. sending pitchbend (or any controller) messages while recording
  4. using a key swith message

To the extent that you can already use MIDI commands as shortcuts, you can certainly assign them to these additional commands you have manually added to the JSON file, but you’ll need to set a few MIDI shortcuts to existing commands in the Key Commands editor and then examine the resulting JSON to see how to define MIDI shortcuts to the commands you’ve manually added. Dorico doesn’t provide any means of designating only one MIDI input device or channel as the sole provider of MIDI shortcuts at the moment. You could perhaps earmark the bottom octave on your keyboard for shortcuts for microtonal accidentals.

Thanks I’ll try to make my own JSON file.

Actually what I was looking for is to record quarter tones by using a Midi Keyboard and using a key-switch for the microtones or having 60 for C, 61 = C+, 62=C# etc.
Is that also possible through the JSON file?