RE: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread John Schlomann
Ah, thank you much.
John

> -Original Message-
> From: Thomas Morley [mailto:thomasmorle...@gmail.com]
> Sent: Saturday, October 17, 2020 3:14 PM
> To: John Schlomann
> Cc: David Kastrup; Jean Abou Samra; Matthew Fong; lilypond-user
> Subject: Re: Scheme help request: How can else of an if-statement be made
> to do nothing?
> 
> Am Sa., 17. Okt. 2020 um 22:09 Uhr schrieb John Schlomann
> :
> >
> > Harm,
> >
> > You used a function or macro called add-text. I can't seem to find it in any
> LilyPond or Guile manual. What is that?
> >
> > John
> 
> Hi John,
> 
> you'll find it in lily-library.scm
> 
> Cheers,
>   Harm




Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Matthew Fong
Thanks for the pointer, Harm.

Matt

On Sat, Oct 17, 2020 at 13:14 Thomas Morley 
wrote:

> Am Sa., 17. Okt. 2020 um 22:09 Uhr schrieb John Schlomann
> :
> >
> > Harm,
> >
> > You used a function or macro called add-text. I can't seem to find it in
> any LilyPond or Guile manual. What is that?
> >
> > John
>
> Hi John,
>
> you'll find it in lily-library.scm
>
> Cheers,
>   Harm
>


Re: Removing bar connecting grouped staves

2020-10-17 Thread Carl Sorensen
That is called a SpanBar.  BarLine only exists within a staff.  See the bottom 
of this section of the Notation Reference: 
https://lilypond.org/doc/v2.19/Documentation/notation/bars#bar-lines

Following the links to SpanBar, and then to span_bar_engraver, you will learn 
that the span_bar_engraver is in the StaffGroup context.

So what we need to do is omit the StaffGroup.SpanBar.

