denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] New script


From: Richard Shann
Subject: Re: [Denemo-devel] New script
Date: Wed, 31 Oct 2012 14:49:57 +0000

On Wed, 2012-10-31 at 10:17 +0100, Andreas Schneider wrote:
> Hi,
> 
> is there a howto for creating a new user-defined script? I couldn't find
> one using Google.
I don't think there is anything very coherent - I recall writing up some
of the stuff about Denemo directives some years ago but things have
developed quite a lot since then.

> I want to create a simple script that shall appear in
> the menu,
It will help to separate the idea of writing a script (you do this in
the Scheme Window) from putting it in a menu as a command (you do this
by right clicking on the menu item you want your new command to sit next
to and choosing the create new menu item option, which uses the script
you have written in the Scheme window).


>  which creates uses one score command on the current note. 
This would be a Denemo directive attached to the note, you could do it
from scratch but it may be easier to use another command and modify it
(main snag here is that there are many old commands not being very good
models because of better features now and better understanding of
scheme ...)
For example the glissando command seems like it might be suitable:


;;;Glissando
(d-DirectivePut-chord-display "Glissando"  "Gliss" )
(d-DirectivePut-chord-postfix "Glissando"  "\\glissando")
(d-DirectivePut-chord-minpixels  "Glissando" 20)
(d-SetSaved #f)
(d-RefreshDisplay)


You get this script into the scheme window by right clicking on the
command and choosing Get Script
Then you modify it, replacing glissando by ficta
then you right click on a suitable menu item and save as new menu item.
This is quite a primitive script. You may want to display something
nicer than some text above the note ... etc.

> This
> command must be globally defined in the score. In my case:
> 
> define at the beginning of the score
>  ficta = { \once \set suggestAccidentals = ##t }

To do that you need this code:

(d-DirectivePut-score-override "Ficta" DENEMO_OVERRIDE_AFFIX)
(d-DirectivePut-score-prefix "Ficta" "ficta = { \\once \\set
suggestAccidentals = ##t }")

all this could go at the start of the script.

> use \ficta on the current note


> I know that the scripts Notes/Rests > Append/Edit Note > Suggest Sharp,
> Suggest Flat and Suggest Neutral exist, but with these the notes
> themselves must not have the accidental so that the midi sounds wrong.
> Omitting the \once, the \ficta command could also be used for all notes.

In looking up this, I came across a fatal crash - the new templates for
choir that I created cause a crash (e.g. when doing New after loading
them). I have to look into that now :( Hope this is enough for you to
make a start.

Richard


> 
> Andreas
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

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