Re: PDF bookmark questions

2022-02-02 Thread Nate Whetsell
Yes. The actual code on which the example is based is at

https://github.com/nwhetsell/horn-sheet-music/blob/e9f4f5a0569962719dcf6602718400c256e8c7d3/kopprasch-opus-6-60-studies-for-low-horn/main.ly

Hopefully this clarifies why I’m handling score headers in Scheme 
(specifically, some header variables are set conditionally).

> On Feb 2, 2022, at 2:14 AM, Lukas-Fabian Moser  wrote:
> 
> Hi Nate,
> 
> Am 01.02.22 um 22:11 schrieb Nate Whetsell:
>> I’m trying to add PDF bookmarks (to display in PDF readers) to a collection 
>> of studies. I’m having three issues:
>> 
>> 1. If several studies appear on the same page, the bookmarks appear in 
>> reverse order.
>> 
>> 2. The bookmarks seem to navigate to the *page* on which a study appears, 
>> not the study itself.
>> 
>> 3. It doesn’t seem to be possible to add PDF bookmarks without also using 
>> `\markuplist \table-of-contents` to add a table of content.
>> 
>> Below is an example illustrating the issues I’m having. Is there a way to 
>> create PDF bookmarks without using `\markuplist \table-of-contents`, have 
>> them appear in the expected order, and have them navigate to the expected 
>> position?
> Forgive me for barging in without having something to contribute to your 
> actual question:
>> ```
>> \version "2.22.0"
>> 
>> \book {
>>   \markuplist \table-of-contents
>> 
>>   #(do ((study-number 1 (1+ study-number)))
>>   ((> study-number 15))
>> (let ((header (make-module)))
>>   (module-define! header 'piece (number->string study-number))
>>   (let* (
>>   (score (scorify-music #{
>> \new Staff <<
>>   \tocItem \markup { #(number->string study-number) }
>>   \new Voice { c' }
>> >>
>>   #})))
>> (begin
>>   (ly:score-set-header! score header)
>>   (add-score score)
>> }
>> ```
> 
> Are you aware that you can do almost all of this using LilyPond syntax?
> 
> \version "2.22.0"
> 
> \book {
>   \markuplist \table-of-contents
> 
>   #(do ((study-number 1 (1+ study-number)))
>   ((> study-number 15))
>   (add-score
>#{
>  \score {
>\header {
>  piece = #(number->string study-number)
>}
>   \new Staff <<
> \tocItem \markup { #(number->string study-number) }
> \new Voice { c' }
>   >>
>  }
>#}))
> }
> 
> Lukas
> 




Graphical rallentendo

2022-02-02 Thread Jacques Menu
Hello folks,

Is there a more natural way of obtaining this result than with a sequence of 
shorter and shorter skips?

Thanks for your help!

JM


%%

\version "2.23.5"

\relative c''' {
  \time 6/8

  <<
{
  g8 ^\markup {\italic "rit." }  g4  g8
  g4  | % 16
  c8 [  bes8 (  g8 )
  e8 (  c8 )  bes8 _\laissezVibrer ]
}
{
  \once\override TextSpanner.style = #'trill % wave zigzag
  \once\override TextSpanner.minimum-length = #8
  \once\override TextSpanner.Y-offset = #-4
  \once\override TextSpanner.springs-and-rods = 
#ly:spanner::set-spacing-rods
  { s2. \startTextSpan s2 s8... s64 \stopTextSpan }
}
  >>
}

%%





Re: Graphical rallentendo

2022-02-02 Thread Lukas-Fabian Moser

Hi Jacques,

Is there a more natural way of obtaining this result than with a 
sequence of shorter and shorter skips?


The following seems to work here:

\version "2.23.5"

\relative c''' {
  \time 6/8
  <<
    {
  g8 ^\markup {\italic "rit." }  g4  g8
  g4  | % 16
  c8 [  bes8 (  g8 )
  e8 (  c8 )  bes8 _\laissezVibrer ]
    }
    {
  \once\override TextSpanner.style = #'trill % wave zigzag
  \once\override TextSpanner.minimum-length = #8
  \once\override TextSpanner.Y-offset = #-4
  \once\override TextSpanner.springs-and-rods = 
#ly:spanner::set-spacing-rods

  { <> \startTextSpan s2.*2 <> \stopTextSpan }
    }
  >>

}

If you want the stopTextSpan to happen before the next bar starts, feel 
free to replace *2 in s2.*2 by a fraction slightly less than 2, for 
example 127/64.


In general, I never liked the technique of attaching events that occur 
at the start of a timestep to spacer rests, and I already changed this 
in the documentation at some points I think: To  me,


s2\f s2\> s1\p

always reads as "before skipping 2, put a \f; then, before skipping 
another 2, start a diminuendo; then, before skipping a 1, put a \p" 
which feels like mental roller coaster. It seems much more natural to do


<>\f s2 <>\> s2 <>\p

allowing us to read in the natural order: put a \f, then skip 2, then 
start a diminuendo, etc.


And of course, with recent development versions, you can even do

<>\f \after 2 \> \after 1 \p s1*2

or something like that.

Lukas