Re: Problem with r2. in two voices

2015-02-08 Thread Noeck
Hi Kieren,

the output has indeed only one dot. But at least here it puts the dot in the
upper staff space (where the e'' is) and not next to the rest.

Cheers,
Joram

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


Re: Problem with r2. in two voices

2015-02-08 Thread Kieren MacMillan
Hi Cynthia,

 I guess the only way out is to rewrite the two voices so that one of them 
 issues hidden rests in the score, but the rests in the parts, via tags.

Not at all… I can think of about a half-dozen other ways to make that happen in 
Lilypond.

This would be my preference, since it would be applied globally:

\version 2.19.15

#(define (rest-score r)
  (let ((score 0)
(yoff (ly:grob-property-data r 'Y-offset))
(sp (ly:grob-property-data r 'staff-position)))
(if (number? yoff)
(set! score (+ score 2))
(if (eq? yoff 'calculation-in-progress)
(set! score (- score 3
(and (number? sp)
 (= 0 2 sp)
 (set! score (+ score 2))
 (set! score (- score (abs (- 1 sp)
score))

#(define (merge-rests-on-positioning grob)
  (let* ((can-merge #f)
 (elts (ly:grob-object grob 'elements))
 (num-elts (and (ly:grob-array? elts)
(ly:grob-array-length elts)))
 (two-voice? (= num-elts 2)))
(if two-voice?
(let* ((v1-grob (ly:grob-array-ref elts 0))
   (v2-grob (ly:grob-array-ref elts 1))
   (v1-rest (ly:grob-object v1-grob 'rest))
   (v2-rest (ly:grob-object v2-grob 'rest)))
  (and
   (ly:grob? v1-rest)
   (ly:grob? v2-rest)  
   (let* ((v1-duration-log (ly:grob-property v1-rest 'duration-log))
  (v2-duration-log (ly:grob-property v2-rest 'duration-log))
  (v1-dot (ly:grob-object v1-rest 'dot))
  (v2-dot (ly:grob-object v2-rest 'dot))
  (v1-dot-count (and (ly:grob? v1-dot)
 (ly:grob-property v1-dot 'dot-count -1)))
  (v2-dot-count (and (ly:grob? v2-dot)
 (ly:grob-property v2-dot 'dot-count -1
 (set! can-merge
   (and 
(number? v1-duration-log)
(number? v2-duration-log)
(= v1-duration-log v2-duration-log)
(eq? v1-dot-count v2-dot-count)))
 (if can-merge
 ;; keep the rest that looks best:
 (let* ((keep-v1? (= (rest-score v1-rest)
  (rest-score v2-rest)))
(rest-to-keep (if keep-v1? v1-rest v2-rest))
(dot-to-kill (if keep-v1? v2-dot v1-dot)))
   ;; uncomment if you're curious of which rest was chosen:
   ;;(ly:grob-set-property! v1-rest 'color green)
   ;;(ly:grob-set-property! v2-rest 'color blue)
   (ly:grob-suicide! (if keep-v1? v2-rest v1-rest))
   (if (ly:grob? dot-to-kill)
   (ly:grob-suicide! dot-to-kill))
   (ly:grob-set-property! rest-to-keep 'direction 0)
   (ly:rest::y-offset-callback rest-to-keep)))
(if can-merge
#t
(ly:rest-collision::calc-positioning-done grob

Aa = \relative c'' { \oneVoice r2. }
Ab = \relative c'' { \oneVoice r2. }

\score {  
  \new Staff \with { \override RestCollision.positioning-done = 
#merge-rests-on-positioning } 
\time 3/4
\new Voice \Aa  \\ 
\new Voice \Ab 
  
}

Hope this helps!
Kieren.
___

Kieren MacMillan, composer
www:  http://www.kierenmacmillan.info
email:  i...@kierenmacmillan.info


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


Re: Problem with r2. in two voices

2015-02-08 Thread Cynthia Karl

 On Feb 7, 2015, at 9:07 PM, Kieren MacMillan kieren_macmil...@sympatico.ca 
 wrote:
 
 Hi Cynthia,
 
 In fact the output generated is just nonsensical.  Two stacked augmentation 
 dots?  That just doesn’t seem right.
 
 No, it’s perfectly sensible, if you want (need) to make it visually explicit 
 that there are two voices at the same time — otherwise, how would the reader 
 know?

But I don’t want to make it visually that there are two voices here, I want to 
make it visually explicit that there is a single voice.  That’s why each voice 
has issued the \oneVoice command before asserting the r2.  And why is it only 
rests and notes that have augmentation dots are affected in \oneVoice mode this 
way? There is no way other than clashing note column warnings to tell that two 
voices have each issued concurrent rests in \oneVoice mode.  It’s just kind of 
weird that augmentation dots get this special treatment.

I guess the only way out is to rewrite the two voices so that one of them 
issues hidden rests in the score, but the rests in the parts, via tags.
 
 Consider, for example, the following related snippet:
 
 \version 2.19.15
 \score {
  \new Staff 
\time 4/2
{ d''2 c''1. }  \\
\new Voice { b'2 c''1. }
 
 }
 
 The reason this output makes sense is the same reason there are two stacked 
 augmentation dots in your rest example.


On Sun, Feb 08, 2015 at 12:03AM , Paul Scott wrote:

 What kind of music are you trying to write?
 
 Paul Scott


Concerto Op3 No12 by Francesco Manfredini.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with r2. in two voices

2015-02-08 Thread Kevin Barry
On Sun, Feb 8, 2015 at 2:03 PM, Cynthia Karl pck...@mac.com wrote:

 But I don’t want to make it visually that there are two voices here, I
 want to make it visually explicit that there is a single voice.  That’s why
 each voice has issued the \oneVoice command before asserting the r2.  And
 why is it only rests and notes that have augmentation dots are affected in
 \oneVoice mode this way? There is no way other than clashing note column
 warnings to tell that two voices have each issued concurrent rests in
 \oneVoice mode.  It’s just kind of weird that augmentation dots get this
 special treatment.


I think you are misusing \oneVoice here; it isn't for merging things into a
single voice, but rather for telling LilyPond that there is only one voice
that it needs to position on the staff. If you are still `feeding' it two
(or more) voices you will have to do some extra work to tell LilyPond what
to do or you will get errors and/or unintended output.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with r2. in two voices

2015-02-08 Thread Simon Albrecht

Am 08.02.2015 21:32, schrieb Kevin Barry:


On Sun, Feb 8, 2015 at 2:03 PM, Cynthia Karl pck...@mac.com 
mailto:pck...@mac.com wrote:


But I don't want to make it visually that there are two voices
here, I want to make it visually explicit that there is a single
voice.  That's why each voice has issued the \oneVoice command
before asserting the r2.  And why is it only rests and notes that
have augmentation dots are affected in \oneVoice mode this way?
There is no way other than clashing note column warnings to tell
that two voices have each issued concurrent rests in \oneVoice
mode.  It's just kind of weird that augmentation dots get this
special treatment.


I think you are misusing \oneVoice here;
Indeed the name of the command makes perfectly clear that it's 
contradictory and nonsensical (and lily basically requires to be given 
sensible input) to write \oneVoice and have two voices all the same. Too 
much noise for such a basic misconception!


Yours, Simon

it isn't for merging things into a single voice, but rather for 
telling LilyPond that there is only one voice that it needs to 
position on the staff. If you are still `feeding' it two (or more) 
voices you will have to do some extra work to tell LilyPond what to do 
or you will get errors and/or unintended output.



___
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: Problem with r2. in two voices

2015-02-07 Thread Paul Scott
On Sat, Feb 07, 2015 at 08:49:52PM -0600, Cynthia Karl wrote:
  
  Message: 2
  Date: Sat, 7 Feb 2015 18:24:30 -0800
  From: Mark Stephen Mrotek carsonm...@ca.rr.com
  To: 'Cynthia Karl' pck...@mac.com,  lilypond-user@gnu.org
  Subject: RE: Problem with r2. in two voices
  Message-ID: 00c201d04346$5ef30160$1cd90420$@ca.rr.com
  Content-Type: text/plain; charset=utf-8
  
  Cynthia,
  
  
  
  Actually there are two r2. rests, one in each voice. Replace one with s2. 
  and it shall disappear.
  
 
 And then when I want to generate parts, what shall I do then?  Tags?

What kind of music are you trying to write?

Paul Scott
 
 I guess what I’m saying is that the output of LP for my snippet is just 
 wrong.  Why doea that happen?  It seems that what I have written shouldn’t 
 generate the output that it does.  In fact the output generated is just 
 nonsensical.  Two stacked augmentation dots?  That just doesn’t seem right.
 ___
 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: Problem with r2. in two voices

2015-02-07 Thread Cynthia Karl
 
 Message: 2
 Date: Sat, 7 Feb 2015 18:24:30 -0800
 From: Mark Stephen Mrotek carsonm...@ca.rr.com
 To: 'Cynthia Karl' pck...@mac.com,lilypond-user@gnu.org
 Subject: RE: Problem with r2. in two voices
 Message-ID: 00c201d04346$5ef30160$1cd90420$@ca.rr.com
 Content-Type: text/plain; charset=utf-8
 
 Cynthia,
 
 
 
 Actually there are two r2. rests, one in each voice. Replace one with s2. and 
 it shall disappear.
 

And then when I want to generate parts, what shall I do then?  Tags?

I guess what I’m saying is that the output of LP for my snippet is just wrong.  
Why doea that happen?  It seems that what I have written shouldn’t generate the 
output that it does.  In fact the output generated is just nonsensical.  Two 
stacked augmentation dots?  That just doesn’t seem right.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with r2. in two voices

2015-02-07 Thread Kieren MacMillan
Hi Cynthia,

 In fact the output generated is just nonsensical.  Two stacked augmentation 
 dots?  That just doesn’t seem right.

No, it’s perfectly sensible, if you want (need) to make it visually explicit 
that there are two voices at the same time — otherwise, how would the reader 
know?

Consider, for example, the following related snippet:

\version 2.19.15
\score {
  \new Staff 
\time 4/2
{ d''2 c''1. }  \\
\new Voice { b'2 c''1. }
  
}

The reason this output makes sense is the same reason there are two stacked 
augmentation dots in your rest example.

Hope this helps!
Kieren.
___

Kieren MacMillan, composer
www:  http://www.kierenmacmillan.info
email:  i...@kierenmacmillan.info


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


Re: Problem with r2. in two voices

2015-02-07 Thread Brett Duncan

On 8/02/15 12:46 PM, Cynthia Karl wrote:

I don’t understand two things about the following snippet:

\version 2.19.15
Aa = \relative c'' {\oneVoice r2. }
Ab = \relative c'' {\oneVoice r2. }
\score {
  \new Staff  
  \time 3/4
  \new Voice \Aa
  \new Voice \Ab
  
  \layout {}
}First, why does the r2. rest have a two augmentation dots?  Is there 
any way to fix that?


which produces:




Second, why does that snippet throw the following two warnings:



warning: cannot resolve rest collision: rest direction not set
\oneVoice
r2.
warning: cannot resolve rest collision: rest direction not set
\oneVoice
r2.
I see some information in the Notation Manual about Multimeasure Rest 
direction, but that’s not involved here.  There is, as best as I can 
determine, anything about simple rest collision/direction in any of 
the v2.19.15 documentation set. Furthermore, the lack of resolution of 
rest collision doesn’t seem to lead to any problems.


The warnings explain the visual output - you are trying to put two 
dotted rests in the same place at the same time. LP has managed to 
separate the augmentation dots, but not the rests themselves.


But what is the aim of this snippet? Why do you have \oneVoice in your 
definitions for Aa and Ab?


Using \voiceOne and \voiceTwo separates the rests:

\version 2.19.15
Aa = \relative c'' {\voiceOne r2. }
Ab = \relative c'' {\voiceTwo r2. }
\score {
  \new Staff  
  \time 3/4
  \new Voice \Aa
  \new Voice \Ab
  
  \layout {}


Is this what you were after?

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


Problem with r2. in two voices

2015-02-07 Thread Cynthia Karl
I don’t understand two things about the following snippet:

\version 2.19.15

Aa = \relative c'' {\oneVoice r2. }
Ab = \relative c'' {\oneVoice r2. }

\score {  
  \new Staff  
  \time 3/4
  \new Voice \Aa 
  \new Voice \Ab 
   
  \layout {}


}First, why does the r2. rest have a two augmentation dots?  Is there any way 
to fix that?

which produces:




Second, why does that snippet throw the following two warnings:



warning: cannot resolve rest collision: rest direction not set
\oneVoice
r2.
warning: cannot resolve rest collision: rest direction not set
\oneVoice
r2.
I see some information in the Notation Manual about Multimeasure Rest 
direction, but that’s not involved here.  There is, as best as I can determine, 
anything about simple rest collision/direction in any of the v2.19.15 
documentation set.  Furthermore, the lack of resolution of rest collision 
doesn’t seem to lead to any problems.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


RE: Problem with r2. in two voices

2015-02-07 Thread Mark Stephen Mrotek
Cynthia,

 

Actually there are two r2. rests, one in each voice. Replace one with s2. and 
it shall disappear.

 

Mark

 

From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
[mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of 
Cynthia Karl
Sent: Saturday, February 07, 2015 5:47 PM
To: lilypond-user@gnu.org
Subject: Problem with r2. in two voices

 

I don’t understand two things about the following snippet:

 

\version 2.19.15

 

Aa = \relative c'' {\oneVoice r2. }

Ab = \relative c'' {\oneVoice r2. }

 

\score {  

  \new Staff  

  \time 3/4

  \new Voice \Aa 

  \new Voice \Ab 

   

  \layout {}

 

 

}First, why does the r2. rest have a two augmentation dots?  Is there any way 
to fix that?

 

which produces:

 

 



 

Second, why does that snippet throw the following two warnings:

 

 

 

warning: cannot resolve rest collision: rest direction not set

  \oneVoice 

 r2. 

warning: cannot resolve rest collision: rest direction not set

   \oneVoice 

 r2. 

I see some information in the Notation Manual about Multimeasure Rest 
direction, but that’s not involved here.  There is, as best as I can determine, 
anything about simple rest collision/direction in any of the v2.19.15 
documentation set.  Furthermore, the lack of resolution of rest collision 
doesn’t seem to lead to any problems.

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