repeated time signatures

2013-04-29 Thread Urs Liska
The NR (1.2.3 "Displaying Rhythms") states that time signatures "are 
printed at the beginning of a piece and whenever the time signature 
changes."


But if I write

music = {
  \time 3/4
  R2.*4
  \time 3/4
  R2.
}

the time signature is printed a second time although it doesn't change 
(to my understanding)


a) Is this intended behaviour? And if yes, shouldn't it be documented?
b) How can I achieve that the time signature is only printed if it is 
actually different from the one currently in use?
c) How can I achieve the same (only displaying if really changed) for 
key signatures and clefs?


(Background: I have a piece with _lots_ of segments that are 
concatenated (in order to have music variables of manageable length that 
can easily be edited by different people. To make the source files more 
explicit I want each variable definition to start with \key \time and 
\clef commands.)


Thanks
Urs

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


Re: repeated time signatures

2013-04-29 Thread David Nalesnik
Hi Urs,


On Mon, Apr 29, 2013 at 9:02 AM, Urs Liska  wrote:

> The NR (1.2.3 "Displaying Rhythms") states that time signatures "are
> printed at the beginning of a piece and whenever the time signature
> changes."
>
> But if I write
>
> music = {
>   \time 3/4
>   R2.*4
>   \time 3/4
>   R2.
> }
>
> the time signature is printed a second time although it doesn't change (to
> my understanding)
>
> a) Is this intended behaviour? And if yes, shouldn't it be documented?
>

I would think that you should need to tell LilyPond to force the unusual
situation of a redundant time signature as it's not typical practice.  It
shouldn't be possible to do something unusual like this through oversight.


> b) How can I achieve that the time signature is only printed if it is
> actually different from the one currently in use?
>

This question came up here:
 http://www.mail-archive.com/lilypond-user@gnu.org/msg72613.html

Hopefully the engraver (see second version) still works!

c) How can I achieve the same (only displaying if really changed) for key
> signatures and clefs?
>

Possibly that engraver can be adapted.  (I can't try now as my job is
calling).

Best,
David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: repeated time signatures

2013-04-29 Thread Urs Liska

Hi David,

Am 29.04.2013 16:15, schrieb David Nalesnik:

Hi Urs,


On Mon, Apr 29, 2013 at 9:02 AM, Urs Liska > wrote:


The NR (1.2.3 "Displaying Rhythms") states that time signatures
"are printed at the beginning of a piece and whenever the time
signature changes."

But if I write

music = {
  \time 3/4
  R2.*4
  \time 3/4
  R2.
}

the time signature is printed a second time although it doesn't
change (to my understanding)

a) Is this intended behaviour? And if yes, shouldn't it be documented?


I would think that you should need to tell LilyPond to force the 
unusual situation of a redundant time signature as it's not typical 
practice.  It shouldn't be possible to do something unusual like this 
through oversight.

OK, I see.


b) How can I achieve that the time signature is only printed if it
is actually different from the one currently in use?


This question came up here:
http://www.mail-archive.com/lilypond-user@gnu.org/msg72613.html

Hopefully the engraver (see second version) still works!

Yes, it works with 2.16 and 2.17.17.

Thank you very much!


c) How can I achieve the same (only displaying if really changed)
for key signatures and clefs?


Possibly that engraver can be adapted.  (I can't try now as my job is 
calling).
Although I've done my first steps with Scheme by now I don't see any 
chance to try that myself. So I'd be extremely grateful if you could 
give it a try.


