[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Extracting symbol location
From: |
David Nalesnik |
Subject: |
Re: Extracting symbol location |
Date: |
Mon, 9 Jan 2017 08:43:43 -0600 |
On Mon, Jan 9, 2017 at 4:55 AM, Lukas Tuggener <address@hidden> wrote:
> Hi David
>
> When I tried to use your very useful script on a fresh installation it didnt
> work anymore. I suspect it is due to the change you already mentioned in
> your first message:
>
> There's a patch being reviewed which replaces the 'id property with
> 'output-properties and this will need to be updated accordingly
> (https://sourceforge.net/p/testlilyissues/issues/4974/).
>
>
> I tried to uptdate the script, but didnt get it to work so far. I assume the
> updated assignIDs function should look something like this:
>
> assignIDs = #(let ((grob-names (map car all-grob-descriptions)))
> #{
> #@(map (lambda (x)#{ \override #(list 'Score x (assoc-get 'id
> output-attributes) = #get-unique-id #})
> grob-names)
> #})
>
> For any hint where I went wrong i would be very grateful.
Before I give a solution, two observations:
(1) you're missing a close parenthesis before the equals.
(2) there is no variable called "output-attributes" which you can
treat as an alist by applying assoc-get: it is a symbol (needing a
single-quote to reference).
The \override command we would model to change an "id" property nested
in an "output-attributes" property is:
\override Score.someGrob.output-attributes.id = #get-unique-id
and that translates to this definition of assignIDs:
assignIDs =
#(let ((grob-names (map car all-grob-descriptions)))
#{
#@(map (lambda (x) #{
\override #(list 'Score x 'output-attributes 'id) = #get-unique-id
#})
grob-names)
#})
%%%
The new output-attibutes property allows you to create multiple
attributes, so why not adapt the labeling routines to return something
like
value of output-attributes = '((name . someGrob) (moment . whenIAm)
(x-pos . xCoordinate) (y-pos . yCoordinate))
Would this be something you could use in your post-processing?
HTH,
David