lilypond-user
[Top][All Lists]
Advanced

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

Creating new articulation (adding to an internal alist)


From: Urs Liska
Subject: Creating new articulation (adding to an internal alist)
Date: Fri, 06 Mar 2015 09:06:44 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

Hi,

I've got a new notation font (which is going to be released soon), and this font contains a few historic extra glyphs that I would like to add as articulations. (One can access them as \markup but articulations would be more consistent).

Some research indicates that there are two things to be done for this:

- Add a definition to #default-script-alist
- Create a command

The following code adds an entry to #default-script-alist

% Add the script definition to the global list
% -> This doesn't work!
#(set! default-script-alist
       (append default-script-alist
         (list
          `("weakbeat"
             . (
                 (script-stencil . (feta . ("weakbeat" . "weakbeat")))
                 ; any other properties
                 (toward-stem-shift-in-column . 0.0)
                 (padding . 0.20)
                 (avoid-slur . around)
                 (direction . ,UP))))))

while the following creates an articulation:
weakbeat = #(make-articulation "weakbeat")

The first command _does_ change the alist, which can be verified by displaying it before and after the command.
However, when \weakbeat is requested Lily complains about not knowning "how to interpret articulation".

If I put the command inside scm/script.scm or if I directly insert the element in the list definition in that file my new articulation works.
This tells me that I correctly assign the list entry but that it doesn't take effect.

I can see two reasons for this but have no idea if I can circumvent any of them:
  • My (set!) command is too late, that is, the list has already been processed somehow to create the articulations
  • My (set!) command somehow doesn't reach the scope where the list is evaluated.

So I have two questions (where a solution for one of them would be sufficient):

  • Is it possible to add this list entry from a user/library file in a way that it takes effect?
    (Of course I want a solution without patching scm/script.scm or any other Lily file.)
    (Using -dinclude-settings doesn't help either)
  • Is there another way to add a custom articulation from a named font glyph?
    I've seen this series (now that I start being able to read it ;-) ):
    http://lilypondblog.org/2013/08/adding-ornamentations-to-note-heads-part-1/
    but I would strongly prefer adding it as a 'real' articulation

Any help would be greatly appreciated!
Urs


reply via email to

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