denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Score directives


From: Richard Shann
Subject: Re: [Denemo-devel] Score directives
Date: Thu, 02 Apr 2015 09:23:48 +0100

Hi Andreas,

It is rather strange - last night I copied and pasted your code and
tried it and thought I saw it not working like you say. This morning I
added a line to print out the value of "choice" and of
(string-append ...) to the console to see what was going on, and it all
seemed correct and it worked.
Then I went back and cut and pasted from your email and it was working
after all.
Here is your code with the output tidied up and a call to (disp ...)
which shows you what is going on. The "\n" is scheme syntax for a
newline, and I have added an if statement to cover the case that the
user cancels rather than choosing an option.

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

;ScoreRehearsalMarkFormat
(let ((tag "ScoreRehearsalMarkFormat")
        (choice (RadioBoxMenu (cons (_ "alphabetic") "#format-mark-alphabet")
                (cons (_ "Numeric") "#format-mark-numbers")
                (cons (_ "Boxed alphabetic") "")
                (cons (_ "Boxed numeric") "#format-mark-box-numbers")
                (cons (_ "Circled alphabetic") "#format-mark-circle-alphabet")
                (cons (_ "Circled numeric") "#format-mark-circle-numbers"))))

        (if choice
                (begin
                        (disp "The choice made was " choice " and so the 
LilyPond syntax will be " (string-append "\n\\set Score.markFormatter = " 
choice) "\n")
                        (d-DirectivePut-score-postfix tag (string-append 
"\n\\set Score.markFormatter = " choice))
                        (d-DirectivePut-score-override tag 
DENEMO_OVERRIDE_GRAPHIC)
                        (d-SetSaved #f))))

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

(disp ...) is a very nice procedure which Nils created, you can put any
scheme expressions in it and it will print a representation of them on
the console.

Let me know that this works for you. I very much welcome useful commands
- once this is working from the scheme window, think about which menu it
should go in and which other command it should follow and right click on
that command and choose "Save Script as New Menu Item" and follow the
prompts. 

When finished you will have two files in
~/.denemo-1.2.3/actions/menus/ObjectMenu/...
called ScoreRehearsalMarkFormat.xml and ScoreRehearsalMarkFormat.scm
which you can send as attachments (avoids the email mangling danger).

Richard





On Wed, 2015-04-01 at 21:17 +0200, Andreas Schneider wrote:
> ;ScoreRehearsalMarkFormat
> (let ((tag "ScoreRehearsalMarkFormat")
>         (choice (RadioBoxMenu (cons (_ "alphabetic")
> "#format-mark-alphabet")
>                 (cons (_ "numeric") "#format-mark-numbers")
>                 (cons (_ "boxed alphabetic") "")
>                 (cons (_ "boxed numeric") "#format-mark-box-numbers")
>                 (cons (_ "circled alphabetic")
> "#format-mark-circle-alphabet")
>                 (cons (_ "circled numeric")
> "#format-mark-circle-numbers"))))
> (d-DirectivePut-score-postfix tag (string-append "\\set
> Score.markFormatter = " choice))
> (d-DirectivePut-score-override tag DENEMO_OVERRIDE_GRAPHIC)
> (d-SetSaved #f)) 




reply via email to

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