Re: How to make a blank page

2023-06-11 Thread Silvain Dupertuis

I tried this trick, which seems to work :

\markup " "
\pageBreak

produces a blank page

It seems that there must be something on the page for \pageBreak to produce a 
page.

Of course, there is also possibilities to add blank pages to a PDF document.

Le 11.06.23 à 15:41, Paul McKay a écrit :

\version "2.24.0"
\language "en"
myScore = \score { \relative { c'4 d e f g }}
\pageBreak
\myScore



--
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org 

Re: How to make a blank page

2023-06-11 Thread Simon Albrecht

Hi Paul,

On 11.06.23 15:41, Paul McKay wrote:
A solution which would also allow me to insert a blank space between 
scores (so I could begin a 2nd movement on an even-numbered page) 
would be good, but my current request is just for an initial one.


Jean already gave one solution, another common one would be to use a 
blank bookpart (each bookpart always starts on a new page).


%%
\version "2.24.0"

\bookpart { \markup \null }
\bookpart { \score { c' } }
\bookpart { \markup "Page intentionally left blank for page-turning 
purposes." }

\bookpart { \score { d' } }
%%

I don’t quite know what you mean by referring to the even-numbered page; 
maybe this could help: 
, 
especially the note at the bottom regarding odd/even.


Hope that helps,
Simon



Re: How to generate \scaleDurations values procedurally

2023-06-11 Thread Jean Abou Samra
Le dimanche 11 juin 2023 à 23:55 +0200, Lib Lists a écrit :

> Hello,
> I'm (re)working on a series of pieces for player piano. I'd like to
> find a way to generate all the \scaleDurations values so that I don't
> have to type them by hand. In the example below they follow a simple
> pattern (60/60k 60/59, 60/58, etc.). Unfortunately my knowledge of
> Scheme is very limited. Moreover, I wouldn't know how to insert the
> generated values to the right staves.
> Any hint would be really appreciated!



Like this?


```
\version "2.25.5"

mus = \repeat unfold 3 { c c c c }


\score {
  \new StaffGroup  <<
#@(map (lambda (i)
 #{ \new Staff { \scaleDurations #(cons 60 i) \mus } #})
   (iota 10 60 -1))
  >>

   \layout {
\enablePolymeter
\context {
  \Score
  \override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/4)
  proportionalNotationDuration = #(ly:make-moment 1/10)
  \override SpacingSpanner.uniform-stretching = ##t
  \override SpacingSpanner.strict-note-spacing = ##t
  \remove "Timing_translator"
  forbidBreakBetweenBarLines = ##f
}

\context {
  \Staff
  \remove "Time_signature_engraver"
  \override BarLine.stencil = ##f
  \override BarLine.allow-span-bar = ##f
}

\context {
  \Voice
  \remove Forbid_line_break_engraver
}
  }
}
```

The `60/59` notation is just LilyPond syntax for the Scheme pair `(60 . 59)`. 

There is some info about `#@` 
[here](https://extending-lilypond.gitlab.io/en/extending/intro.html#inserting-scheme-inside-lilypond)
 (and if you didn't know about pairs, you can read 
[this](https://extending-lilypond.gitlab.io/en/scheme/alists.html#a-word-on-pairs)).

Best,

Jean


signature.asc
Description: This is a digitally signed message part


How to generate \scaleDurations values procedurally

2023-06-11 Thread Lib Lists
Hello,
I'm (re)working on a series of pieces for player piano. I'd like to
find a way to generate all the \scaleDurations values so that I don't
have to type them by hand. In the example below they follow a simple
pattern (60/60k 60/59, 60/58, etc.). Unfortunately my knowledge of
Scheme is very limited. Moreover, I wouldn't know how to insert the
generated values to the right staves.
Any hint would be really appreciated!

Cheers,
Lib

\version "2.25.5"

partOne = \relative c' {
  \repeat unfold 3 { c c c c }
}

partTwo = \relative c' {
  \scaleDurations 60/59
  \repeat unfold 3 { c c c c }
}

partThree = \relative c' {
  \scaleDurations 60/58
  \repeat unfold 3 { c c c c }
}

\score {
  \new StaffGroup  <<
\new Staff = "one" {\partOne }
\new Staff = "two" { \partTwo }
\new Staff = "three" {\partThree }
  >>

   \layout {
\enablePolymeter
\context {
  \Score
  \override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/4)
  proportionalNotationDuration = #(ly:make-moment 1/10)
  \override SpacingSpanner.uniform-stretching = ##t
  \override SpacingSpanner.strict-note-spacing = ##t
  \remove "Timing_translator"
  forbidBreakBetweenBarLines = ##f
}

\context {
  \Staff
  \remove "Time_signature_engraver"
  \override BarLine.stencil = ##f
  \override BarLine.allow-span-bar = ##f
}

\context {
  \Voice
  \remove Forbid_line_break_engraver
}
  }
}



Re: making arpeggios with straight lines

2023-06-11 Thread John Asmuth
Perfect, thank you!

On Sun, Jun 11, 2023 at 12:33 PM Jean Abou Samra  wrote:

> Le dimanche 11 juin 2023 à 12:18 -0400, John Asmuth a écrit :
>
> Hi everyone, I'm trying to draw an up or down arrow next to a chord. This
> is common notation in classical guitar for strum direction.
>
> It seems that the most likely way to make this happen is to use \arpeggio
> and set the arpeggio stencil to draw a straight line. I saw
> https://lists.gnu.org/archive/html/lilypond-user/2019-12/msg00080.html
> that gives some hints about how to do stencils but maybe a more clear
> tutorial or set of examples would help.
>
> Or, perhaps, there's a better way to do this. I am, of course, open to any
> suggestion.
>
> Try something like this?
>
> \version "2.24.1"
>
> arrow =
> \tweak stencil
> #(lambda (grob)
>(match-let*
>  ((staff-space
>(ly:staff-symbol-staff-space grob))
>   ((and positions (bottom . top))
>(interval-scale (ly:grob-property grob 'positions)
>staff-space))
>   (dir (ly:grob-property grob 'arpeggio-direction)))
>  (grob-interpret-markup
>   grob
>   #{
> \markup \overlay {
>   \path #0.3
> #`((moveto ,0 ,bottom)
>(lineto ,0 ,top))
>   \translate #(cons 0 (interval-index positions dir))
> \general-align #Y #(- dir)
>   \arrow-head #Y #dir ##t
> }
>   #})))
> \arpeggio
>
> arrowUp = \tweak arpeggio-direction #UP \arrow
> arrowDown = \tweak arpeggio-direction #DOWN \arrow
>
> { 2\arrowUp q\arrowDown }
>
> Best,
>
> Jean
>


Re: making arpeggios with straight lines

2023-06-11 Thread Jean Abou Samra
Le dimanche 11 juin 2023 à 12:18 -0400, John Asmuth a écrit :

> Hi everyone,
> I'm trying to draw an up or down arrow next to a chord. This is common 
> notation in classical guitar for strum direction.
> 
> It seems that the most likely way to make this happen is to use \arpeggio and 
> set the arpeggio stencil to draw a straight line. I saw 
> [https://lists.gnu.org/archive/html/lilypond-user/2019-12/msg00080.html](https://lists.gnu.org/archive/html/lilypond-user/2019-12/msg00080.html)
>  that gives some hints about how to do stencils but maybe a more clear 
> tutorial or set of examples would help.
> 
> Or, perhaps, there's a better way to do this. I am, of course, open to any 
> suggestion.


Try something like this?

```
\version "2.24.1"

arrow =
\tweak stencil
#(lambda (grob)
   (match-let*
 ((staff-space
   (ly:staff-symbol-staff-space grob))
  ((and positions (bottom . top))
   (interval-scale (ly:grob-property grob 'positions)
   staff-space))
  (dir (ly:grob-property grob 'arpeggio-direction)))
 (grob-interpret-markup
  grob
  #{
\markup \overlay {
  \path #0.3
#`((moveto ,0 ,bottom)
   (lineto ,0 ,top))
  \translate #(cons 0 (interval-index positions dir))
\general-align #Y #(- dir)
  \arrow-head #Y #dir ##t
}
  #})))
\arpeggio

arrowUp = \tweak arpeggio-direction #UP \arrow
arrowDown = \tweak arpeggio-direction #DOWN \arrow

{ 2\arrowUp q\arrowDown }
```

Best,

Jean





signature.asc
Description: This is a digitally signed message part


making arpeggios with straight lines

2023-06-11 Thread John Asmuth
Hi everyone,

I'm trying to draw an up or down arrow next to a chord. This is common
notation in classical guitar for strum direction.

It seems that the most likely way to make this happen is to use \arpeggio
and set the arpeggio stencil to draw a straight line. I saw
https://lists.gnu.org/archive/html/lilypond-user/2019-12/msg00080.html that
gives some hints about how to do stencils but maybe a more clear tutorial
or set of examples would help.

Or, perhaps, there's a better way to do this. I am, of course, open to any
suggestion.

- John


Re: How to make a blank page

2023-06-11 Thread Jean Abou Samra
Le dimanche 11 juin 2023 à 14:41 +0100, Paul McKay a écrit :
> Hi
> I'm engraving a piece in two sections. The first section fits on one page and 
> the second one is rather longer and requires 2 pages. I would like the pdf to 
> have a blank page at the start because I
> often view pdf's with 2 pages side by side. All my searches have not helped. 
> My minimum not-working example is:
> 
> \version "2.24.0"
> \language "en"


You probably meant \language "english"


> myScore = \score { \relative { c'4 d e f g }}
> \pageBreak
> \myScore
> 
> My understanding of the documentation says that this ought to produce an 
> initial blank page.


I would be curious to understand what section of the documentation you are 
reading and why you believe it implies this.

\pageBreak means "the element before and the element after must not be on the 
same page". In this case, there is no element before, so nothing to do for 
\pageBreak.

You can achieve what you're after with

myScore = ...

\markup ""
\pageBreak
\myScore



signature.asc
Description: This is a digitally signed message part


How to make a blank page

2023-06-11 Thread Paul McKay
Hi
I'm engraving a piece in two sections. The first section fits on one page
and the second one is rather longer and requires 2 pages. I would like the
pdf to have a blank page at the start because I often view pdf's with 2
pages side by side. All my searches have not helped. My minimum not-working
example is:

\version "2.24.0"
\language "en"
myScore = \score { \relative { c'4 d e f g }}
\pageBreak
\myScore

My understanding of the documentation says that this ought to produce an
initial blank page. It doesn't. A solution which would also allow me to
insert a blank space between scores (so I could begin a 2nd movement on an
even-numbered page) would be good, but my current request is just for an
initial one.
Thanks in advance for your help
Paul McKay