FR: Halving or doubling the current note duration for input

In case this actually did interest someone (despite no response for two days :stuck_out_tongue:), I just found a workaround after some digging, involving lua scripting/hacking of keycommands_en.json, which I’ll share here for future reference.


In fact, I discovered that there is built in functionality for augmenting/diminishing the note duration for input, but only in the context of Step Input On Tab, namely Note Value Longer and Note Value Shorter, so you cannot simply – in the standard way – go into the key commands section in the setup dialogue and assign key commands for these tasks and expect them to work in the β€œnormal” step input context. Instead you will have to follow the steps below.

First of all, for those of you reading this not familiar with these kind of hacks: be careful! I recommend reading the following post carefully before attempting to do this on your own: Dorico 3 - Keyboard shortcuts for microtonal accidentals? - #6 by dspreadbury

  1. Create two .lua files, with the following contents:
local app=DoApp.DoApp()
app:doCommand([[NoteInput.NoteValueLonger]])

and

local app=DoApp.DoApp()
app:doCommand([[NoteInput.NoteValueShorter]])

respectively. (I chose to name the files NoteValueLonger.lua and NoteValueShorter.lua.)

  1. Open the keycommands_en.json file (see file paths for Windows and Mac in the link above).
  2. In the file, looking something like this:
{
    "common" : {
        "contexts" : [
           
            {
                "context" : "kGlobal",
                "shortcuts" : [
                   
                    {
                        "Edit.BeamTogether" : [ "Ctrl+B" ]
                    },
                   
                    {
                        "Edit.ChangeVoiceToDownstem1" : [ "Alt+2" ]
                    },

…

                    {
                        "Project.Player.Duplicate" : [ "Shift+D" ]
                    }
                ]
            },

…
– locate the string "context" : "kGlobal". Just below that, you will find a key (json terminology) named shortcuts with a value (json terminology) of all the user assigned key commands.

  1. Within the shortcuts value, manually add two new key/value pairs like following, replacing the dummy paths and key commands with appropriate ones:
{
    "Script.RunScript?ScriptPath=/your/path/to/NoteValueLonger.lua" : [ "your+key+command" ]
},

{
    "Script.RunScript?ScriptPath=/your/path/to/NoteValueShorter.lua" : [ "your+key+command" ]
}

Make sure that the file still contains valid json syntax after your edit, by checking it against a validator!


Even though I got it to work eventually, I still find it odd that this functionality seems to be designed only to work in the Step Input On Tab context. Is there a specific reason for this to be limited in this way, while – as far as I can see – it could really come in handy elsewhere?

1 Like