Re: Bar line at beginning of piece

2022-11-20 Thread Jean Abou Samra

Le 20/11/2022 à 14:51, Lukas-Fabian Moser a écrit :

Hi,

is there an "idiomatic" way of forcing LilyPond to print a bar line 
"|" at the beginning of the piece other than doing the hack of adding


\grace s1 \bar "|"

before the music?
[...]




Hm.


\version "2.23.81"

{
  \once \set Timing.measureStartNow = ##t
  \once \set Timing.measureBarType = "|-s"
  c'1
  \break
  c'1
}



What is amusing is that measureStartNow is unset at the
start of the piece, but both Multi_measure_rest_engraver
and Measure_counter_engraver "or" it with a boolean that
is true in the first time step. Only Bar_engraver uses its
value unchanged without doing something special at the
first time step. It could be wise to make measureStartNow
set to #t at the beginning of the piece, and change
Bar_engraver to "and" it with "not the start of the piece".
(Actually, I was already surprised by this some time ago,
https://gitlab.com/lilypond/lilypond/-/issues/6126.)

Cheers,
Jean



OpenPGP_signature
Description: OpenPGP digital signature


Re: Bar line at beginning of piece

2022-11-20 Thread Lukas-Fabian Moser

Hi Jean,


Hm.


\version "2.23.81"

{
  \once \set Timing.measureStartNow = ##t
  \once \set Timing.measureBarType = "|-s"
  c'1
  \break
  c'1
}


Thank you very much - this works from 2.23.8 on, I assume because of 
Dan's additions. Great!


I still have to read up on the bar type definition codes which I never 
actually managed to understand. For example, in scm/bar-line.scm, I read:



;; predefined bar lines
;;
;; definition of bar lines goes as follows:
;;
;; (define-bar-line "mid-line bar[-annotation]"
;;  "end-of-line bar[-annotation]"
;;  "beginning-of-line bar[-annotation]"
;;  "span bar")
;;
;; Each argument must be a string or #f.  The string "" calls for a
;; zero-width stencil.  The string "x" or the value #f call for no
;; stencil.  "x" may be annotated, unlike #f.

From this explanation, it find it hard to understand the the "mid-line" 
bar is taken as kind of an "identifier", which becomes clear only after 
reading


(define-public (define-bar-line bar-glyph eol-glyph bol-glyph span-glyph)
  "Define a bar glyph @var{bar-glyph} and its substitutes at the end of
a line (@var{eol-glyph}), at the beginning of a line (@var{bol-glyph})
and as a span bar (@var{span-glyph}).  The substitute glyphs may be
either strings or booleans: @code{#t} calls for the same value as
@var{bar-glyph} and @code{#f} calls for no glyph."

Also, "each argument must be a string or #f" seems strange when reading

(define-bar-line "|" #t #f #t)

So probably the comments on predefined bar lines don't reflect very 
faithfully what's actually happening?


Lukas




Re: Bar line at beginning of piece

2022-11-20 Thread Jean Abou Samra

Le 20/11/2022 à 16:11, Lukas-Fabian Moser a écrit :
Thank you very much - this works from 2.23.8 on, I assume because of 
Dan's additions. Great!



There have been so many changes to bar lines that I have stopped 
tracking which happened in which version :-)



I still have to read up on the bar type definition codes which I never 
actually managed to understand. For example, in scm/bar-line.scm, I read:


 


;; predefined bar lines
;;
;; definition of bar lines goes as follows:
;;
;; (define-bar-line "mid-line bar[-annotation]"
;;  "end-of-line bar[-annotation]"
;;  "beginning-of-line bar[-annotation]"
;;  "span bar")
;;
;; Each argument must be a string or #f.  The string "" calls for a
;; zero-width stencil.  The string "x" or the value #f call for no
;; stencil.  "x" may be annotated, unlike #f.

From this explanation, it find it hard to understand the the 
"mid-line" bar is taken as kind of an "identifier", which becomes 
clear only after reading


(define-public (define-bar-line bar-glyph eol-glyph bol-glyph span-glyph)
  "Define a bar glyph @var{bar-glyph} and its substitutes at the end of
a line (@var{eol-glyph}), at the beginning of a line (@var{bol-glyph})
and as a span bar (@var{span-glyph}).  The substitute glyphs may be
either strings or booleans: @code{#t} calls for the same value as
@var{bar-glyph} and @code{#f} calls for no glyph."




Yes, the bar line system is slightly surprising: the
"mid-line" part is used both as the argument to \bar
and as the source for the mid-line glyph.



Also, "each argument must be a string or #f" seems strange when reading

(define-bar-line "|" #t #f #t)

So probably the comments on predefined bar lines don't reflect very 
faithfully what's actually happening?



This one looks like an oversight in commit 66c0227700.

Cheers,
Jean



OpenPGP_signature
Description: OpenPGP digital signature


Re: Bar line at beginning of piece

2011-01-28 Thread Graham Percival
On Fri, Jan 28, 2011 at 05:07:58AM -0800, ornello wrote:
> \version "2.12.2"
> {
> \time 4/4
> \grace s
> \bar "||"
> c''4
> }
> 
> but this is not working for multiple staves.

I suggest
  \partial 64 s64
  \bar "||"
and I'm pretty certain it'll work if you put it in all staves.

Cheers,
- Graham

___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Bar line at beginning of piece

2011-01-28 Thread Wilbert Berendsen
Op vrijdag 28 januari 2011 schreef ornello:

> Is there any chance to start a piece with a "||" bar line?

See: http://lsr.dsi.unimi.it/LSR/Item?id=500

best regards,
Wilbert Berendsen

-- 
Frescobaldi, LilyPond editor for KDE: http://www.frescobaldi.org/
Nederlands LilyPond forum: http://www.lilypondforum.nl/

___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


RE: Bar line at beginning of piece

2011-01-28 Thread James Lowe
Hello

> -Original Message-
> From: lilypond-user-bounces+james.lowe=datacore@gnu.org
> [mailto:lilypond-user-bounces+james.lowe=datacore@gnu.org] On
> Behalf Of Wilbert Berendsen
> Sent: 28 January 2011 14:27
> To: lilypond-user@gnu.org
> Subject: Re: Bar line at beginning of piece
> 
> Op vrijdag 28 januari 2011 schreef ornello:
> 
> > Is there any chance to start a piece with a "||" bar line?
> 
> See: http://lsr.dsi.unimi.it/LSR/Item?id=500
> 

This only allows a 'repeat' bar line not a double bar line.

Obviously not all bar lines are equal.

It would be useful if it *is* possible to use this snippet somehow to put a 
double bar line using this method (we could edit the LSR) but when I tried I 
couldn't work it out

James


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Bar line at beginning of piece

2011-01-28 Thread ornello

Thanks Graham,


Graham Percival-3 wrote:
> 
> I suggest
>   \partial 64 s64
>   \bar "||"
> and I'm pretty certain it'll work if you put it in all staves.
> 

this leaves an additional space between time signature and bar line which I
wanted to avoid using the grace (which has no duration).

I have now found another solution following an idea described here:
http://lists.gnu.org/archive/html/lilypond-user/2009-04/msg00908.html

It overrides the bar-line::calc-glyph-name in output-lib.scm which is
responsible of removing the "||" bar:

==

\version "2.12.2"

% cribbed from output-lib.scm version 2.12
#(define my-bar-glyph-alist
  '((":|:" . (":|" . "|:"))
(":|.|:" . (":|" . "|:"))
(":|.:" . (":|" . "|:"))
("||:" . ("||" . "|:"))
("dashed" . ("dashed" . '())) 
("|" . ("|" . ()))
("||:" . ("||" . "|:"))
("|s" . (() . "|"))
("|:" . ("|" . "|:"))
("|." . ("|." . ()))

;; hmm... should we end with a bar line here?
(".|" . ("|" . ".|"))
(":|" . (":|" . ()))
;;("||" . ("||" . ()))
("||" . ("||" . "||")) ;; allow || at beginning of line
(".|." . (".|." . ()))
("|.|" . ("|.|" . ()))
("" . ("" . ""))
(":" . (":" . ""))
("." . ("." . ()))
("'" . ("'" . ()))
("empty" . (() . ()))
("brace" . (() . "brace"))
("bracket" . (() . "bracket")) 
))

#(define (index-cell cell dir)
  (if (equal? dir 1) (cdr cell) (car cell)))

#(define (my-calc-glyph-name grob)
  (let* (
(glyph (ly:grob-property grob 'glyph))
(dir (ly:item-break-dir grob))
(result (assoc glyph  my-bar-glyph-alist))
(glyph-name (if (= dir CENTER)
   glyph
   (if (and result (string? (index-cell (cdr result) dir)))
(index-cell (cdr result) dir)
#f
   glyph-name))

{
\new Staff \with {
  \override BarLine #'break-visibility = #'#(#t #t #t)
  }
{
\override Staff.BarLine #'glyph-name = #my-calc-glyph-name % apply
\time 4/4
%\grace s
%\partial 128 s128 
\bar "||"
c''4
}
}

==

It would be really helpful if one could override the behaviour defined in
'bar-glyph-alist' without having to redefine 'calc-glyph-name'.
-- 
View this message in context: 
http://old.nabble.com/Bar-line-at-beginning-of-piece-tp30786694p30788162.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Bar line at beginning of piece

2011-01-28 Thread ornello

I have to correct my previous message. My solution is not working because it
affects all line breaks (not just the beginning of the piece. So I'll try
your suggestion, Graham...



ornello wrote:
> 
> Thanks Graham,
> 
> 
> Graham Percival-3 wrote:
>> 
>> I suggest
>>   \partial 64 s64
>>   \bar "||"
>> and I'm pretty certain it'll work if you put it in all staves.
>> 
> 
> this leaves an additional space between time signature and bar line which
> I wanted to avoid using the grace (which has no duration).
> 
> I have now found another solution following an idea described here:
> http://lists.gnu.org/archive/html/lilypond-user/2009-04/msg00908.html
> 

-- 
View this message in context: 
http://old.nabble.com/Bar-line-at-beginning-of-piece-tp30786694p30789105.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Bar line at beginning of piece

2011-01-28 Thread Robin Bannister
ornello wrote: 
My solution is not working because it affects all line breaks 
(not just the beginning of the piece
  
Having to affect all line breaks was what made was-empty.ly so cumbersome.  
  
You can make LSR 500 work by adding: 
\once \override Staff.BarLine #'glyph-name = "||" 
  
  
Cheers,

Robin
  
  
P.S.  
And please don't consider replacing the LSR 500 overrides 
with the deprecated one-liner (as still seen in LSR 377) 
\once \override Staff.BarLine #'break-align-symbol = #'custos 



___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Bar line at beginning of piece

2011-01-31 Thread ornello

Thanks for your hint, Robin - that looks best to me! For multiple staves, I
had to use Score.BarLine:


\version "2.12.2"

\score {
<<
\new Staff <<
\time 4/4
\new Voice {
\once \override Score.BarLine #'glyph-name = "||" 
\bar "|:"
c''4
}
>>
\new PianoStaff <<
\new Staff <<
\time 4/4
\new Voice {
c''4
}
>>
\new Staff <<
\clef bass
\time 4/4
\new Voice {
c4
}
>>
>>
>>
}




Robin Bannister wrote:
> 
> You can make LSR 500 work by adding: 
>> \once \override Staff.BarLine #'glyph-name = "||" 
> 

-- 
View this message in context: 
http://old.nabble.com/Bar-line-at-beginning-of-piece-tp30786694p30805365.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user