\version "2.19.82"
\score {
 <<
 \new Staff {c'4 d' e' f'}
 \new Staff {c'4. d'4. e'4}
 \new Staff {c'2 d'2}
 >>
 \layout{
 \omit StaffGroup.SpanBar
 }
}

HTH,

Carl


  

On 10/17/20, 2:45 PM, "lilypond-user on behalf of Gilberto Agostinho" 
 wrote:

Hi everyone,

I am trying to create a diagram using Lilypond and I would like to 
remove the vertical bar connecting a series of grouped staves. This is 
the bar that is in the left hand side of a score and runs through all 
staves, and where instrument names are normally written. Would it be 
possible to hide it somehow?

Below is a minimal example:

\version "2.19.82"
\score {
 <<
 \new Staff {c'4 d' e' f'}
 \new Staff {c'4. d'4. e'4}
 \new Staff {c'2 d'2}
 >>
 \layout{
 \omit Score.BarLine
 }
}

https://i.postimg.cc/W3krqyTF/line.png

The diagram I am creating has a complex rhythm and I am using a group of 
staves so that the rhythm of each line matches the one above, which is 
why I am trying to use this trick of grouping them and then hiding the 
connecting bar.

Many thanks,
Gilberto




Re: Removing bar connecting grouped staves

2020-10-17 Thread Pierre Perol-Schneider
Hi Gilberto,
Try:
\version "2.19.82"
\score {
 <<
 \new Staff {c'4 d' e' f'}
 \new Staff {c'4. d'4. e'4}
 \new Staff {c'2 d'2}
 >>
 \layout{
 \omit Score.BarLine
 \omit Score.SystemStartBar
 }
}

Cheers,
Pierre

Le sam. 17 oct. 2020 à 22:45, Gilberto Agostinho <
gilbertohasn...@googlemail.com> a écrit :

> Hi everyone,
>
> I am trying to create a diagram using Lilypond and I would like to
> remove the vertical bar connecting a series of grouped staves. This is
> the bar that is in the left hand side of a score and runs through all
> staves, and where instrument names are normally written. Would it be
> possible to hide it somehow?
>
> Below is a minimal example:
>
> \version "2.19.82"
> \score {
>  <<
>  \new Staff {c'4 d' e' f'}
>  \new Staff {c'4. d'4. e'4}
>  \new Staff {c'2 d'2}
>  >>
>  \layout{
>  \omit Score.BarLine
>  }
> }
>
> https://i.postimg.cc/W3krqyTF/line.png
>
> The diagram I am creating has a complex rhythm and I am using a group of
> staves so that the rhythm of each line matches the one above, which is
> why I am trying to use this trick of grouping them and then hiding the
> connecting bar.
>
> Many thanks,
> Gilberto
>
>


Re: Removing bar connecting grouped staves

2020-10-17 Thread Aaron Hill

On 2020-10-17 12:53 pm, Gilberto Agostinho wrote:

Hi everyone,

I am trying to create a diagram using Lilypond and I would like to
remove the vertical bar connecting a series of grouped staves. This is
the bar that is in the left hand side of a score and runs through all
staves, and where instrument names are normally written. Would it be
possible to hide it somehow?

Below is a minimal example:

\version "2.19.82"
\score {
    <<
    \new Staff {c'4 d' e' f'}
    \new Staff {c'4. d'4. e'4}
    \new Staff {c'2 d'2}
    >>
    \layout{
    \omit Score.BarLine
    }
}

https://i.postimg.cc/W3krqyTF/line.png

The diagram I am creating has a complex rhythm and I am using a group
of staves so that the rhythm of each line matches the one above, which
is why I am trying to use this trick of grouping them and then hiding
the connecting bar.


That's the SystemStartBar.


\layout {
  \context {
\Score
\omit SystemStartBar
  }
}



-- Aaron Hill



Removing bar connecting grouped staves

2020-10-17 Thread Gilberto Agostinho

Hi everyone,

I am trying to create a diagram using Lilypond and I would like to 
remove the vertical bar connecting a series of grouped staves. This is 
the bar that is in the left hand side of a score and runs through all 
staves, and where instrument names are normally written. Would it be 
possible to hide it somehow?


Below is a minimal example:

\version "2.19.82"
\score {
    <<
    \new Staff {c'4 d' e' f'}
    \new Staff {c'4. d'4. e'4}
    \new Staff {c'2 d'2}
    >>
    \layout{
    \omit Score.BarLine
    }
}

https://i.postimg.cc/W3krqyTF/line.png

The diagram I am creating has a complex rhythm and I am using a group of 
staves so that the rhythm of each line matches the one above, which is 
why I am trying to use this trick of grouping them and then hiding the 
connecting bar.


Many thanks,
Gilberto



Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Thomas Morley
Am Sa., 17. Okt. 2020 um 22:09 Uhr schrieb John Schlomann
:
>
> Harm,
>
> You used a function or macro called add-text. I can't seem to find it in any 
> LilyPond or Guile manual. What is that?
>
> John

Hi John,

you'll find it in lily-library.scm

Cheers,
  Harm



RE: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread John Schlomann
Harm,

You used a function or macro called add-text. I can't seem to find it in any 
LilyPond or Guile manual. What is that?

John

> -Original Message-
> From: lilypond-user [mailto:lilypond-user-
> bounces+jschlomann=wideopenwest@gnu.org] On Behalf Of Thomas
> Morley
> Sent: Saturday, October 17, 2020 2:24 PM
> To: David Kastrup
> Cc: Jean Abou Samra; Matthew Fong; lilypond-user
> Subject: Re: Scheme help request: How can else of an if-statement be made
> to do nothing?
> 
> Am Sa., 17. Okt. 2020 um 20:33 Uhr schrieb David Kastrup :
> >
> > Thomas Morley  writes:
> >
> > > Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra
> :
> > >>
> > >> The point of interpret-markup is to turn a markup into a stencil, so I'd
> > >> use empty-stencil:
> > >>
> > >> \version "2.20.0"
> > >>
> > >> #(define-markup-command (print-if-defined layout props sym text)
> > >>  (symbol? markup?)
> > >>(if (defined? sym)
> > >>(interpret-markup layout props
> > >>  #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
> > >>empty-stencil))
> > >>
> > >> symA = "Something"
> > >>
> > >> \markup {
> > >>\print-if-defined #'symA "Text"
> > >>\print-if-defined #'symB "More text"
> > >> }
> > >>
> > >
> > > An empty stencil will still be spaced (unless removed by other
> > > markup-commands).
> >
> > empty-stencil will typically not trigger additional spacing.  That's
> > typically what distinguishes it from point-stencil .
> >
> > --
> > David Kastrup
> 
> Well, I'd say it depends how that empty-stencil is consumed. See:
> 
> \markup
>   \box
>   { \stencil #point-stencil \stencil #empty-stencil \stencil #point-stencil }
> 
> Here I did something silly (of course there are warnings emitted) and
> the output _is_ affected.
> 
> Thus, the detailed use-case is important...
> 
> Cheers,
>   Harm





Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Thomas Morley
Am Sa., 17. Okt. 2020 um 20:33 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra 
> > :
> >>
> >> The point of interpret-markup is to turn a markup into a stencil, so I'd
> >> use empty-stencil:
> >>
> >> \version "2.20.0"
> >>
> >> #(define-markup-command (print-if-defined layout props sym text)
> >>  (symbol? markup?)
> >>(if (defined? sym)
> >>(interpret-markup layout props
> >>  #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
> >>empty-stencil))
> >>
> >> symA = "Something"
> >>
> >> \markup {
> >>\print-if-defined #'symA "Text"
> >>\print-if-defined #'symB "More text"
> >> }
> >>
> >
> > An empty stencil will still be spaced (unless removed by other
> > markup-commands).
>
> empty-stencil will typically not trigger additional spacing.  That's
> typically what distinguishes it from point-stencil .
>
> --
> David Kastrup

Well, I'd say it depends how that empty-stencil is consumed. See:

\markup
  \box
  { \stencil #point-stencil \stencil #empty-stencil \stencil #point-stencil }

Here I did something silly (of course there are warnings emitted) and
the output _is_ affected.

Thus, the detailed use-case is important...

Cheers,
  Harm



Re: Measure Number Collision

2020-10-17 Thread Xavier Scheuer
On Sat, 17 Oct 2020 at 18:29, Marc Shepherd  wrote:
>
> Kieren's example does indeed work with LP 2.21.2. However, the
distribution for 2.21.2 seems to "break" a number of other functions; for
instance, \fermataMarkup no longer works.
>
> Anyhow, I am still in the market for a better way to do this, but for the
time being will just turn off bar numbers selectively whenever a rehearsal
mark appears at the start of a system.
>
> I did a search of the archives, and I see this has been a much discussed
topic over the years!

Hello,

When using a newer version of LilyPond use convert-ly to update your files.
http://lilypond.org/doc/v2.21/Documentation/usage/updating-files-with-convert_002dly.html

Cheers,
Xavier

-- 
Xavier Scheuer 


Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread David Kastrup
Thomas Morley  writes:

> Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra 
> :
>>
>> The point of interpret-markup is to turn a markup into a stencil, so I'd
>> use empty-stencil:
>>
>> \version "2.20.0"
>>
>> #(define-markup-command (print-if-defined layout props sym text)
>>  (symbol? markup?)
>>(if (defined? sym)
>>(interpret-markup layout props
>>  #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
>>empty-stencil))
>>
>> symA = "Something"
>>
>> \markup {
>>\print-if-defined #'symA "Text"
>>\print-if-defined #'symB "More text"
>> }
>>
>
> An empty stencil will still be spaced (unless removed by other
> markup-commands).

empty-stencil will typically not trigger additional spacing.  That's
typically what distinguishes it from point-stencil .

-- 
David Kastrup



Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Matthew Fong
Hello Jean and Thomas,

Thank you -- both solutions are insightful and useful in future solutions.

I did not know about empty stencils, and I read about a void-function
earlier, but was not entirely sure how to utilize it.


Many thanks,
mattfong

On Sat, Oct 17, 2020 at 10:49 AM Thomas Morley 
wrote:

> Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra <
> j...@abou-samra.fr>:
> >
> > Hi,
> >
> > Le 17/10/2020 à 19:27, Matthew Fong a écrit :
> >
> > > Hello Richard,
> > >
> > > I just discovered your explanation is in fact the case, and also
> > > concluded cond wouldn't work either.
> > >
> > > I might have to settle for an empty markup block for now.
> >
> > The point of interpret-markup is to turn a markup into a stencil, so I'd
> > use empty-stencil:
> >
> > \version "2.20.0"
> >
> > #(define-markup-command (print-if-defined layout props sym text)
> >  (symbol? markup?)
> >(if (defined? sym)
> >(interpret-markup layout props
> >  #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
> >empty-stencil))
> >
> > symA = "Something"
> >
> > \markup {
> >\print-if-defined #'symA "Text"
> >\print-if-defined #'symB "More text"
> > }
> >
> > Best,
> > Jean
> >
> >
>
> An empty stencil will still be spaced (unless removed by other
> markup-commands).
> Why not a void-function?
>
> print-if-defined =
> #(define-void-function (sym text) (symbol? markup?)
>   (if (defined? sym)
>   (add-text #{ \markup \with-color #'(0.8 0.2 0.2) #text #})))
>
> symA = "Something"
>
> \print-if-defined #'symB "Text"
> \print-if-defined #'symA "Text"
>
> Cheers,
>   Harm
>


Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Thomas Morley
Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra :
>
> Hi,
>
> Le 17/10/2020 à 19:27, Matthew Fong a écrit :
>
> > Hello Richard,
> >
> > I just discovered your explanation is in fact the case, and also
> > concluded cond wouldn't work either.
> >
> > I might have to settle for an empty markup block for now.
>
> The point of interpret-markup is to turn a markup into a stencil, so I'd
> use empty-stencil:
>
> \version "2.20.0"
>
> #(define-markup-command (print-if-defined layout props sym text)
>  (symbol? markup?)
>(if (defined? sym)
>(interpret-markup layout props
>  #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
>empty-stencil))
>
> symA = "Something"
>
> \markup {
>\print-if-defined #'symA "Text"
>\print-if-defined #'symB "More text"
> }
>
> Best,
> Jean
>
>

An empty stencil will still be spaced (unless removed by other markup-commands).
Why not a void-function?

print-if-defined =
#(define-void-function (sym text) (symbol? markup?)
  (if (defined? sym)
  (add-text #{ \markup \with-color #'(0.8 0.2 0.2) #text #})))

symA = "Something"

\print-if-defined #'symB "Text"
\print-if-defined #'symA "Text"

Cheers,
  Harm



Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Jean Abou Samra

Hi,

Le 17/10/2020 à 19:27, Matthew Fong a écrit :


Hello Richard,

I just discovered your explanation is in fact the case, and also 
concluded cond wouldn't work either.


I might have to settle for an empty markup block for now.


The point of interpret-markup is to turn a markup into a stencil, so I'd 
use empty-stencil:


\version "2.20.0"

#(define-markup-command (print-if-defined layout props sym text)
    (symbol? markup?)
  (if (defined? sym)
      (interpret-markup layout props
        #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
  empty-stencil))

symA = "Something"

\markup {
  \print-if-defined #'symA "Text"
  \print-if-defined #'symB "More text"
}

Best,
Jean




Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Matthew Fong
Hello Richard,

I just discovered your explanation is in fact the case, and also concluded
cond wouldn't work either.

I might have to settle for an empty markup block for now.


Many thanks,
mattfong

On Sat, Oct 17, 2020 at 9:55 AM Richard Shann 
wrote:

> On Sat, 2020-10-17 at 09:34 -0700, Matthew Fong wrote:
> > Hello everyone,
> >
> > No less than 10 minutes after, I discovered I skipped the section on
> > cond. That solves everything!
>
> I think you are missing something here: the if macro in Scheme does not
> require an else expression
>
> (if a b)
>
> is fine, b will be evaluated if a is not #f
>
> your real problem is that the invocation of the procedure PrintDefined
> will still evaluate to something even when you "do nothing" in the case
> where the else expression would be evaluated. Your \markup will barf if
> the invocation of \PrintDefined evaluates to something that \markup is
> not expecting.
>
> Richard
>
>
> >
> >
> > Many thanks,
> > mattfong
> >
> > On Sat, Oct 17, 2020 at 9:27 AM Matthew Fong 
> > wrote:
> > > Hello everyone,
> > >
> > > I've been digging into guile/scheme and LilyPond, and it doesn't
> > > appear that else-statements can be empty. Any pointers would be
> > > appreciated in advance.
> > >
> > > For the example below, I would prefer the else-statement here to do
> > > nothing, rather than print an empty markup: \markup { "" }, as
> > > doing so creates a small, but observable change in vertical
> > > spacing.
> > >
> > > % Print markup if a symbol is defined
> > > #(define-markup-command (PrintIfDefined layout props sym text)
> > > (symbol? markup?)
> > > (if (defined? sym)
> > > ;; Do this if true
> > > (interpret-markup layout props
> > > #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
> > >
> > > ;; How do I do nothing here? (empty statement preferred)
> > > (interpret-markup layout props
> > > #{ \markup "" #})
> > > )
> > > )
> > >
> > > printInfo = 1
> > > \markup \PrintIfDefined #'printInfo "Print this if symbol printInfo
> > > is defined"
> > >
> > >
> > > Many thanks,
> > > mattfong
> > >
> > >
>


Re: Measure Number Collision

2020-10-17 Thread Jean Abou Samra

Le 17/10/2020 à 18:28, Marc Shepherd a écrit :

Kieren's example does indeed work with LP 2.21.2. However, the 
distribution for 2.21.2 seems to "break" a number of other functions; 
for instance, \fermataMarkup no longer works.



Use \fermata.

http://lilypond.org/doc/v2.21/Documentation/changes/index.fr.html

Jean





Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Richard Shann
On Sat, 2020-10-17 at 09:34 -0700, Matthew Fong wrote:
> Hello everyone,
> 
> No less than 10 minutes after, I discovered I skipped the section on
> cond. That solves everything!

I think you are missing something here: the if macro in Scheme does not
require an else expression

(if a b)

is fine, b will be evaluated if a is not #f 

your real problem is that the invocation of the procedure PrintDefined
will still evaluate to something even when you "do nothing" in the case
where the else expression would be evaluated. Your \markup will barf if
the invocation of \PrintDefined evaluates to something that \markup is
not expecting.

Richard


> 
> 
> Many thanks,
> mattfong
> 
> On Sat, Oct 17, 2020 at 9:27 AM Matthew Fong 
> wrote:
> > Hello everyone,
> > 
> > I've been digging into guile/scheme and LilyPond, and it doesn't
> > appear that else-statements can be empty. Any pointers would be
> > appreciated in advance.
> > 
> > For the example below, I would prefer the else-statement here to do
> > nothing, rather than print an empty markup: \markup { "" }, as
> > doing so creates a small, but observable change in vertical
> > spacing.
> > 
> > % Print markup if a symbol is defined
> > #(define-markup-command (PrintIfDefined layout props sym text)
> > (symbol? markup?)
> >     (if (defined? sym)
> >         ;; Do this if true
> >         (interpret-markup layout props
> >             #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
> > 
> >     ;; How do I do nothing here? (empty statement preferred)
> >     (interpret-markup layout props
> >         #{ \markup "" #})
> > )
> > )
> > 
> > printInfo = 1
> > \markup \PrintIfDefined #'printInfo "Print this if symbol printInfo
> > is defined"
> > 
> > 
> > Many thanks,
> > mattfong
> > 
> > 



Re: Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Matthew Fong
Hello everyone,

No less than 10 minutes after, I discovered I skipped the section on cond.
That solves everything!


Many thanks,
mattfong

On Sat, Oct 17, 2020 at 9:27 AM Matthew Fong  wrote:

> Hello everyone,
>
> I've been digging into guile/scheme and LilyPond, and it doesn't appear
> that else-statements can be empty. Any pointers would be appreciated in
> advance.
>
> For the example below, I would prefer the else-statement here to do
> nothing, rather than print an empty markup: \markup { "" }, as doing so
> creates a small, but observable change in vertical spacing.
>
> % Print markup if a symbol is defined
> #(define-markup-command (PrintIfDefined layout props sym text) (symbol?
> markup?)
> (if (defined? sym)
> ;; Do this if true
> (interpret-markup layout props
> #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
>;; How do I do nothing here? (empty statement preferred)
>(interpret-markup layout props
>#{ \markup "" #})
> )
> )
>
> printInfo = 1
> \markup \PrintIfDefined #'printInfo "Print this if symbol printInfo is
> defined"
>
>
> Many thanks,
> mattfong
>
>


Re: Measure Number Collision

2020-10-17 Thread Marc Shepherd
Kieren's example does indeed work with LP 2.21.2. However, the distribution
for 2.21.2 seems to "break" a number of other functions; for instance,
\fermataMarkup no longer works.

Anyhow, I am still in the market for a better way to do this, but for the
time being will just turn off bar numbers selectively whenever a rehearsal
mark appears at the start of a system.

I did a search of the archives, and I see this has been a much discussed
topic over the years!

On Sat, Oct 17, 2020 at 11:02 AM Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Marc,
>
> > In your example, the rehearsal letters printed twice at the top of the
> winds group. I don't know if it matters that I am on version 2.20
>
> It may.
>
> > Also, if I am reading the code correctly, in a passage where only the
> brass and strings play, no marks would print on that system. The example
> assumes that winds will always be present. That is why I had a MarkLine at
> the top of the score outside of any group.
>
> IIRC, there is a way to avoid that… it involves keep-alive-together, etc.
> I just haven’t had time (or need, recently) to research it myself. No doubt
> someone else can help you with it!
>
> Cheers,
> Kieren.
> 
>
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: kie...@kierenmacmillan.info
>
>

-- 
Marc Shepherd


Scheme help request: How can else of an if-statement be made to do nothing?

2020-10-17 Thread Matthew Fong
Hello everyone,

I've been digging into guile/scheme and LilyPond, and it doesn't appear
that else-statements can be empty. Any pointers would be appreciated in
advance.

For the example below, I would prefer the else-statement here to do
nothing, rather than print an empty markup: \markup { "" }, as doing so
creates a small, but observable change in vertical spacing.

% Print markup if a symbol is defined
#(define-markup-command (PrintIfDefined layout props sym text) (symbol?
markup?)
(if (defined? sym)
;; Do this if true
(interpret-markup layout props
#{ \markup \with-color #'(0.8 0.2 0.2) #text #})
   ;; How do I do nothing here? (empty statement preferred)
   (interpret-markup layout props
   #{ \markup "" #})
)
)

printInfo = 1
\markup \PrintIfDefined #'printInfo "Print this if symbol printInfo is
defined"


Many thanks,
mattfong


Re: headers, and what include doesn't do

2020-10-17 Thread David Wright
On Sat 17 Oct 2020 at 10:27:10 (+0200), Xavier Scheuer wrote:
> On Sat, 17 Oct 2020 at 09:49, Jean Abou Samra  wrote:
> >
> > [...]
> >
> > I have learnt this restriction during my very beginnings in LilyPond -- I
> was
> > using 2.18.0 at the time. Since then I never realized it was gone as I
> always
> > followed the practice of putting \header after the music.
> >
> > I'll prepare a patch to update NR examples to use \header before the
> music as
> > I think this looks much more logical.
> 
> Thank you Jean, I was not aware either, that it is now (actually since many
> years now!) possible to use \header before music within \score.
> This is great and makes more sense (corresponds to user expectation). It
> would be nice to update the documentation indeed.
> 
> And thank you David K for implementing this (in addition to all the other
> things you have done and are doing for LilyPond).

Seconded.

I discovered the ordering that worked for me when I was still
floundering with LP back in 2007 (version 2.2.6), by looking at
the LP [sic] manual for 2.8 that was already released.¹ Looking
back at my oldest 2007 sources, I see I had settled on:

\score {
\notes <<
\context ChoirStaff <<
…
>>
>>
\midi { … }
\paper { … ²
}
\header {
}
}

I think the placement warning has been rewritten out of NR since
2.19.83 (page 471), but remains in Usage 2.21.1 (page 22), which
it possibly should as it still presumably applies to conversions
of such ancient versions as 2.8.

But that raises the question: are there syntax changes that have
been made since 2.8 that are dramatic enough to require manual
conversion, or has convert-ly been improved sufficiently enough
so as not to require any warnings added to Usage §2.5?

¹ Debian, like many distributions, has always lagged behind with
  its stable/buster offering (now 2.18.2). We recently had posts
  from a user with 2.16 running on Mint's rebecca.

² I hadn't yet settled on a satisfactory division of labour between
  \paper / \layout, and top-level / score-level.

Cheers,
David.



Re: Measure Number Collision

2020-10-17 Thread Kieren MacMillan
Hi Marc,

> In your example, the rehearsal letters printed twice at the top of the winds 
> group. I don't know if it matters that I am on version 2.20

It may.

> Also, if I am reading the code correctly, in a passage where only the brass 
> and strings play, no marks would print on that system. The example assumes 
> that winds will always be present. That is why I had a MarkLine at the top of 
> the score outside of any group.

IIRC, there is a way to avoid that… it involves keep-alive-together, etc. I 
just haven’t had time (or need, recently) to research it myself. No doubt 
someone else can help you with it!

Cheers,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




Re: Measure Number Collision

2020-10-17 Thread Phil Holmes

If you want to try 2.21.2 (as opposed to 2.21.7) see 
https://lilypond.org/download/binaries/mingw/ for which Windows releases (for 
example) are available for download.

On 17/10/2020 15:46, Marc Shepherd wrote:

Hi Kieren,

In your example, the rehearsal letters printed twice at the top of the winds 
group. I don't know if it matters that I am on version 2.20, whereas you 
specified 2.21.2, which is not publicly available from the LP website.

Also, if I am reading the code correctly, in a passage where only the brass and 
strings play, no marks would print on that system. The example assumes that 
winds will always be present. That is why I had a MarkLine at the top of the 
score outside of any group.

Thanks
Marc

On Sat, Oct 17, 2020 at 9:53 AM Kieren MacMillan mailto:kieren_macmil...@sympatico.ca>> wrote:

Hi Marc,

> What I want is to print the MarkLine twice, once above Violin I, and once 
at the top of each system.

In recent versions, you can just add the engravers to the appropriate 
StaffGroup contexts (see below). Does that solve your problem?

Cheers,
Kieren.


\version "2.21.2"

\layout {
  \context {
    \Score
    \override StaffGroup.SystemStartBracket.collapse-height = #4
    \remove Mark_engraver
    \remove Metronome_mark_engraver
  }
}

global = {
  \mark \default
  \key f \major
  \time 4/4
  s1*7
  \mark \default
  s1*7
}

fakemusic = {
  \relative c' { \repeat unfold 56 { c4 } }
}

\score {
  <<
    \new StaffGroup = "winds"
    \with { \consists Mark_engraver \consists Metronome_mark_engraver }
      <<
        \new Staff << \global \fakemusic >>
        \new Staff << \global \fakemusic >>
      >>
    \new StaffGroup = "brass"
      <<
        \new Staff << \global \fakemusic >>
        \new Staff << \global \fakemusic >>
        \new Staff << \global \fakemusic >>
      >>
    \new StaffGroup = "strings"
    \with { \consists Mark_engraver \consists Metronome_mark_engraver }
      <<
        \new Staff << \global \fakemusic >>
        \new Staff << \global \fakemusic >>
      >>
  >>
}



Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info 
‣ email: kie...@kierenmacmillan.info 



--
Marc Shepherd


--
Phil Holmes



Re: Measure Number Collision

2020-10-17 Thread Marc Shepherd
Hi Kieren,

In your example, the rehearsal letters printed twice at the top of the
winds group. I don't know if it matters that I am on version 2.20, whereas
you specified 2.21.2, which is not publicly available from the LP website.

Also, if I am reading the code correctly, in a passage where only the brass
and strings play, no marks would print on that system. The example assumes
that winds will always be present. That is why I had a MarkLine at the top
of the score outside of any group.

Thanks
Marc

On Sat, Oct 17, 2020 at 9:53 AM Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Marc,
>
> > What I want is to print the MarkLine twice, once above Violin I, and
> once at the top of each system.
>
> In recent versions, you can just add the engravers to the appropriate
> StaffGroup contexts (see below). Does that solve your problem?
>
> Cheers,
> Kieren.
>
> 
> \version "2.21.2"
>
> \layout {
>   \context {
> \Score
> \override StaffGroup.SystemStartBracket.collapse-height = #4
> \remove Mark_engraver
> \remove Metronome_mark_engraver
>   }
> }
>
> global = {
>   \mark \default
>   \key f \major
>   \time 4/4
>   s1*7
>   \mark \default
>   s1*7
> }
>
> fakemusic = {
>   \relative c' { \repeat unfold 56 { c4 } }
> }
>
> \score {
>   <<
> \new StaffGroup = "winds"
> \with { \consists Mark_engraver \consists Metronome_mark_engraver }
>   <<
> \new Staff << \global \fakemusic >>
> \new Staff << \global \fakemusic >>
>   >>
> \new StaffGroup = "brass"
>   <<
> \new Staff << \global \fakemusic >>
> \new Staff << \global \fakemusic >>
> \new Staff << \global \fakemusic >>
>   >>
> \new StaffGroup = "strings"
> \with { \consists Mark_engraver \consists Metronome_mark_engraver }
>   <<
> \new Staff << \global \fakemusic >>
> \new Staff << \global \fakemusic >>
>   >>
>   >>
> }
> 
> 
>
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: kie...@kierenmacmillan.info
>
>

-- 
Marc Shepherd


Re: Measure Number Collision

2020-10-17 Thread Kieren MacMillan
Hi Marc,

> What I want is to print the MarkLine twice, once above Violin I, and once at 
> the top of each system.

In recent versions, you can just add the engravers to the appropriate 
StaffGroup contexts (see below). Does that solve your problem?

Cheers,
Kieren.


\version "2.21.2"

\layout {
  \context {
\Score
\override StaffGroup.SystemStartBracket.collapse-height = #4
\remove Mark_engraver
\remove Metronome_mark_engraver
  }
}

global = {
  \mark \default
  \key f \major
  \time 4/4
  s1*7
  \mark \default
  s1*7
}

fakemusic = {
  \relative c' { \repeat unfold 56 { c4 } }
}

\score {
  <<
\new StaffGroup = "winds"
\with { \consists Mark_engraver \consists Metronome_mark_engraver }
  <<
\new Staff << \global \fakemusic >>
\new Staff << \global \fakemusic >>
  >>
\new StaffGroup = "brass"
  <<
\new Staff << \global \fakemusic >>
\new Staff << \global \fakemusic >>
\new Staff << \global \fakemusic >>
  >>
\new StaffGroup = "strings"
\with { \consists Mark_engraver \consists Metronome_mark_engraver }
  <<
\new Staff << \global \fakemusic >>
\new Staff << \global \fakemusic >>
  >>
  >>
}



Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




Re: Measure Number Collision

2020-10-17 Thread Marc Shepherd
As I am a very new LP user, I copied the code from various snippets. What I
want is to print the MarkLine twice, once above Violin I, and once at the
top of each system. The actual top staff will not always be the same from
one system to the next, because not all instruments are playing all the
time.

In the snippet that I provided, if I comment out the spacing override while
leaving everything else the same, the rehearsal mark and bar number are way
too high, as shown below.

[image: Collision.PNG]

On Fri, Oct 16, 2020 at 7:13 PM Carl Sorensen 
wrote:

>
>
> On Fri, Oct 16, 2020 at 4:28 PM Marc Shepherd  wrote:
>
>> Here is a minimal example showing this behavior:
>>
>> \version "2.20.0"
>>
>> \layout {
>>   \context {
>> \name MarkLine
>> \type Engraver_group
>> \consists Output_property_engraver
>> \consists Axis_group_engraver
>> \consists Mark_engraver
>> \consists Metronome_mark_engraver
>> \override VerticalAxisGroup.staff-staff-spacing =
>> #'((basic-distance . 1)
>>(minimum-distance . 1)
>>(padding . 1)
>>(stretchability . 3))
>>   }
>>   \context {
>> \Score
>> \remove Mark_engraver
>> \remove Metronome_mark_engraver
>> \accepts MarkLine
>>   }
>> }
>>
>> \score {
>>   <<
>>   \new MarkLine { \time 4/4
>> s1*7
>> \mark \default
>> s1*7
>>   }
>>   \new StaffGroup {
>> <<
>> \override StaffGroup.SystemStartBracket.collapse-height = #4
>> \new Staff {
>>   \key f \major \relative c' {
>> \repeat unfold 56 { c4 }
>>   }
>> }
>> >>
>>   }
>>   >>
>> }
>>
>> [image: Collision.PNG]
>>
>>
> The BarNumber is not spaced relative to the StaffGroup any more.  It is
> spaced relative to the MarkLine context (you can see this by commenting out
> your VerticalAxisGroup.staff-staff-spacing override).
> The MarkLine context is spaced relative to the Staff (as can be seen by
> the override you use).  The System Start Bracket belongs to the StaffGroup,
> not the Staff, so I believe it's not part of the collision resolution for
> the staff-staff-spacing.
>
> There is clearly a problem with a collision here, but you've done enough
> altering contexts that I'm not sure it's a LilyPond error rather than a
> user error.  I don't fully grasp how the MarkLine context works in your
> example.  You are using it somewhat differently than it was proposed on the
> list (where it was proposed to be between staffs, where bar numbers don't
> live).  I'm sorry, but I can't figure out how to fix this.
>
> Carl
>
>

-- 
Marc Shepherd


Re: Measure Number Collision

2020-10-17 Thread Marc Shepherd
This is an orchestral score, where the convention is to print tempo and
rehearsal marks twice, at the top of the system and above the first violin
staff. In the LP documentation, the recommended way to do this is to create
a separate context called “MarkLine” for rehearsal and tempo marks.

So that is the reason for removing Mark_engraver and
Metronome_mark_engraver from the Score context, and putting them in a
different context. Obviously that is not needed for this tiny example, but
I stripped out a lot of material to create a very minimal score exhibiting
the behavior.

On Fri, Oct 16, 2020 at 7:09 PM Thomas Morley 
wrote:

>
>
> Am Sa., 17. Okt. 2020 um 00:28 Uhr schrieb Marc Shepherd <
> oakapp...@gmail.com>:
>
>> Here is a minimal example showing this behavior:
>>
>> \version "2.20.0"
>>
>> \layout {
>>   \context {
>> \name MarkLine
>> \type Engraver_group
>> \consists Output_property_engraver
>> \consists Axis_group_engraver
>> \consists Mark_engraver
>> \consists Metronome_mark_engraver
>> \override VerticalAxisGroup.staff-staff-spacing =
>> #'((basic-distance . 1)
>>(minimum-distance . 1)
>>(padding . 1)
>>(stretchability . 3))
>>   }
>>   \context {
>> \Score
>> \remove Mark_engraver
>> \remove Metronome_mark_engraver
>> \accepts MarkLine
>>   }
>> }
>>
>> \score {
>>   <<
>>   \new MarkLine { \time 4/4
>> s1*7
>> \mark \default
>> s1*7
>>   }
>>   \new StaffGroup {
>> <<
>> \override StaffGroup.SystemStartBracket.collapse-height = #4
>> \new Staff {
>>   \key f \major \relative c' {
>> \repeat unfold 56 { c4 }
>>   }
>> }
>> >>
>>   }
>>   >>
>> }
>>
>> [image: Collision.PNG]
>>
>> On Fri, Oct 16, 2020 at 3:58 PM Xavier Scheuer 
>> wrote:
>>
>>> On Fri, 16 Oct 2020 at 20:55, Marc Shepherd  wrote:
>>> >
>>> > In the example shown below, lilypond is shifting the measure number
>>> (85) down, because it thinks there is a collision with the rehearsal letter
>>> "C". But in fact there is no collision: the 85 would be just fine in its
>>> normal position. This occurs only where a rehearsal letter coincides with
>>> the first bar of a system.
>>> >
>>> > Is there a setting that tells lilypond, "Please ignore any supposed
>>> collision, and put the measure number where it would ordinarily go"?
>>>
>>> Hi Marc,
>>>
>>> Could you provide a minimal example of code showing this behavior?
>>> Or at least provide the version number you are using?
>>>
>>> I guess it should give better results with versions later (or equal to)
>>> 2.21.0, where issue 5621 has been fixed.
>>> https://gitlab.com/lilypond/lilypond/-/issues/5621
>>>
>>> Otherwise I consider this collision between bar number and bracket a new
>>> bug (to be reported).
>>>
>>> Cheers,
>>> Xavier
>>>
>>> --
>>> Xavier Scheuer 
>>>
>>>
>>
>> --
>> Marc Shepherd
>>
>
> Hi Marc,
>
> why do you move Mark_engraver and Metronome_mark_engraver?
> Don't do so and all's fine.
>
> Cheers,
>   Harm
>


-- 
Marc Shepherd


Re: headers, and what include doesn't do

2020-10-17 Thread Xavier Scheuer
On Sat, 17 Oct 2020 at 09:49, Jean Abou Samra  wrote:
>
> [...]
>
> I have learnt this restriction during my very beginnings in LilyPond -- I
was
> using 2.18.0 at the time. Since then I never realized it was gone as I
always
> followed the practice of putting \header after the music.
>
> I'll prepare a patch to update NR examples to use \header before the
music as
> I think this looks much more logical.

Thank you Jean, I was not aware either, that it is now (actually since many
years now!) possible to use \header before music within \score.
This is great and makes more sense (corresponds to user expectation). It
would be nice to update the documentation indeed.

And thank you David K for implementing this (in addition to all the other
things you have done and are doing for LilyPond).

Cheers,
Xavier

-- 
Xavier Scheuer 


Re: headers, and what include doesn't do

2020-10-17 Thread Jean Abou Samra

Um, then why does this work?


\version "2.18.2"

\score {
   \header { piece = asdf }
   { \time 3/4 a'2 b'4 \bar "|." }
}



-- Aaron Hill

D'oh!

This doesn't work if you try 2.18.0 (“unexpected \header”). It does work 
in 2.18.1 and onwards, thanks to


commit d5aee802bf252155f4c31ef8ae6bc0cb979ccf20
Author: David Kastrup 
Date:   Sat Dec 14 20:59:30 2013 +0100

    Issue 3727: Allow header blocks and output definitions in \score to 
precede music


    This addresses a frequent complaint of users.

I have learnt this restriction during my very beginnings in LilyPond -- 
I was
using 2.18.0 at the time. Since then I never realized it was gone as I 
always

followed the practice of putting \header after the music.

I'll prepare a patch to update NR examples to use \header before the 
music as

I think this looks much more logical.

Thanks!
Jean



Re: headers, and what include doesn't do

2020-10-17 Thread Jean Abou Samra

Hi David,

Le 17/10/2020 à 05:45, David Wright a écrit :

On Fri 16 Oct 2020 at 15:50:55 (+0200), Jean Abou Samra wrote:

The reason for that is that \version, like \include, has nothing to do
with LP's functionality. \version is just a syntax property of the
file containing it. Used sensibly, it allows convert-ly to convert a
collection of files of different syntax vintages automatically,
without your having to specify the vintage of each file in the command
line. (It just reads the \version contained in each file.)

Yes, LP warns about the top-level file not containing a \version,
and generates an error message (and sets a return code) whenever
it meets a version number greater than its own. But so long as the
actual syntax encountered does not violate its own version, LP's
processing is unaffected, which is the point I'm trying to make.


I checked this and you are right.I thought there was an internal
mechanism for scoping, but investigation of the source code shows that
\version is actually recognized by a lexer rule.


Were the OP to carry out the cut as I suggested, and possibly
reduce each movement to, say, a dozen measures, it might be easier
to appreciate the logical structure of the sonata's source without
being confused by the irrelevant physical structure of the files.
That's why I posted the two example files demonstrating which
lines in foo.ly generate which annotations in foo.pdf. (One hopes
that the OP is using an editor that can re-indent the pasted-together
source, which might also help to clarify the overall structure.)


Yes, absolutely. I was not trying to contradict you but just to
expand on your answer.

Cheers,
Jean