Re: Help using a Scheme variable in a function

2024-01-06 Thread Matthew Fong
Ah ha! Thank you, David!

\override #`(line-width . ,rubricsWidthSU) does indeed work. I have to be
mindful of the environment I'm using the variable in.


Many thanks,
mattfong

On Sat, Jan 6, 2024 at 3:43 PM David Kastrup  wrote:

> David Kastrup  writes:
>
> > David Kastrup  writes:
> >
> >> Matthew Fong  writes:
> >>
> >>> I tried the following inside the function, and all generate errors. I
> would
> >>> like to use the value of rubricsWidthSU in this override.
> >>>
> >>> \override #'(line-width . \rubricsWidthSU)
> >>> \override #'(line-width . #rubricsWidthSU)
> >>> \override #'(line-width . ,rubricsWidthSU)
> >>
> >> The third one is perfect once you fix the difference between ' ("quote")
> >> and ` ("backquote").  , ("comma") is only heeded within a backquote.
> >
> > Oops, sorry.  The nomenclature is , ("unquote") rather than , ("comma").
>
> Sigh.  And while I am at it: ` ("quasiquote") rather than ` ("unquote").
>
> --
> David Kastrup
>


Re: Help using a Scheme variable in a function

2024-01-06 Thread David Kastrup
David Kastrup  writes:

> David Kastrup  writes:
>
>> Matthew Fong  writes:
>>
>>> I tried the following inside the function, and all generate errors. I would
>>> like to use the value of rubricsWidthSU in this override.
>>>
>>> \override #'(line-width . \rubricsWidthSU)
>>> \override #'(line-width . #rubricsWidthSU)
>>> \override #'(line-width . ,rubricsWidthSU)
>>
>> The third one is perfect once you fix the difference between ' ("quote")
>> and ` ("backquote").  , ("comma") is only heeded within a backquote.
>
> Oops, sorry.  The nomenclature is , ("unquote") rather than , ("comma").

Sigh.  And while I am at it: ` ("quasiquote") rather than ` ("unquote").

-- 
David Kastrup



Re: Help using a Scheme variable in a function

2024-01-06 Thread David Kastrup
David Kastrup  writes:

> Matthew Fong  writes:
>
>> I tried the following inside the function, and all generate errors. I would
>> like to use the value of rubricsWidthSU in this override.
>>
>> \override #'(line-width . \rubricsWidthSU)
>> \override #'(line-width . #rubricsWidthSU)
>> \override #'(line-width . ,rubricsWidthSU)
>
> The third one is perfect once you fix the difference between ' ("quote")
> and ` ("backquote").  , ("comma") is only heeded within a backquote.

Oops, sorry.  The nomenclature is , ("unquote") rather than , ("comma").

-- 
David Kastrup



Re: Help using a Scheme variable in a function

2024-01-06 Thread David Kastrup
Matthew Fong  writes:

> I tried the following inside the function, and all generate errors. I would
> like to use the value of rubricsWidthSU in this override.
>
> \override #'(line-width . \rubricsWidthSU)
> \override #'(line-width . #rubricsWidthSU)
> \override #'(line-width . ,rubricsWidthSU)

The third one is perfect once you fix the difference between ' (quote)
and ` (backquote).  , (comma) is only heeded within a backquote.

-- 
David Kastrup



Re: Help using a Scheme variable in a function

2024-01-06 Thread Matthew Fong
I tried the following inside the function, and all generate errors. I would
like to use the value of rubricsWidthSU in this override.

\override #'(line-width . \rubricsWidthSU)
\override #'(line-width . #rubricsWidthSU)
\override #'(line-width . ,rubricsWidthSU)


Many thanks,
mattfong

On Sat, Jan 6, 2024 at 3:21 PM Matthew Fong  wrote:

