Re: A question about a scheme function with two input notes

2022-12-29 Thread Alasdair McAndrew
Thank you SO very much!  Such a simple thing ... (as is so often the case,
certainly with my queries).  It now works perfectly.

Alasdair

On Fri, Dec 30, 2022 at 10:17 AM Jean Abou Samra  wrote:

> Le 30/12/2022 à 00:12, Alasdair McAndrew a écrit :
> > Hello,
> >
> > I am typesetting some late Renaissance, early Baroque music for which
> > a double stop (= chord with two notes) on a stringed instrument would
> > be notated with the stem of the top note up and the stem of the lower
> > note down.  So instead of using the standard notation
> >
> > 4
> >
> > for a double stop, I am using
> >
> > << {a4} \\ {e4} >>
> >
> > This is convenient as most of the music is with single notes, so I
> > just bung in one of these when I need to.
> >
> > And I thought I'd be clever by writing this into a little Scheme
> function:
> >
> > dStop =
> > #(define-music-function
> >  (topnote bottomnote)
> >  (ly:music? ly:music?)
> >#{
> > << {#topnote} \\ {#bottomnote} >>
>
>
> Try adding spaces here:
>
> << { #topnote } \\ { #bottomnote } >>
>
> Scheme is very lax about what can happen in identifiers. It mostly
> separates elements by spaces. Therefore, if you write no space between
> '#topnote' and '}', Scheme sees a reference to a variable called
> 'topnote}', which is the meaning of the error message
>
> Unbound variable: #{topnote\x7d;}#
>
> Best,
>
> Jean
>
>
>
>

-- 
Alasdair McAndrew (he/him)
mob: 0432 854 858

https://numbersandshapes.net


Re: A question about a scheme function with two input notes

2022-12-29 Thread Jean Abou Samra

Le 30/12/2022 à 00:12, Alasdair McAndrew a écrit :

Hello,

I am typesetting some late Renaissance, early Baroque music for which 
a double stop (= chord with two notes) on a stringed instrument would 
be notated with the stem of the top note up and the stem of the lower 
note down.  So instead of using the standard notation


4

for a double stop, I am using

<< {a4} \\ {e4} >>

This is convenient as most of the music is with single notes, so I 
just bung in one of these when I need to.


And I thought I'd be clever by writing this into a little Scheme function:

dStop =
#(define-music-function
     (topnote bottomnote)
     (ly:music? ly:music?)
   #{
    << {#topnote} \\ {#bottomnote} >>



Try adding spaces here:

<< { #topnote } \\ { #bottomnote } >>

Scheme is very lax about what can happen in identifiers. It mostly 
separates elements by spaces. Therefore, if you write no space between 
'#topnote' and '}', Scheme sees a reference to a variable called 
'topnote}', which is the meaning of the error message


Unbound variable: #{topnote\x7d;}#

Best,

Jean





OpenPGP_signature
Description: OpenPGP digital signature


A question about a scheme function with two input notes

2022-12-29 Thread Alasdair McAndrew
Hello,

I am typesetting some late Renaissance, early Baroque music for which a
double stop (= chord with two notes) on a stringed instrument would be
notated with the stem of the top note up and the stem of the lower note
down.  So instead of using the standard notation

4

for a double stop, I am using

<< {a4} \\ {e4} >>

This is convenient as most of the music is with single notes, so I just
bung in one of these when I need to.

And I thought I'd be clever by writing this into a little Scheme function:

dStop =
#(define-music-function
 (topnote bottomnote)
 (ly:music? ly:music?)
   #{
<< {#topnote} \\ {#bottomnote} >>
   #})

But this doesn't work; I get multiple GUILE errors in the definition line.
Clearly I'm misunderstanding something, but in my hunting about I haven't
found any examples of scheme functions with multiple musical inputs.

If anybody could point me in the right direction I'd be delighted!

(There might be other ways of obtaining this same effect without voices,
say by somehow tweaking the chord typesetting to have the stem of the top
note up, and the stem of the lower note(s) down ... but I have no idea how
to do this.  Multiple voices is easy, if perhaps a bit clumsy.)

Thank you,
Alasdair

-- 
Alasdair McAndrew (he/him)
mob: 0432 854 858

https://numbersandshapes.net


Re: skipping whole bars in lyrics

2022-12-29 Thread Joel C. Salomon

On 12/29/2022 7:53 AM, mark damerell wrote:

The best I could find in the thread above was

\lyricmode { \repeat unfold  #n {\skip 1}  (lyrics) }

which is messy because  n  is the number of notes, not bars.  There 
are far more
notes and you have to adjust for ties & slurs & etc. and the bars are 
numbered.


Partial answer: If your score is split into different music variables, 
you can (in 2.24) write `|\skip \sopmusic|` rather than `|\skip 
|`.


(In 2.22, you can write `|#(skip-of-length sopmusic)|`, but that's 
sometimes finicky around unfolded repeats.)


--Joel


Re: Placing (some) outside-staff objects horizontally rather than vertically

2022-12-29 Thread William Rehwinkel

Dear Joel,

Especially if you are most interested in replicating a known source, 
another workaround that you may try is to manually write the three 
symbols as one markup line, like so:


Thanks,
-Will

% --
\version "2.24.0"

music = \fixed c' {
  \set Score.tempoHideNote = ##t
  \tempo 4 = 80
  \textMark \markup {
\line {
  \small \italic "Silence."
  \large Largo.
  \small "\"PETER DRAGS WENDY ON TO ROCK\""
}
  }
  d1
  \repeat unfold 4 { c4 d e f }
}



\score {
  <<
\music
  >>
}
% --


On 12/29/22 15:49, Joel C. Salomon wrote:
The attached example has simultaneously a text mark, tempo mark, and 
section label.


Is there a way to get Lilypond to place them next to each other 
horizontally, rather than stacking them vertically, to match the 
original score?  Ideally, this would obey `outside-staff-priority`.


(Yes, there is: by manually tweaking the anchors for the various marks, 
till they end up approximately where I want them; see below.  I'm hoping 
there's a cleaner option available.)


--Joel


\version "2.24.0"

music = \fixed c' {
   \textMark \markup \small \italic "Text Mark"
   d1
   \repeat unfold 4 { c4 d e f }
}

dynamics = {
   \set Score.tempoHideNote = ##t
   <>\tempo 4 = 80
   \after 4*3 \tempo "Tempo Mark"
   \skip \music
}

up = {
   \after 1*2 \sectionLabel "Section Label"
   \music
}

\score {
   <<
     \up
     \new Dynamics \dynamics
   >>
}


--
+ -- +
|William Rehwinkel - Oberlin College and |
|   Conservatory '24 |
|  will...@williamrehwinkel.net  |
| PGP key:   |
| https://williamrehwinkel.net/static/pubkey.txt |
+ -- +


OpenPGP_signature
Description: OpenPGP digital signature


Re: Single EPS file trimmed output

2022-12-29 Thread Federico Bruni




Il giorno gio 29 dic 2022 alle 11:14:03 +0100, Mauro 
 ha scritto:

Dear all,

I have a large repository of scores which are currently being built 
as eps documents using the following command:


lilypond -E -dno-gs-load-fonts -dinclude-eps-fonts file.ly

This command, up to version 2.22, generates a single eps file 
(file.eps) trimmed down to just the size of the score.


I recently upgraded from lilypond 2.22.2 to 2.24.0 and the same 
command now produces a full-page output. After searching the lists 
and the documentation, I understand that I have to set 
'use-paper-size-for-page' to false in order to get a trimmed down 
output, but I do not understand how to get a single eps file.


I have tried different combinations of command line args. I am only 
able to generate two output files (file.eps and file-1.eps), both of 
them identical and trimmed down, with the following command:


lilypond -E -dno-gs-load-fonts -dinclude-eps-fonts 
-dno-use-paper-size-for-page demo.ly


Is this how it is supposed to work? Why is lilypond generating a 
second identical file with -1 suffix?


I could easily remove the second file (file-1.eps) in my build chain, 
but I wonder if I am missing something.






There was a similar discussions last month:
https://lists.gnu.org/archive/html/lilypond-user/2022-11/msg00047.html

In your example I would add a \pageBreak to get a better understanding 
of what lilypond does.
I cannot open EPS files currently, but as far as I can see from the 
file manager thumbnails the first file is the two page file, while 
-1.eps and -2.eps are the single pages. They are different:


$ ls -lh *.eps
-rw-r--r--. 1 fede fede 157K 29 dic 14.40 demo-1.eps
-rw-r--r--. 1 fede fede 156K 29 dic 14.40 demo-2.eps
-rw-r--r--. 1 fede fede 158K 29 dic 14.40 demo.eps










skipping whole bars in lyrics

2022-12-29 Thread mark damerell
This problem has appeared on this forum:

https://lists.gnu.org/archive/html/lilypond-user/2004-11/msg00295.html

but some years ago, so I thought it better to start a new thread.

I am trying to set the carol "O holy night " by A. Adam ( arr P. Le Bas )
verse 1 goes like this:

a): sopranos only
b): altos join in, same words
c): they sing different words.

Verses 2 & 3 similar.

What I think should happen is in  a)  and  b)   \lyricsto  \sopmusic  below
the staff
and then at  c)  the sop. lyrics go above the staff and the alto words
start up below;
but  only on the remaining alto music not on all the alto music .

