denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] Tremelo


From: Richard Shann
Subject: Re: [Denemo-devel] Tremelo
Date: Fri, 24 Feb 2017 09:35:01 +0000

On Fri, 2017-02-24 at 07:34 +0000, Richard Shann wrote:
> > You also had a move in your script - you could add that too - [...]
> 
> oh! and if you make a command in the menu system for this and give it
> a
> keyboard shortcut then you can apply it to the selection using the
> Apply
> To Selection command in the Edit->Select menu.

Well, if you have the d-MoveCursorRight command in your script then
applying it to the selection would result in every other note getting a
tremolo.
"Apply Shortcut to Objects in Selection" should come with a health
warning as it is easy to create infinite loops with it. (e.g. move left,
and then it goes on to the next object, and then gets move left
again ...). There is an alternative method of applying commands to the
selection that is safer but slower:

(ApplyToTaggedSelection 
        (lambda () 
                (d-WarningDialog "hello")
                (d-MoveCursorLeft)
                (d-WarningDialog "goodbye"))) 

that will 
        say hello
        move to the left and
        say goodbye
 for each object in the selection.

(Whereas if you just applied that directly to the selection it would
loop forever moving left, then right for the next object in the
selection).

Having written all that, it seems clear I should upgrade the "Apply
Shortcut to Objects in Selection" to use this fancier, if slower,
procedure (I've never looked into it before).

Richard
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]