This will surely become part of openLilyLib, and I think it should also 
be included in LilyPond proper (because this 'uncommon' behaviour should 
be possible, I think (Trevor even thought it were a bug, isn't it))


Best
Urs


Best,
David


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


Re: repeated time signatures

2013-04-30 Thread Michael Rivers
I make lots of worksheets in which I need a time signature repeated for the
student's answer. I like the current behavior.



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/repeated-time-signatures-tp145185p145262.html
Sent from the User mailing list archive at Nabble.com.

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


Re: repeated time signatures

2013-04-30 Thread Carl Peterson
I could be wrong, but I would think that the primary motivation for
specifying the same time signature a second time is to have it displayed a
second time? The only time I can think of it not being intended this way is
that if someone has serial voices/parts/whatever on the same staff and the
time signature is explicitly declared in both.

Cheers,
Carl


On Tue, Apr 30, 2013 at 1:50 PM, Michael Rivers wrote:

> I make lots of worksheets in which I need a time signature repeated for the
> student's answer. I like the current behavior.
>
>
>
> --
> View this message in context:
> http://lilypond.1069038.n5.nabble.com/repeated-time-signatures-tp145185p145262.html
> Sent from the User mailing list archive at Nabble.com.
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: repeated time signatures

2013-04-30 Thread Urs Liska
Am Dienstag, den 30.04.2013, 13:56 -0400 schrieb Carl Peterson:
> I could be wrong, but I would think that the primary motivation for
> specifying the same time signature a second time is to have it
> displayed a second time? 

Considering it one day later I think you may be right.

> The only time I can think of it not being intended this way is that if
> someone has serial voices/parts/whatever on the same staff and the
> time signature is explicitly declared in both.
> 
And this isn't that rare.
Neil Thornock had an application where he collated random segments that
might or might not have different time signatures.
My case is that I have consecutive sements that are defined in different
files, and I want them to explicitely stater their key, time signature
and staff in the beginning (because an editor might see _only_ this
file).

So I think this should be configurable somehow. I don't mind if the
current behaviour is kept, but then it should be documented explicitely
(because the NR currently states that the time signature is printed
after a _change_).
And a workaround such as David's engraver should be at least in the LSR
(if it works with 2.14, that is).

Urs
> 
> Cheers,
> Carl
> 
> 
> On Tue, Apr 30, 2013 at 1:50 PM, Michael Rivers
>  wrote:
> I make lots of worksheets in which I need a time signature
> repeated for the
> student's answer. I like the current behavior.
> 
> 
> 
> --
> View this message in context:
> 
> http://lilypond.1069038.n5.nabble.com/repeated-time-signatures-tp145185p145262.html
> Sent from the User mailing list archive at Nabble.com.
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user



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


Re: repeated time signatures

2013-04-30 Thread luis jure

on 2013-04-30 at 13:56 Carl Peterson wrote:

> I could be wrong, but I would think that the primary motivation for
> specifying the same time signature a second time is to have it displayed
> a second time? The only time I can think of it not being intended this
> way is that if someone has serial voices/parts/whatever on the same
> staff and the time signature is explicitly declared in both.

i for one would be very happy if lilypond offered at least the option to
display a time signature only when it differs from the previous measure.

i'm trying to generate lilypond scores algorithmically, and the time
signature of each measure is part of the internal representation i'm
using. it would make my life much easier if lilypond just ignored
redundant time signatures. 

for my part, it would be great if the user could choose between the two
behaviors.


best,


lj

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


Re: repeated time signatures

2013-04-30 Thread David Nalesnik
Urs,


On Mon, Apr 29, 2013 at 10:32 AM, Urs Liska  wrote:

>  Hi David,
>
> Am 29.04.2013 16:15, schrieb David Nalesnik:
>
> Hi Urs,
>
>
> On Mon, Apr 29, 2013 at 9:02 AM, Urs Liska  wrote:
>
>
>
>> b) How can I achieve that the time signature is only printed if it is
>> actually different from the one currently in use?
>>
>
>  This question came up here:
>  http://www.mail-archive.com/lilypond-user@gnu.org/msg72613.html
>
>  Hopefully the engraver (see second version) still works!
>
> Yes, it works with 2.16 and 2.17.17.
>
> Thank you very much!
>

Glad to hear it!

>
>
>  c) How can I achieve the same (only displaying if really changed) for
>> key signatures and clefs?
>>
>
>  Possibly that engraver can be adapted.  (I can't try now as my job is
> calling).
>
> Although I've done my first steps with Scheme by now I don't see any
> chance to try that myself. So I'd be extremely grateful if you could give
> it a try.
>

I spent a little time with key signatures.  It quickly became apparent that
the situation is rather more complicated than with meter signatures, since
line breaking and key cancellations have to be accommodated.  I'll keep
pecking away at this.


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


Re: repeated time signatures

2013-05-07 Thread Urs Liska
Hi David,

