Plugin API: How to cue note playback as per up/down arrow key.

• May 24, 2020 - 20:01

Hi all!

For some context, I am (still) in the process of developing a 31 & 22 Equal Divisions of the Octave microtonal support plugin suite, and I am currently working on a plugin that allows you to transpose (and at the same time, tune) individual and group selections of notes by 1 step of the microtonal EDO tuning system (known as an edostep), the same way the up and down arrow keys raise/lower the pitch of the selected notes by a semitone. These plugins are non-docking, and are intended to replace the functionality of the up/down arrow keys - the user would assign a custom shortcut to invoke them.

How do I sound the selected note's new pitch every time a singular selected note has its pitch changed by the plugin? (Preferably, in the same manner it does when I use the up and down arrow keys to change the pitch of the note)

Any help greatly appreciated. Thanks in advance!


Comments

In reply to by matt28

Although this is not possible now to trigger directly it can still be achieved by exploiting the fact that certain commands trigger playback of the selected note. For example, something like this may give the desired effect:

var sel = curScore.selection;
if (sel.elements.length == 1 && sel.elements[0].type == Element.NOTE) {
    cmd("prev-element");
    cmd("next-element");
}

prev-element and next-element commands correspond to actions that are assigned to Alt+ and Alt+ by default.

Do you still have an unanswered question? Please log in first to post your question.