Hi Urs,

On Fri, Mar 6, 2015 at 7:14 AM, Urs Liska <u...@openlilylib.org> wrote:

>  Am 06.03.2015 13:59, schrieb David Nalesnik:
>
> Hi Urs,
>
> On Fri, Mar 6, 2015 at 2:06 AM, Urs Liska <u...@openlilylib.org> wrote:
>
>>  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
>>
>>  Change append to append!  and it works.
>
>
> Hey, you're my hero (again) :-)
> Indeed it does work!
>
>    Now I'd love to give an explanation, but I don't understand why
> "append" shouldn't work in this instance...
>
>
> Huh? Very strange. First I don't understand it Scheme-wise. Of course
> append doesn't modifiy the list, but the newly concatenated list should be
> applied using set!
>
> And particularly I could verify with #'(display default-script-alist) that
> even before the entry was actually appended to default-script-alist.
> The only thing I can imagine is that at some point (before my
> intervention) a copy is created of that list, and that my modification
> doesn't affect that copy.
>

Could be.  Here's how to get your original to work and another clue:

 \version "2.19.16"

#(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))))))

weakbeat = #(make-articulation "weakbeat")

{ c\weakbeat }

\layout {
  \context {
    \Score
    scriptDefinitions = #default-script-alist
  }
}

%%%
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to