So what I want is the equivalent of  \lyricmode{ \rest 30 bars   (lyrics)
}

The best I could find in the thread above was

\lyricmode { \repeat unfold  #n {\skip 1}  (lyrics) }

which is messy because  n  is the number of notes, not bars.  There are far
more
notes and you have to adjust for ties & slurs & etc. and the bars are
numbered.

Please any advice? thank you


Single EPS file trimmed output

2022-12-29 Thread Mauro

Dear all,

I have a large repository of scores which are currently being built as 
eps documents using the following command:


lilypond -E -dno-gs-load-fonts -dinclude-eps-fonts file.ly

This command, up to version 2.22, generates a single eps file (file.eps) 
trimmed down to just the size of the score.


I recently upgraded from lilypond 2.22.2 to 2.24.0 and the same command 
now produces a full-page output. After searching the lists and the 
documentation, I understand that I have to set 'use-paper-size-for-page' 
to false in order to get a trimmed down output, but I do not understand 
how to get a single eps file.


I have tried different combinations of command line args. I am only able 
to generate two output files (file.eps and file-1.eps), both of them 
identical and trimmed down, with the following command:


lilypond -E -dno-gs-load-fonts -dinclude-eps-fonts 
-dno-use-paper-size-for-page demo.ly


Is this how it is supposed to work? Why is lilypond generating a second 
identical file with -1 suffix?


I could easily remove the second file (file-1.eps) in my build chain, 
but I wonder if I am missing something.


Thanks,

Mauro Levra


PS: Here is a tiny example:

\version "2.22.0"
% Set a custom size with the width I am
% interested in and hypothetical maximum height.
#(set! paper-alist (cons '("my size" . (cons (* 100 mm) (* 300 mm))) 
paper-alist))

\header { tagline = ##f }
\paper {
  #(set-paper-size "my size")
  #(define bottom-margin (* 0 cm))
  #(define left-margin (* 0 mm))
  #(define after-title-space (* 0 cm))
  #(define right-margin (* 0 cm))
  #(define top-margin (* 0 cm))
  #(define line-width (* 100 mm ))
}
\score{
  \relative c' { c4 d e2 | f4 g e2 | }
  \layout {
indent = #0
ragged-right = ##f
ragged-last = ##f
  }
}