unfortunately your engraver does _not_ work as expected (and as I had
stated):
Obviously the 'previous' time signature may also be the one in a
'previous' staff at the same musical moment. So when using the engraver
the time signature is only printed in the top-most staff :-(

I guess one can update the condition so that is true if the time
signature of 'elem' is equal to the time signature of 'prev' _and_ if
their musical moments differ.
But unfortunately I don't have any clue on how to achieve that :-(

Any help (new version or even better: hint) would be very welcome

Urs

Am Montag, den 29.04.2013, 09:15 -0500 schrieb David Nalesnik:
> Hi Urs,
> 
> 
> On Mon, Apr 29, 2013 at 9:02 AM, Urs Liska  wrote:
> The NR (1.2.3 "Displaying Rhythms") states that time
> signatures "are printed at the beginning of a piece and
> whenever the time signature changes."
> 
> But if I write
> 
> music = {
>   \time 3/4
>   R2.*4
>   \time 3/4
>   R2.
> }
> 
> the time signature is printed a second time although it
> doesn't change (to my understanding)
> 
> a) Is this intended behaviour? And if yes, shouldn't it be
> documented?
> 
> 
> I would think that you should need to tell LilyPond to force the
> unusual situation of a redundant time signature as it's not typical
> practice.  It shouldn't be possible to do something unusual like this
> through oversight.
>  
> b) How can I achieve that the time signature is only printed
> if it is actually different from the one currently in use?
> 
> 
> This question came up here:
>  http://www.mail-archive.com/lilypond-user@gnu.org/msg72613.html
> 
> 
> Hopefully the engraver (see second version) still works!
> 
> 
> c) How can I achieve the same (only displaying if really
> changed) for key signatures and clefs?
> 
> 
> Possibly that engraver can be adapted.  (I can't try now as my job is
> calling).
> 
> 
> Best,
> David



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


Re: repeated time signatures

2013-05-07 Thread David Nalesnik
Hi Urs,


On Tue, May 7, 2013 at 6:02 AM, Urs Liska  wrote:

> Hi David,
>
> unfortunately your engraver does _not_ work as expected (and as I had
> stated):
> Obviously the 'previous' time signature may also be the one in a
> 'previous' staff at the same musical moment. So when using the engraver
> the time signature is only printed in the top-most staff :-(
>

The immediate problem is solved by keeping the engraver in the Staff
context.   Of course it would be nice if the behavior you describe didn't
happen if the engraver is moved to StaffGroup or PianoStaff or whatever.


>
> I guess one can update the condition so that is true if the time
> signature of 'elem' is equal to the time signature of 'prev' _and_ if
> their musical moments differ.
> But unfortunately I don't have any clue on how to achieve that :-(
>
> Any help (new version or even better: hint) would be very welcome
>
>
You've described how I would tackle the problem.  Getting the timing of the
signatures is the part I'm not sure of right now.  (It could be stored with
the time signatures as they are acknowledged, but maybe there's a better
way.  I'll look into this.  Sorry I don't have a ready hint/solution.)

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


Re: repeated time signatures

2013-05-07 Thread Urs Liska
Hi David,

thanks for that.
Sometimes I have the impression I don't see the forest for the trees as
soon as Scheme is involved. Even if the actual problem isn't a Scheme
one as in the current case ...

Moving the engraver to Staff seems to be enough for my score problem.

Urs

Am Dienstag, den 07.05.2013, 07:38 -0500 schrieb David Nalesnik:
> Hi Urs,
> 
> 
> On Tue, May 7, 2013 at 6:02 AM, Urs Liska  wrote:
> Hi David,
> 
> unfortunately your engraver does _not_ work as expected (and
> as I had
> stated):
> Obviously the 'previous' time signature may also be the one in
> a
> 'previous' staff at the same musical moment. So when using the
> engraver
> the time signature is only printed in the top-most staff :-(
> 
> 
> The immediate problem is solved by keeping the engraver in the Staff
> context.   Of course it would be nice if the behavior you describe
> didn't happen if the engraver is moved to StaffGroup or PianoStaff or
> whatever.
>  
> 
> I guess one can update the condition so that is true if the
> time
> signature of 'elem' is equal to the time signature of 'prev'
> _and_ if
> their musical moments differ.
> But unfortunately I don't have any clue on how to achieve
> that :-(
> 
> Any help (new version or even better: hint) would be very
> welcome
> 
> 
> 
> 
> You've described how I would tackle the problem.  Getting the timing
> of the signatures is the part I'm not sure of right now.  (It could be
> stored with the time signatures as they are acknowledged, but maybe
> there's a better way.  I'll look into this.  Sorry I don't have a
> ready hint/solution.)
> 
> 
> -David
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user



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


Re: [Spam??] repeated time signatures

2013-04-29 Thread Trevor Daniels

Urs Liska wrote  Monday, April 29, 2013 3:02 PM


> The NR (1.2.3 "Displaying Rhythms") states that time signatures "are 
> printed at the beginning of a piece and whenever the time signature 
> changes."
> 
> But if I write
> 
> music = {
>   \time 3/4
>   R2.*4
>   \time 3/4
>   R2.
> }
> 
> the time signature is printed a second time although it doesn't change 
> (to my understanding)

Rather surprisingly there is no bug report describing this, although it
has been present since the beaming behaviour was changed several
years ago.

> a) Is this intended behaviour? And if yes, shouldn't it be documented?

