lilypond-user
[Top][All Lists]
Advanced

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

Re: Determining what parameters exist for an item


From: Thomas Morley
Subject: Re: Determining what parameters exist for an item
Date: Sun, 24 Jan 2016 21:51:23 +0100

2016-01-24 21:32 GMT+01:00 Simon Albrecht <address@hidden>:
> On 24.01.2016 21:28, Simon Albrecht wrote:
>>
>> On 24.01.2016 21:15, Thomas Morley wrote:
>>>>
>>>> Now, if I want to reduce or enlarge KeyCancellation.X-extent, knowing
>>>> that default is (0.0 . 5.866662)*** gives me critical information that I 
>>>> can
>>>> actually use as a reference point; without that information, the
>>>> trial-and-error factor increases dramatically.
>>>
>>> Well, we have the \offset-function ...
>>> No clue about possible limitations, though
>>
>>
>> Oh, it would be great if we could use \offset for such cases.
>> Unfortunately it doesn’t work here…
>> David, is this the case you described in
>> <http://sourceforge.net/p/testlilyissues/issues/4516/#1cc7>, with mutable
>> properties?
>
>
> Test case:
>
> %%%%%%%%%%%
> \version "2.19.35"
> {
>   \key fis \major
>   1
>   \once\override Staff.KeyCancellation.X-extent = #'(0 . 5)
>   \key b \minor
>   1
>   \once\offset X-extent #'(0 . 5) Staff.KeyCancellation
>   \key g \major
>   1
> }
> %%%%%%%%%%
>
> – throwing twice ‘warning: the property 'X-extent of #<Grob KeyCancellation
>> cannot be offset’ and printing the KeyCancellation _without_ any X-extent.
>
> Yours, Simon


Ok, \offset has limitations.
Though, I usually read directly the relevant grob-property and reset
it to my needs:

{
  \key cis \major
  c1
  \once\override Staff.KeyCancellation.after-line-breaking =
    #(lambda (grob)
      (write-me "\nX-extent: " (ly:grob-property grob 'X-extent))
      )
  \key ces \major
  c1
}


Prints to terminal:
X-extent: (0.0 . 5.866662)

Now I have the actual value and can do what ever I want with it ;)


Cheers,
  Harm



reply via email to

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