> Hello everyone,
>
> I'm feeling somewhat confounded by LilyPond Scheme variables.
>
> I've created some global variables that I want to use in functions so I
> change up some custom spacing only one (as these may vary with staff size)
>
> I defined the following
> #(define kOneStaffUnitInInches 0.0761)
> #(define kContentWidthInches 6.5)
>
> #(define halfInchSU (/ 0.5 kOneStaffUnitInInches))
> #(define contentWidthSU (/ kContentWidthInches kOneStaffUnitInInches))
> #(define rubricsWidthSU (/ (- kContentWidthInches 0.5)
> kOneStaffUnitInInches))
>
> And wrote this function:
> rubricsTest =
> #(define-scheme-function
> (text)
> (markup-list?)
> #{ \markup
> \line {
> \hspace #halfInchSU
> \override #'(line-width . 78.84)
> \wordwrap #text
> }
> #}
> )
>
> \rubricsTest \markuplist { Although it is provided with its own Preface,
> this Eucharistic Prayer may also be used with other Prefaces, especially
> those that present an overall view of the mystery of salvation, such as the
> Common Prefaces. }
>
> -
>
> I can get \hspace to happily use the variable halfInchSU. However, I
> cannot seem to use the variable rubricsWidthSU with \override
> #'(line-width . 78.84).
>
> I must be missing something very simple?
>
>
> Many thanks,
> mattfong
>
>
>
>


Help using a Scheme variable in a function

2024-01-06 Thread Matthew Fong
Hello everyone,

I'm feeling somewhat confounded by LilyPond Scheme variables.

I've created some global variables that I want to use in functions so I
change up some custom spacing only one (as these may vary with staff size)

I defined the following
#(define kOneStaffUnitInInches 0.0761)
#(define kContentWidthInches 6.5)

#(define halfInchSU (/ 0.5 kOneStaffUnitInInches))
#(define contentWidthSU (/ kContentWidthInches kOneStaffUnitInInches))
#(define rubricsWidthSU (/ (- kContentWidthInches 0.5)
kOneStaffUnitInInches))

And wrote this function:
rubricsTest =
#(define-scheme-function
(text)
(markup-list?)
#{ \markup
\line {
\hspace #halfInchSU
\override #'(line-width . 78.84)
\wordwrap #text
}
#}
)

\rubricsTest \markuplist { Although it is provided with its own Preface,
this Eucharistic Prayer may also be used with other Prefaces, especially
those that present an overall view of the mystery of salvation, such as the
Common Prefaces. }

-

I can get \hspace to happily use the variable halfInchSU. However, I cannot
seem to use the variable rubricsWidthSU with \override #'(line-width .
78.84).

I must be missing something very simple?


Many thanks,
mattfong


Rearrange all contexts in a different order

2024-01-06 Thread Cordelia
Hi,

I’m writing a score and I’d love to rearrange all the elements in the order I 
want.
As MacMillan suggested in a previous message 
(https://lists.gnu.org/archive/html/lilypond-user/2023-12/msg00237.html 
), to 
rearrange dynamics after lyrics we made up this code:

% DYNAMICs
\new Dynamics
\with {
\remove Script_engraver
\remove Text_engraver
}
\all_my_music_written_in_lilypond

The problem comes when I’d love to separate some expression marks from some 
other text.
I will be clear: in this composition I want to mark the prosody signs and some 
expression in the same .ily file and then rearrange it in the main file.
For exemple this passage:

b4^"—"\pp\(\< b8^"⏑"\) b4^"—"\(\mf\> b8^"x"\)\pp |
\override TextSpanner.bound-details.left.text = \markup { \italic { 
vacillant }}
b4^"—"\(\startTextSpan b8^"⏑" b8^"⏑" b4^"-"\stopTextSpan\) |
r8 b16.^"⏑"\p^\markup { \italic { exhalé }} r32 b8^"-"~\( b8 b4^"⏓"\) |



Do you have any idea on how can I separate the “\markup” from the “^” in the 
\score?
Hope it’s clear.
Thank you,

p.s.
Is anyone of this community in Paris?
I’d love to know a lilypond user IRL, it’s kinda rare for me.

Best,
cooordelia