I don't think it is intended, so it should be recorded as a bug.
Copying to bug list for bug squad.

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


is there a way to suppress repeated time signatures (analogous to chordChanges)

2013-11-11 Thread Kieren MacMillan
Hello all,

Consider the following snippet:

\version "2.17.29"

global = {
  \time 3/4
  s4*3
}
notes = {
  c'1.
}

\score {
  \new Staff \repeat "unfold" 3 { << \global \notes >> }
}

This is contrived, of course, but I run into it a lot when I “stitch together” 
pre-existing variables (which include time signatures) into a medley, etc.
Is there a global setting that I can use — analogous to the chordChanges switch 
in ChordNames — so that time signatures only appear if they change?

Thanks,
Kieren.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: is there a way to suppress repeated time signatures (analogous to chordChanges)

2013-11-11 Thread Urs Liska

Hi,

I didn't look into it, but when _I_ asked this question I got the 
attachment as a result.


HTH
Urs

Am 11.11.2013 23:08, schrieb Kieren MacMillan:

Hello all,

Consider the following snippet:

\version "2.17.29"

global = {
   \time 3/4
   s4*3
}
notes = {
   c'1.
}

\score {
   \new Staff \repeat "unfold" 3 { << \global \notes >> }
}

This is contrived, of course, but I run into it a lot when I “stitch together” 
pre-existing variables (which include time signatures) into a medley, etc.
Is there a global setting that I can use — analogous to the chordChanges switch 
in ChordNames — so that time signatures only appear if they change?

Thanks,
Kieren.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


%{
   Engraver that suppresses the printing of a
   time signature if it is the same that is 
   currently in effect.
   
   Author: David Nalesnik
   http://www.mail-archive.com/lilypond-user@gnu.org/msg72628.html
   
   This is actually a work-around to an unwanted behaviour, see
   http://lists.gnu.org/archive/html/lilypond-user/2013-04/msg00851.html and
   https://lists.gnu.org/archive/html/bug-lilypond/2013-04/msg00162.html
%}

\version "2.14.2"

suppressRedundantTimeSig =
#(lambda (ctx)
  (let ((time-sig '()))

   `((acknowledgers
  (time-signature-interface
   . ,(lambda (engraver grob source-engraver)
   (set! time-sig (cons grob time-sig)

 (finalize
  . ,(lambda (trans)
  (reduce
(lambda (elem prev)
  (if (equal? (ly:grob-property elem 'fraction)
  (ly:grob-property prev 'fraction))
  (begin
(ly:grob-suicide! elem)
prev)
  elem))
  '()
  (reverse time-sig))
(set! time-sig '()))

%{ Usage:
 
 music = {
   \time 3/4
  R2.
  \time 4/4
  R1
  \time 4/4
  R1
  \time 3/4
  R2.
}

\score {
  \new Staff \music

  \layout {
\context {
  \Score
  \consists #suppressRedundantTimeSig
}
  }
}

%}___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: is there a way to suppress repeated time signatures (analogous to chordChanges)

2013-11-11 Thread Kieren MacMillan
Hi Urs,

> I didn't look into it, but when _I_ asked this question I got the attachment 
> as a result.

This looks really good — thanks!

I would be happy to offer a little bounty (e.g. US$25) for a 
“Redundancy_remover_engraver”, which took a list of items like 
#’(time-signature key-signature clef etc) and eliminated any that are already 
in effect. Anyone?

Thanks,
Kieren.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: is there a way to suppress repeated time signatures (analogous to chordChanges)

2013-11-11 Thread David Nalesnik
Hi,


On Mon, Nov 11, 2013 at 6:03 PM, Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Urs,
>
> > I didn't look into it, but when _I_ asked this question I got the
> attachment as a result.
>
> This looks really good — thanks!
>
> I would be happy to offer a little bounty (e.g. US$25) for a
> “Redundancy_remover_engraver”, which took a list of items like
> #’(time-signature key-signature clef etc) and eliminated any that are
> already in effect. Anyone?


It's straightforward for time signatures.  It's not so simply with key
signatures, as I found when I tried to figure it out--with no luck--for
Urs.  So, I will gracefully bow out of the challenge.

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