Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Discussions about our next-generation scoring application, Dorico.
Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

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

User avatar
Daniel at Steinberg
Moderator
Posts: 17732
Joined: Mon Nov 12, 2012 10:35 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Daniel at Steinberg »

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

Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

Ok, great, thanks for letting me know. B

Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

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!

User avatar
pianoleo
Grand Senior Member
Posts: 7739
Joined: Wed Oct 19, 2016 11:17 am
Location: London, UK
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by pianoleo »

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):

Code: Select all

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:

Image

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.
Pianist/accompanist/engraver/arranger
2019 Macbook Pro 16" 2.3gGHz 8-core i9, 32GB RAM,
2015 Macbook Pro 13" Retina 3.1GHz dual-core i7, 8GB RAM; running Sibelius Ultimate, Logic Pro X, Dorico Pro 3.5 etc.
& 2017 HP ZBook Studio G3 15.6” UHD quad-i7, 16GB RAM, Windows 10 Pro
Sibelius user since Sibelius 7 (Acorn, 1997), Ex-Sibelius user since Dorico 1.0

User avatar
Daniel at Steinberg
Moderator
Posts: 17732
Joined: Mon Nov 12, 2012 10:35 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Daniel at Steinberg »

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:

Code: Select all

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:

Code: Select all

			{
				"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):

Code: Select all

			{
				"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.

User avatar
Daniel at Steinberg
Moderator
Posts: 17732
Joined: Mon Nov 12, 2012 10:35 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Daniel at Steinberg »

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

User avatar
pianoleo
Grand Senior Member
Posts: 7739
Joined: Wed Oct 19, 2016 11:17 am
Location: London, UK
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by pianoleo »

...and fools seldom differ ;)
Pianist/accompanist/engraver/arranger
2019 Macbook Pro 16" 2.3gGHz 8-core i9, 32GB RAM,
2015 Macbook Pro 13" Retina 3.1GHz dual-core i7, 8GB RAM; running Sibelius Ultimate, Logic Pro X, Dorico Pro 3.5 etc.
& 2017 HP ZBook Studio G3 15.6” UHD quad-i7, 16GB RAM, Windows 10 Pro
Sibelius user since Sibelius 7 (Acorn, 1997), Ex-Sibelius user since Dorico 1.0

Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

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!

User avatar
Daniel at Steinberg
Moderator
Posts: 17732
Joined: Mon Nov 12, 2012 10:35 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Daniel at Steinberg »

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

Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

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

Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

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?

Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

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

Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

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+=" ]
},

Ben Foskett
New Member
Posts: 13
Joined: Sat Apr 15, 2017 8:51 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Ben Foskett »

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! ;-) 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 ...

User avatar
Daniel at Steinberg
Moderator
Posts: 17732
Joined: Mon Nov 12, 2012 10:35 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Daniel at Steinberg »

Really glad this is working for you, Ben.

gratkowski
Junior Member
Posts: 100
Joined: Wed Aug 31, 2016 10:21 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by gratkowski »

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

User avatar
Daniel at Steinberg
Moderator
Posts: 17732
Joined: Mon Nov 12, 2012 10:35 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Daniel at Steinberg »

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.

gratkowski
Junior Member
Posts: 100
Joined: Wed Aug 31, 2016 10:21 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by gratkowski »

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

gratkowski
Junior Member
Posts: 100
Joined: Wed Aug 31, 2016 10:21 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by gratkowski »

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?

User avatar
Daniel at Steinberg
Moderator
Posts: 17732
Joined: Mon Nov 12, 2012 10:35 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Daniel at Steinberg »

As I say, you can trigger a specific command using a MIDI key, so you can add a shortcut to add a specific accidental, but it would be quite unwieldy: you'd have to play the unmodified pitch (e.g. C natural), then leave note input (which you could perhaps assign to a particular key so that you can go in and out of input easily), then hit the key corresponding to the specific accidental. But defining shortcuts for a specific combination of pitch plus accidental isn't practical at the moment.

gratkowski
Junior Member
Posts: 100
Joined: Wed Aug 31, 2016 10:21 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by gratkowski »

I didn't mean sending commands with a midi key. I meant to play / improvise live on a keyboard with has either a quarter tone for each half step on the keyboard, a certain range which records quarter tones or a key-switch. I often use two keyboards (one a quarter tone higher) and record improvisations with it. In Finale I was able to record it though a max patch with changed the midi notes in a way that finale recorded them right. 60 = C, 61 = C+, 62=C# etc. With max I could send any midi message to Dorico, so any "live" way of recording quarter tones would work. The best thing would still be if Dorico could transform pitch bend messages or would be able to receive OSC messages.

User avatar
Daniel at Steinberg
Moderator
Posts: 17732
Joined: Mon Nov 12, 2012 10:35 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by Daniel at Steinberg »

You can't do this in the way you describe at present, and it's unlikely that you will be able to do this in the near future, I'm afraid. But certainly I agree it is something that would be helpful to add in future.

gratkowski
Junior Member
Posts: 100
Joined: Wed Aug 31, 2016 10:21 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by gratkowski »

Thanks, meanwhile I can do it with other software and import it via xml.

gratkowski
Junior Member
Posts: 100
Joined: Wed Aug 31, 2016 10:21 am
Contact:

Re: Dorico 3 - Keyboard shortcuts for microtonal accidentals?

Post by gratkowski »

Daniel, I tried to set a keyboard shortcut for the accidentals the way you described but unfortunately nothing happens.

Below is how my json file looks. Anything I'm doing wrong?

thanks

Frank

Code: Select all

{
				"context" : "kWriteMode",
				"shortcuts" : [
					
					{
						"NoteInput.SetDotted" : [ "Num+," ]
					}, 
					
					{
						"NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.quarter-sharp.stein" : [ "Ctrl+?" ]
					},
					
					{
						"NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.quarter-flat.stein" : [ "Ctrl+ß" ]
					},
					
					{
						"NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.three-quarters-flat.stein" : [ "Ctrl+´" ]
					},
					
					{
						"NoteInput.SetAccidental?AccidentalDefinitionID=accidental.24et.western.three-quarters-sharp.stein" : [ "Ctrl+`" ]
					}
				]

Post Reply

Return to “Dorico”

Who is online

Users browsing this forum: Craig F and 3 guests