lilypond-user
[Top][All Lists]
Advanced

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

Re: Markup and Score from scheme function


From: Thomas Morley
Subject: Re: Markup and Score from scheme function
Date: Sun, 14 Oct 2018 15:12:25 +0200

Am So., 14. Okt. 2018 um 12:57 Uhr schrieb Sebastian Käppler
<address@hidden>:
>
> Finally, I found that the given answers satisfy all my needs as of now. Thank 
> you very much!

Glad you like it.

>
> Sebastian Käppler <address@hidden> schrieb am Sa., 13. Okt. 2018, 09:26:
>>
>> Add-text is even better.

Well, 'add-text' is shorter. It's defined as (add-score (list text)), though.

>> Still curious if it's possible to get the "context" inside the function.

No.
Furthermore, my function is void-function, i.e. it _returns_ nothing!
Ofcourse it _does_ something. In this case text and score are added to
the current bookpart, book or toplevel

>> Isn't that what the location parameter is for?

Nope, it makes point-and-click work.
it's meant to point to a location in your input file. But you can
watch what it does.
See:
\version "2.19.82"

foo = #(define-void-function ()() (write (*location*)))

{ R1 \foo R1 }

In my case it display in terminal:
#<location atest-80.ly:890:6>
i.e. a certain line and column

Cheers,
  Harm

>> Thomas Morley <address@hidden> schrieb am Fr., 12. Okt. 2018, 10:29:
>>>
>>> Am Fr., 12. Okt. 2018 um 08:10 Uhr schrieb Jan-Peter Voigt <address@hidden>:
>>> >
>>> > Hello Sebastian,
>>> >
>>> > what do you mean with "return"? Do want to add the score immediatly or
>>> > do you want to return an object containing both?
>>> > You used the parser-location arguments in your scheme-function, so I
>>> > guess you are using stable (2.18). I created an example for 2.18
>>> > (incomplete) and one for 2.19.82. For three possible functions.
>>> >
>>> > HTH
>>> > Jan-Peter
>>>
>>> Hi,
>>>
>>> for immediate addings, why not the simpler:
>>>
>>> example =
>>> #(define-void-function (mrkp scr) (markup? ly:score?)
>>>   (add-text mrkp)
>>>   (add-score scr))
>>>
>>> \example
>>>  \markup \bold "Test"
>>>  \score { c'4 }
>>>
>>> \example
>>>  \markup \italic "Test"
>>>  \score { cis'4 }
>>>
>>> Cheers,
>>>   Harm
>>>
>>> _______________________________________________
>>> lilypond-user mailing list
>>> address@hidden
>>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user



reply via email to

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