lilypond-user
[Top][All Lists]
Advanced

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

Re: Need help with Scheme code


From: Paolo Prete
Subject: Re: Need help with Scheme code
Date: Wed, 18 Dec 2019 21:10:05 +0100

Hi Jaap, 

it doesn't fit with what I'm searching for (sorry: my question was not enough clear) . 
I need to obtain the property set/calculated by Lilypond, not the one set by me.
Shortly: for a Beam, how can I:

(set! myVar positions-of-the-beam-set-by-lilypond)

or:

(set! myVar Y-offset-of-the-beam-set-by-lilypond)


I don't understand if these properties are user-only settable, or if they are set by Lilypond too.
If they are not set by Lilypond, how can I obtain them and  put them into myVar ?

My aim is to pass these properties to the SVG script through the "output-attributes" mechanism, instead of having to parse the SVG output with JS (which is possible too, but I would like to avoid that)

Thanks,
P

On Wed, Dec 18, 2019 at 6:57 PM <address@hidden> wrote:

Without giving you any solution, I can give you a hint:

 

Write the music in the traditional way, with and without your modification.

 

In your lilypond file put:

\displayMusic oldmusic

\displayMusic newmusic

 

And what you can see wht you have to write by observing the differences

 

Jaap

 

From: lilypond-user <lilypond-user-bounces+lilypond=address@hidden> On Behalf Of Paolo Prete
Sent: Wednesday, December 18, 2019 3:30 PM
To: Aaron Hill <address@hidden>
Cc: lilypond-user <address@hidden>
Subject: Re: Need help with Scheme code

 

Thanks again.

Now, from what I see, I can extract if #mus is a Beam with  (ly:music-property mus 'name)  --> BeamEvent

After that, how can I set, inside the same function you wrote, a variable with the  beam-thickness value of the corresponding Beam? 

something like (pseudo code):  (set! myVar current-value-of-beam-thickness )

 

 

 

On Wed, Dec 18, 2019 at 5:14 AM Aaron Hill <address@hidden> wrote:

On 2019-12-17 6:01 pm, Paolo Prete wrote:
> And thanks again to the Scheme-master Aaron.

I appreciate the kind words, though I doubt my experience rises to the
level of "master".

> One last thing:
>
> how can I arrange that function so to obtain output-attributes =
> output-attributes + id ?
>
> For example: if output-attributes is (('a' . 'aa') ('i' . 'ii'))  it
> must
> become:    (('a' . 'aa') ('i' . 'ii') ('id' . 'foobar_1'))

Where or how are the other output-attributes being set?  It is my
understanding that output-attributes is unset by default, so any
\override or \tweak would not need to worry about existing definitions.

That said, consider this pattern:

%%%%
\version "2.19.83"
{ \tweak Accidental.output-attributes.id 123 bes'4 }
%%%%

Keep in mind this only *adds* a new key-value pair to the alist; it does
not change an existing entry with the same key.


-- Aaron Hill


reply via email to

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