Re: Devnull ignores tie and slur

2021-05-22 Thread Kaj Persson

On 2021-05-22 14:51,  Lukas-Fabian Moser wrote:

Hi Kaj,

Am 22.05.21 um 14:25 schrieb Kaj Persson:
How surprising! I tried using Devnull for a piece, but the lyrics did 
not synchronize with the music. So I discovered that it ignores ties 
and slurs. This makes this finesse useless for lyrics, which is a 
pity. Could be useful. Well, yes, I know it is intended for cadenzas 
parties in the music, but it could be useful also for the lyrics.


Try \new NullVoice instead of \new Devnull - I think this does what 
you want.


Lukas


Hello Lukas!

Yes it does. Wunderbar. Vielen Dank!

Kaj



Devnull ignores tie and slur

2021-05-22 Thread Kaj Persson
How surprising! I tried using Devnull for a piece, but the lyrics did 
not synchronize with the music. So I discovered that it ignores ties and 
slurs. This makes this finesse useless for lyrics, which is a pity. 
Could be useful. Well, yes, I know it is intended for cadenzas parties 
in the music, but it could be useful also for the lyrics.


/Kaj

Here is an example:

\version "2.22.0"

preMusic = \relative { a2 a }
voltaMusic = \relative { b'4 b~ b b }
finalMusic = \relative { c''4 c( c) c }

preTxt = \lyricmode { Pre text }
voltaOne = \lyricmode { The first time }
voltaTwo = \lyricmode { And next time }
finalPart = \lyricmode { Here's the end }

\score {
  <<
    \new Staff <<
  \new Voice { \preMusic \repeat volta 2 { \voltaMusic } \finalMusic }
  \new Devnull = "VerseOne" { \preMusic \voltaMusic }
  \new Devnull = "VerseTwo" { #(skip-of-length preMusic) 
\voltaMusic \finalMusic }

    >>

    \new Lyrics \lyricsto "VerseOne" { \preTxt \voltaOne \skip 1 
\finalPart }

    \new Lyrics \lyricsto "VerseTwo" { \voltaTwo \skip 1 \finalPart }
    %% %%  The \skip 1 should not be necessary if Devnull had 
worked correct 

  >>

  \layout {}
  \midi {}
}



Devnull.pdf
Description: Adobe PDF document


Re: Lyrics and Repeats

2021-05-18 Thread Kaj Persson

YES!  YES!  YES!

Thank you Carl. This was exactly the solution I have been searching for. 
Now I must (a bit ashamed) admit that I have never heard of that 
function/context Devnull and neither the functions skip-of-length or 
mmrest-of-length. Devnull isn't even mentioned in Notary Reference, but 
the other two are. I thought I had read this manual from cover to cover, 
but obviously there are still material to learn. In fact I in my mind 
was thinking of a need for just this, and even was pondering on how to 
create one. A luck that I did not come to action...


Well, now I think I can sleep soundly the whole night, and wake up in a 
fresh mode tomorrow and take care of the job with "my" piece of music.


Thank you Carl!

/Kaj


On 2021-05-18 20:39, Carl Sorensen wrote:

Kaj,

This is how I approach your problem.  It uses Devnull contexts to space the 
lyrics, and it makes use of the skip-of-length function to provide skips in the 
Devnull contexts.

With this method, you have to make some more variables and contexts, but you 
never need to count notes to or put skips in your lyrics.

HTH,

Carl

\version "2.20.0"
ta = \lyricmode {
Not re -- peat -- ed.
  }
   tb = \lyricmode {
   The first time words.
   an -- oth -- er bar
   a sec -- ond bar
   the fi -- nal bar
   }
   tc = \lyricmode {
Sec -- ond time words.
   }
   ty = \lyricmode {
 The alt two words
   }
   tz = \lyricmode {
 con -- tin -- ue on
  }
  
  firstMus =  \relative {a'4 a a a}

  voltaMus = \relative {b'4 b b b}
  altOne = \relative {c'4 c c c | c c c c | c c c c}
  altTwo = \relative {d'4 d d d}
  lastMus = \relative {e'4 e e e}

   \score {
 <<
   \new Staff {
 <<
 \new Voice = "melody" {
   \firstMus
 \repeat volta 2 \voltaMus
 \alternative {
   {\altOne }
   {\altTwo}
 }
\lastMus
   }
  
 \new Devnull = "mainlyrics" {

   \firstMus
   \voltaMus
   \altOne
   #(skip-of-length altTwo)
   \lastMus
 }

 \new Devnull = "extralyrics" {
   #(skip-of-length firstMus)
   \voltaMus
   #(skip-of-length altOne)
   \altTwo
 }
 >>
   }

   \new Lyrics="main" \lyricsto "mainlyrics" {
 \ta
 \tb
 \tz
   }
   
   \new Lyrics="alts"\lyricsto "extralyrics"{

 \tc
 \ty
   }
 >>
   }






Re: Lyrics and Repeats

2021-05-18 Thread Kaj Persson

Hello David and Aaron

You'll find my message at the bottom ...



On 2021-05-16 23:41, David Wright wrote:

On Sun 16 May 2021 at 06:07:22 (+0200), Kaj Persson wrote:

[ … ] I think I have read most of the
relevant parts in Notation manual and also Learning manual, but,
according to what I can remember, I have nowhere seen a declaration of
the conditions when LilyPond in fact uses the duration figure of
\skip. Obviously I have happened to run across such a condition.

Aaron explains this better than I could, using the name of the
mechanism involved.


[ … ] All this, until these conditions are
presented, about when LilyPond uses the figure, makes me, from now on,
skip the \skip and instead use one of the alternatives which I by
chance happened to discover in the snippets manual (I think it was)
namely the empty string ("") or the underscore (_), which at a quick
test seem not to have the drawbacks of \skip.

Most replacements for \skip have some sort of side-effect. For example,
if you use _ as the first in a sequence of skips, it indicates a
melisma, which will left-shift the preceding syllable, and can even
generate a lyric extender. Under some circumstances, using "" can
produce a benign warning in the log, which could be annoying if
automatically scanning this. And so on.

Aaron's function (thank you) the obvious way to go, though I shall
name it ¬ because it's easy to type (it's present on a GB keyboard,
and I have ¬ set up as CapsLock - , or CapsLock , -) and in context,
it's undistracting, eg:  … end of phrase. \¬ 7 Start of phrase …


The method of defining
the duration for every word/syllable really does not entice me much.
Letting the notes alone define the durations is too comfortable for
that.

AIUI if you need a score to work, whether or not its repeats are
unfolded, then you have no choice over using durations.


Moreover I have not found how to return to the normal mode, if I
at a short, special section, does define the durations for lyrics
words.

AIUI that decision is made at the level of \new Lyrics  { }
depending on what stuff is.


All this so long, however, does not explain the extra space introduced
by \lyricsto, so that is another question.

Cheers,
David.


Hello David and Aaron

Thank you for your lessons, they are indeed clarifying a lot. Sorry for 
my late answer, I have spent the time with experimenting.


My original problem/task was how to write a real piece of music, a bit 
longer than these snippets describing special characteristics of 
LilyPond. I have been searching for a simple method to code a piece of 
music containing one or more repeats with alternatives, and these are 
not situated near the beginning of the piece, which almost all examples 
seem to presume, also in yours, Aaron. In these simplified examples, it 
is easy to count \skip:s before the \repeat. But in reality, say you 
have 50 or more measures with varying contents, then it is a wee harder 
to count. Yes, I know, you can guess a figure and do a test compilation 
to see, and that way iterate to the correct figure. But it will be 
sensitive, if you change the music in these tones, then you must not 
forget to change also that figure.


So I have looked at the alternative method, suggested in Notification 
Reference, to divide the piece, the voices in parts with one boundary at 
at the \repeat. In my current case the repeat point also is where the 
number of choral parts change, before that they have common words, so 
the method with double angle brackets in the lyrics should be applicable 
and suitable  But unfortunately I have not succeeded in this work, and 
this was what I tried to present in my first post. However I do not 
think the solution I presented is fully correct, but it was a try. I 
also had come across the case when a second \lyricsto introduced an 
extra \skip. With this post I include a special presentation of that.


But back to the original task, probably it is impossible to solve it in 
the present version of LilyPond. My wish is that with the "<< >>" method 
you can forget all counting syllables in the first part of the piece.


/Kaj


Here is the snippet presenting the \lyricsto issue:

\version "2.22.0"

tA = \lyricmode { play }
tB = \lyricmode { the game }

\paper {
score-system-spacing.basic-distance = #20
}
{
  \time 3/4
  <<
    \new Staff {
  \new Voice = "melody" {
    \mark "With \lyricsto in the second lyrics"
    \relative { c'2 e4 g2. } } }

    \new Lyrics = "TEXTa"   \lyricsto "melody"
    {
  \tA << \tB
 \new Lyrics = "textA"  \lyricsto "melody"
 { \set associatedVoice = "melody"
   now
 }
  >>
    }
  >>
}
{
  \time 3/4
  <<
    \new Staff {
  \new Voice = "melody" {
    \mark "No \lyricsto in the second lyric

Re: Lyrics and Repeats

2021-05-15 Thread Kaj Persson



2021-05-15 20:31 skrev David Wright:

On Sat 15 May 2021 at 16:03:54 (+0200), Kaj Persson wrote:


In the Notation manual is described how to manage Lyrics in Repeat
conditions. It shows examples the Repeat section following an initial
part of music. There are also examples when the Repeat starts the
piece and then followed by more music. But if you are searching the
combination of these two you search in vain. This was really what I
wanted, an initial part before the Repeat then a couple of
alternatives and an ending part outside of the repeat and
alternatives. Well I understand the author of the manual who left this
case aside, because the solution I succeeded to find does not agree
with the normal rules described in the manual. The rule with repeated
{ \skip 1 } was changed. Instead of counting individual tones, you now
has to define whole measures. If you do not, the text is gliding away,
possibly of the score, it vanishes and you cannot find it! I suppose
this is a bug that ought to be corrected.

Another observation is that \lyricsto adds an extra space at the start
in the case that you define an new lyric at the beginning of the
\repeat. So the '\new Lyric \lyricsto "melody" { ' is NOT equivalent
with '\new Lyric { \set associatedVoice = "melody" '. This too ought
to be a bug.

To find this took of course a quite lot of time, and I am still not
shure I have catched the full truth. In the following examlple I have
used variables for the lyrics, just to test that it work, and it does.
The interested can also test removing the "% " before the \lyricsto to
see the consequence.

I am running LilyPond version 2.21.0 via Frescobaldi. Appended an
image of the Music example.


Perhaps you should look back at this post from last week:
https://lists.gnu.org/archive/html/lilypond-user/2021-05/msg00038.html
You have to choose one method or the other, not a sort of mixture.

BTW your lyrics have no durations, fair enough with method 1, but then
the same will be true for \skips. Syntactically, however, they must 
have
a numeric suffix, whose value is ignored. (§ Invisible rests, p62 NR 
2.22.0)


Cheers,
David.


Thank you, David, for your reply and your efforts to explain my 
experiences. Unfortunately you did not succeed completely. First you 
notice that there are no duration figures with the words/syllables in 
the lyrics. The only exceptions are the skip commands. I have used this 
method because the manual suggests it. I have read that in lyric text 
LilyPond ignores the figure at \skip. I have seen an implied word 
"never", but from your answer one should possibly understand it as 
"sometimes" or at least "most often". I think I have read most of the 
relevant parts in Notation manual and also Learning manual, but, 
according to what I can remember, I have nowhere seen a declaration of 
the conditions when LilyPond in fact uses the duration figure of \skip. 
Obviously I have happened to run across such a condition. It also 
explains my observation that the \skip command does not mean individual 
notes/tones but whole measures. The figure 1 does mean a full measure in 
the tempo 4/4. So it should mean two measures in 2/2, but I have not 
tested that. All this, until these conditions are presented, about when 
LilyPond uses the figure, makes me, from now on, skip the \skip and 
instead use one of the alternatives which I by chance happened to 
discover in the snippets manual (I think it was) namely the empty string 
("") or the underscore (_), which at a quick test seem not to have the 
drawbacks of \skip. The method of defining the duration for every 
word/syllable really does not entice me much. Letting the notes alone 
define the durations is too comfortable for that. Moreover I have not 
found how to return to the normal mode, if I at a short, special 
section, does define the durations for lyrics words.
All this so long, however, does not explain the extra space introduced 
by \lyricsto, so that is another question.


Regards and once again, thank you David for your try to help.
/Kaj
So



Lyrics and Repeats

2021-05-15 Thread Kaj Persson

Hi all

In the Notation manual is described how to manage Lyrics in Repeat 
conditions. It shows examples the Repeat section following an initial 
part of music. There are also examples when the Repeat starts the piece 
and then followed by more music. But if you are searching the 
combination of these two you search in vain. This was really what I 
wanted, an initial part before the Repeat then a couple of alternatives 
and an ending part outside of the repeat and alternatives. Well I 
understand the author of the manual who left this case aside, because 
the solution I succeeded to find does not agree with the normal rules 
described in the manual. The rule with repeated { \skip 1 } was changed. 
Instead of counting individual tones, you now has to define whole 
measures. If you do not, the text is gliding away, possibly of the 
score, it vanishes and you cannot find it! I suppose this is a bug that 
ought to be corrected.


Another observation is that \lyricsto adds an extra space at the start 
in the case that you define an new lyric at the beginning of the 
\repeat. So the '\new Lyric \lyricsto "melody" { ' is NOT equivalent 
with '\new Lyric { \set associatedVoice = "melody" '. This too ought to 
be a bug.


To find this took of course a quite lot of time, and I am still not 
shure I have catched the full truth. In the following examlple I have 
used variables for the lyrics, just to test that it work, and it does. 
The interested can also test removing the "% " before the \lyricsto to 
see the consequence.


I am running LilyPond version 2.21.0 via Frescobaldi. Appended an image 
of the Music example.


Kaj P

\version "2.22.0"
ta = \lyricmode {
  % Not re -- peat -- ed.
  a a a a }
  tb = \lyricmode {
% The first time words.
  b b b b }
  tc = \lyricmode {
% Sec -- ond time words.
  c c c c }
  tx = \lyricmode {
x x x x }
  ty = \lyricmode {
y y y y }
  tz = \lyricmode {
z z z z }

  \score {
<<
  \new Staff {
\new Voice = "melody" {
  \relative {
a'4 a a a
\repeat volta 2 { b4 b b b }
\alternative {
  { c,4 c c c   c c c c  }
  { d4 d d d }
}
e4 e e e
  }
}
  }
  \new Lyrics \lyricsto "melody" {
\ta
<<
  { \tb \tx \tx \tx \repeat unfold 1 { \skip 1 } \tz }
  \new Lyrics % \lyricsto "melody"
  {
\set associatydVoice = "melody"
\tc
\repeat unfold 3 { \skip 1 }
\ty
  }
>>
  }
>>
  }


PartCombine with rests

2018-06-07 Thread Kaj Persson
I am working on an SATB piece, and want to produce two things: 1) the 
note sheet and 2) a MIDI file as an aid for the singers in learning the 
music. I want two voices on one staff, so I tried using the partcombine 
facility.


At one point there is a long pause for the singers, where instruments 
play. Now I want to replace this long rest with a shorter one, so I 
looked for a suitable method. Tags looked promising, and I started with 
the first example in Notation Reference (chapter "1.5.2 Multiple voices" 
-> "Automatic part combining").As a measure three I want to insert 
something like


   if (midi) then R1; else \repeat unfold 2 { R1 }; fi

defined in some kind of meta language. Hence for the note sheet I want 
the long rest indicating where the orchestra is playing, but in the 
sound file (midi) this long pause is just irritating.


In the LilyPond language I cannot find such an "if - then - else" 
construction, but I thought I could use something with tags. So I tried


   \tag #'ySheet { R1 | R1 }       % note sheet, hence the long rest
   \tag #'yMidi { R1 }             % Midi, short rest

Well I put the rests in own variables to shorten the writings as you 
might see below.


I put the music in two separate \score sections with individual settings 
of the tag references ySheet resp. yMidi. Yes, it worked. I got one or 
two measures with rests.


But where are the chords from mark B and forward? They disappear when I 
add these rests. And why do the last whole notes not merge?


I have modified the original code a wee but not too much as far as I can 
find out.


I am sure this will have a solution if I start Scheme programming, but 
my knowledge in that language is not big enough (yet), and I was hoping 
there is a solution in pure LilyPond code.


As you can see I am using the latest officially stable version 2.18.2. 
Need I say that I have varied the code in a very big number of ways to 
find something working, but all in vain. Maybe the variable names 
instrumentOneA etc are misleading as they represent human voices and not 
the orchestra members, but I have chosen to keep the those in the 
example in the manual, just adding the letters A and B to indicate the 
position in the music.


I am sorry this message became rather long, but I could not make it 
shorter still describing the problem and my efforts so far.


Kaj

The code:


\version "2.18.2"

instrumentOneA = \relative c' {

\mark "A"

c4 d e f |

R1 |

}

instrumentOneB = \relative c' {

\mark "B"

d'4 c b a |

b4 g2 f4 |

e1 |

}

instrumentTwoA = \relative g' {

R1 |

g4 a b c |

}

instrumentTwoB = \relative g' {

b4 c b a |

g4 f( e) d |

e1 |

}

rSheet = { R1 | R1 | }

rMidi = { R1 | }

Music = {

<<

\new Staff

{

\new Voice { \instrumentOneA \tag ySheet { \rSheet } \tag yMidi { 
\rMidi } \instrumentOneB }


}

\new Staff { \instrumentTwoA \tag ySheet { \rSheet } \tag yMidi { 
\rMidi } \instrumentTwoB }


\new Staff

\partcombine {

\instrumentOneA \tag ySheet { \rSheet } \tag yMidi { \rMidi } 
\instrumentOneB


}

{

\instrumentTwoA \tag ySheet { \rSheet } \tag yMidi { \rMidi } 
\instrumentTwoB


}

>>

}

\score {

\keepWithTag ySheet {

\Music

}

\layout {}

}

\score {

\keepWithTag yMidi {

\Music

}

\layout {}

}



... and the result in appended file PartCombine_w_rests.pdf.




PartCombine_w_rests.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How to attach markup to several notes

2017-05-09 Thread Kaj

On 2017-05-09 at 14:15, Ivanov Dmitry wrote:

Hi Ivanov!
I understand that you want a function which puts your text exact at 
the midpoint between the notes, but...
Else is the simplest to just displace your text some distance. But of 
course, then you have to calculate the midpoint yourself.


\version "2.18.2"
\relative f'{
f8_\markup { \translate #'(0.8 . 0) F} 
}
Kaj



Hello. Can you explain the meaning of this:

f8_\markup - start the markup below the note f8

{
 \translate -- call "translate" function
   #' - what's this?
   (0.8 . 0) - parameter passing. But what is the syntax?
 F - text "F"
}


Hello Ivanov
As you see, compared to your own code I just added a call for a 
function, which moves the text some distance from its original place, 
which is just under the first note f. The displacement is the two 
numbers in the parenthesis 0.8 in the X direction (horizontally) and 0 
(zero) in the Y direction (vertically). This a special data type, a pair 
of numbers, and must be separated by a dot, which in turn has to be 
surrounded by spaces ( to not be mistaken for a decimal point). The hash 
mark (#) is the syntax for entering values to almost any function, for 
the programming language Scheme to recognize it as a value. The 
apostrophe says it is not a string (which is surrounded by double 
quotes) but another kind of value. The unit for the displacement is the 
space between the staff lines.


Myself I am far from an expert, so someone might come back and correct 
what I have written. In the Notation Reference you have examples and a 
better explanation:

http://lilypond.org/doc/v2.18/Documentation/notation/formatting-text#text-alignment

If you have not yet read the Learning Manual I recommend you to do so. 
You will discover some of the structure in programming LilyPond.

/Kaj


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


Re: How to attach markup to several notes

2017-05-09 Thread Kaj

On 2017-05-09 at 10:47, Ivanov Dmitry wrote:

Code:

\version "2.18.2"
\relative f'{
 f8_\markup {F} 
}

How can I attach the markup to several notes, so the text was put
between them?

Something like this:

\version "2.18.2"
\relative f'{
 {f8 }_\markup {F}
}

Hi Ivanov!
I understand that you want a function which puts your text exact at the 
midpoint between the notes, but...
Else is the simplest to just displace your text some distance. But of 
course, then you have to calculate the midpoint yourself.


\version "2.18.2"
\relative f'{
 f8_\markup { \translate #'(0.8 . 0) F} 
}
Kaj



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


Re: Combining \tag with \quoteDuring does not work

2017-03-27 Thread Kaj Persson

David,

On 2017-03-27 at 20:17, David Kastrup wrote:

Kaj Persson <70147pers...@telia.com> writes:


So the result you show printed is _exactly_ the result according to
my explanation, yet you say it isn't, possibly because of glossing
over half of the explanation, possibly because of misunderstanding
some part of the explanation.

Which is it?
   

You gave the explaination above at "since the tag isn't relevant for
quoting." I thought, that tags always change the source, but obviously
I was wrong.

So let's see when I bothered mentioning it.  In my first reply I wrote:

 That being said, tags are a mechanism for manipulating input and
 quotes are a mechanism for recording input and replaying the
 recorded results (which no longer are input put streams of events).

 So all of your tag manipulations need to be done by the time you use
 \addQuote .  Maybe you don't need quotes here but rather
 straightforward music variables: those contain the input and are
 still susceptible to tag manipulations.

In my second reply I wrote:

 >
 > \addQuote "Q" { \Ma \Mb \Mc \tag #'X \Mb \Md }

 The tag here is ineffective since it is inside of the quote.

So I gave the information two times rather explicitly and still had to
take your complex example apart in the third answer before you actually
considered it.

Since I already explained this in detail in the first reply, it seems
like a total waste of effort when you express your complete surprise
that things work the way I already explained in the first reply.  Or
actually, that the _result_ is the way I explained it.  Because "I
thought, that tags always change the source, but obviously I was wrong."
rather suggests that you did not actually consider thinking about the
explanation.

Particularly in the light of that, you should aim to provide smaller
examples in future as your mode of learning seems to be focused
_completely_ on looking at examples _without_ considering explanations.
So since the dissemination of an example is _mandatory_ for your
learning, you really should aim to make at least this step as painless
as possible for helpers.

Of course you are right. In your eyes I am a stupid person who does not 
understand simple relations and explanations. I cannot deny that. O 
course you are right. I have for quite a long time tried to learn this 
program LilyPond, but still I have not reached your heights. I do not 
know  scheme, but am trying to understand how the program behaves. Yes, 
already in your first answer you gave an explaination, I read it, but at 
that time I was more anxious to come back with a readable code, and did 
not look so hard into your words of wisdom. Then they have been 
repeated, and I have read them, but shame to say, I do not yet 
understand the full essence. I am not the cleverest man walking on this 
earth, and have to use time (and several examples) before the real 
knowledge enters my head.


I am sorry I have irritated you. I am aware of mistakes in my writing an 
example, and, I repeat, I will try to make them not complete but more 
simple, in the future, if I will have to call for help again. I am sorry 
having to admit, I assume I will need that. I know you are a busy 
person, yet willing to help idiots like me. Of course I appreciate that, 
and I am very grateful. So thank you very, very much.


I can also tell, that I have followed your advice from your first answer 
about variable. It was a fruitful solution and much better than quoting 
(this time).


/Kaj


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


Re: Combining \tag with \quoteDuring does not work

2017-03-27 Thread Kaj Persson



Den 2017-03-27 kl. 18:53, skrev David Kastrup:

Kaj Persson <70147pers...@telia.com> writes:


On 2017-03-27 at. 17:54, David Kastrup wrote:

Kaj Persson <70147pers...@telia.com> writes:


Oh sorry, this was not according to my intention. And yet I embraced
the code with the HTML tags  ... , a methode I have been
using several times before, with good results. Well I take your words

Some of them at least.  I did write an answer.


and send this e-mail again as pure text, which means I cannot paste
the images, why I instead attach them as files. Sorry for the mistake.

Here is the code:

\version "2.18.2"

Ma = \relative g' { c4 c c }
Mb = \relative g' { b4 b b }
Mc = \relative g' { a4 a a a a a \bar "||" }
Md = \relative g' { g4 g g }

Mj = { \Ma \Mb \Mc \tag #'X \Mb \Md }

Mk = \relative g' {
 \quoteDuring "Q" { s1*4*3/4 }
 \tag #'X { \quoteDuring "Q" { s4*3 } }
 \quoteDuring "Q" { s4*3 }
}

That likely doesn't do what you think it does.  If you remove the tagged
expression, what remains will be

Mk = \relative g' {
 \quoteDuring "Q" { s1*4*3/4 }
 \quoteDuring "Q" { s4*3 }
}

This is exactly what I want, but my impression is that I get this:

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
\quoteDuring "Q" { s4*3 } }
\quoteDuring "Q" { s4*3 }
}

It just ignores and removes the "\tag #'X {".

My intention is that Mk shall follow Mj, and when the \removewithtag
#'X is active the Mb shall be excluded (the second time) in Mj as well
as in Mk. In Mj this works very well, but Mk ignores the tag and
continues with Mb after Mc.

You know what you actually quote following this?  The following:


instead of

Mk = \relative g' {
 \quoteDuring "Q" { s1*4*3/4 }
 s4*3
 \quoteDuring "Q" { s4*3 }
}

So what gets removed is the _end_ of the quoted expression rather than
the middle.


\addQuote "Q" { \Ma \Mb \Mc \tag #'X \Mb \Md }

The tag here is ineffective since it is inside of the quote.

I really recommend that you try reading _all_ of my commentary and
understanding it.

This is getting tiresome.  In particular since your "minimal example" is
rather convoluted and does lots of cross-referencing, making it
impossible to follow it.

But let's get through the bulk of it in small parts since there seems no
way to make you apply my comments to your code yourself.

First the definitions:

\version "2.18.2"

Ma = \relative g' { c4 c c }
Mb = \relative g' { b4 b b }
Mc = \relative g' { a4 a a a a a \bar "||" }
Md = \relative g' { g4 g g }

Mj = { \Ma \Mb \Mc \tag #'X \Mb \Md }

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
\tag #'X { \quoteDuring "Q" { s4*3 } }
\quoteDuring "Q" { s4*3 }
}

As stated, removing the middle of Mk will result in the equivalent of

Mk = { \quoteDuring "Q" { s1*4*3/4 s4*3 } }

\addQuote "Q" { \Ma \Mb \Mc \tag #'X \Mb \Md }

is equivalent to

\addQuote "Q" { \Ma \Mb \Mc \Mb \Md }

since the tag isn't relevant for quoting.
Yes, this is the explanation! I thought that it takes the source as it 
is after change because of tags, but if it does not (as you say) my 
observations are exactly what you describe.


Then you have

S = {
s1*3/4
\mark \markup { \musicglyph #'"scripts.segno" } s4*3
\mark \markup { \musicglyph #'"scripts.coda" }
s2. s4 \mark \markup \line { "D.S. al" \raise #0.9 \musicglyph
#'"scripts.coda" } s2
\tag #'X { s4*3 } \break
\mark \markup { \musicglyph #'"scripts.coda" }
}

Where removing the tagged code will result in

S = {
s1*3/4
\mark \markup { \musicglyph #'"scripts.segno" } s4*3
\mark \markup { \musicglyph #'"scripts.coda" }
s2. s4 \mark \markup \line { "D.S. al" \raise #0.9 \musicglyph
#'"scripts.coda" } s2
\break
\mark \markup { \musicglyph #'"scripts.coda" }
}

and G = { \time 3/4 } (is there any reason you seem to want to obfuscate
your example as much as possible with trivial music expressions?)

So we get

\score {
   \removeWithTag #'X  % already executed everywhere
   {
 <<
   \new Staff {
 \time 3/4
 <<
\new Voice {
s1*3/4
\mark \markup { \musicglyph #'"scripts.segno" } s4*3
\mark \markup { \musicglyph #'"scripts.coda" }
s2. s4 \mark \markup \line { "D.S. al" \raise #0.9 \musicglyph
 #'"scripts.coda" } s2
\break
\mark \markup { \musicglyph #'"scripts.coda" }
}
\new Voice {
  \voiceOne
  \Ma \Mb \Mc \Md
}
 >>
   }
   \new Staff {
  

Re: Combining \tag with \quoteDuring does not work - addendum

2017-03-27 Thread Kaj Persson

On 2017-03-27 at. 17:54, David Kastrup wrote:

Kaj Persson <70147pers...@telia.com> writes:


Oh sorry, this was not according to my intention. And yet I embraced
the code with the HTML tags  ... , a methode I have been
using several times before, with good results. Well I take your words

Some of them at least.  I did write an answer.


and send this e-mail again as pure text, which means I cannot paste
the images, why I instead attach them as files. Sorry for the mistake.

Here is the code:

\version "2.18.2"

Ma = \relative g' { c4 c c }
Mb = \relative g' { b4 b b }
Mc = \relative g' { a4 a a a a a \bar "||" }
Md = \relative g' { g4 g g }

Mj = { \Ma \Mb \Mc \tag #'X \Mb \Md }

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
\tag #'X { \quoteDuring "Q" { s4*3 } }
\quoteDuring "Q" { s4*3 }
}

That likely doesn't do what you think it does.  If you remove the tagged
expression, what remains will be

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
\quoteDuring "Q" { s4*3 }
}

This is exactly what I want, but my impression is that I get this:

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
\quoteDuring "Q" { s4*3 } }
\quoteDuring "Q" { s4*3 }
}

It just ignores and removes the "\tag #'X {".

My intention is that Mk shall follow Mj, and when the \removewithtag #'X 
is active the Mb shall be excluded (the second time) in Mj as well as in 
Mk. In Mj this works very well, but Mk ignores the tag and continues 
with Mb after Mc.



===>

Addendum:
My thought was that when \removeWithTag #'X is active, the variables 
would be:

 Mj = { \Ma \Mb \Mc \Md }
 Mk = \relative g' {
  \quoteDuring "Q" { s1*4*3/4 }
  \quoteDuring "Q" { s4*3 }
 }
 \addQuote "Q" { \Ma \Mb \Mc \Md }

so because Mj now does not contain the second \Mb, the quote in Mk 
should copy \Md, but as far as I can see \Mk does not behave so.



instead of

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
s4*3
\quoteDuring "Q" { s4*3 }
}

So what gets removed is the _end_ of the quoted expression rather than
the middle.


\addQuote "Q" { \Ma \Mb \Mc \tag #'X \Mb \Md }

The tag here is ineffective since it is inside of the quote.


/Kaj


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


Re: Combining \tag with \quoteDuring does not work

2017-03-27 Thread Kaj Persson

On 2017-03-27 at. 17:54, David Kastrup wrote:

Kaj Persson <70147pers...@telia.com> writes:


Oh sorry, this was not according to my intention. And yet I embraced
the code with the HTML tags  ... , a methode I have been
using several times before, with good results. Well I take your words

Some of them at least.  I did write an answer.


and send this e-mail again as pure text, which means I cannot paste
the images, why I instead attach them as files. Sorry for the mistake.

Here is the code:

\version "2.18.2"

Ma = \relative g' { c4 c c }
Mb = \relative g' { b4 b b }
Mc = \relative g' { a4 a a a a a \bar "||" }
Md = \relative g' { g4 g g }

Mj = { \Ma \Mb \Mc \tag #'X \Mb \Md }

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
\tag #'X { \quoteDuring "Q" { s4*3 } }
\quoteDuring "Q" { s4*3 }
}

That likely doesn't do what you think it does.  If you remove the tagged
expression, what remains will be

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
\quoteDuring "Q" { s4*3 }
}

This is exactly what I want, but my impression is that I get this:

Mk = \relative g' {
   \quoteDuring "Q" { s1*4*3/4 }
   \quoteDuring "Q" { s4*3 } }
   \quoteDuring "Q" { s4*3 }
}

It just ignores and removes the "\tag #'X {".

My intention is that Mk shall follow Mj, and when the \removewithtag #'X 
is active the Mb shall be excluded (the second time) in Mj as well as in 
Mk. In Mj this works very well, but Mk ignores the tag and continues 
with Mb after Mc.

instead of

Mk = \relative g' {
\quoteDuring "Q" { s1*4*3/4 }
s4*3
\quoteDuring "Q" { s4*3 }
}

So what gets removed is the _end_ of the quoted expression rather than
the middle.


\addQuote "Q" { \Ma \Mb \Mc \tag #'X \Mb \Md }

The tag here is ineffective since it is inside of the quote.


/Kaj

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


Re: Combining \tag with \quoteDuring does not work

2017-03-27 Thread Kaj Persson
Oh sorry, this was not according to my intention. And yet I embraced the 
code with the HTML tags  ... , a methode I have been using 
several times before, with good results. Well I take your words and send 
this e-mail again as pure text, which means I cannot paste the images, 
why I instead attach them as files. Sorry for the mistake.


Here is the code:

\version "2.18.2"

Ma = \relative g' { c4 c c }
Mb = \relative g' { b4 b b }
Mc = \relative g' { a4 a a a a a \bar "||" }
Md = \relative g' { g4 g g }

Mj = { \Ma \Mb \Mc \tag #'X \Mb \Md }

Mk = \relative g' {
   \quoteDuring "Q" { s1*4*3/4 }
   \tag #'X { \quoteDuring "Q" { s4*3 } }
   \quoteDuring "Q" { s4*3 }
}

\addQuote "Q" { \Ma \Mb \Mc \tag #'X \Mb \Md }

S = {
   s1*3/4
   \mark \markup { \musicglyph #'"scripts.segno" } s4*3
   \mark \markup { \musicglyph #'"scripts.coda" }
   s2. s4 \mark \markup \line { "D.S. al" \raise #0.9 \musicglyph 
#'"scripts.coda" } s2

   \tag #'X { s4*3 } \break
   \mark \markup { \musicglyph #'"scripts.coda" }
}

G = {
   \time 3/4
}

\paper { ragged-right = ##t
  indent = #0
}

\score {
   \removeWithTag #'X
   {
 <<
   \new Staff {
 \G
 <<
   \new Voice \S
   \new Voice { \voiceOne \Mj }
 >>
   }
   \new Staff {
 \G
 \new Voice { \voiceTwo \Mk }
   }
 >>
   }

   \layout {}
   % \midi {}
}

Two images attached:
Layout_of_tag-quoteDuring.png
Midi_of_tag-quoteDuring.png


For the preamble, see the original post (also cited below).

/Kaj

On 2017-03-27 at 14:33,  David Kastrup wrote:
> 70147pers...@telia.com writes:
>
>> In movements where the music jumps between different sections marked
>> with segno signs, one has do deal with those in a quite different way
>> in the layout and the midi scores. Then the \tag is of good help to
>> exclude parts in the layout score that has to be there in the midi
>> score. Now, if two voices are almost equal there also a good aid in
>> the \addQuote and \quoteDuring mechanism. However to combine this with
>> the \tag facility does not work for me. The quotes neglect the tags
>> and is running as if they do not exist. I know my snippet is a wee too
>> long, but I will illustrate the whole situation with signs and
>> others. I also know that the construction with "D.S. al coda" is not
>> the cleverest, but it was the shortest I could find out here. To
>> shorten the example I have not doubled the score, but in the real case
>> the layout score is running with the "\removeWithTag #'X" while the
>> midi score has this line removed. Instead of the long \addQuote
>> expression you can write \Mj (which it is) but no difference. Here is
>> my example:
>>
>> \version "2.18.2" Ma = \relative g' { c4 c c } Mb = \relative g' { 
b4 b b } Mc =
>> \relative g' { a4 a a a a a \bar "||" } Md = \relative g' { g4 g g } 
Mj = { \Ma
>> \Mb \Mc \tag #'X \Mb \Md } Mk = \relative g' { \quoteDuring "Q" { 
s1*4*3/4 }
>> \tag #'X { \quoteDuring "Q" { s4*3 } } \quoteDuring "Q" { s4*3 } } 
\addQuote "Q"
>> { \Ma \Mb \Mc \tag #'X \Mb \Md } S = { s1*3/4 \mark \markup { 
\musicglyph

> No, I am not going to figure out this heap of code without line breaks.
> I recommend that you switch off HTML-formatted mails in your mail
> program or at the very least learn how to teach it _not_ to wrap lines
> where no line wraps belong.
>
> That being said, tags are a mechanism for manipulating input and quotes
> are a mechanism for recording input and replaying the recorded results
> (which no longer are input put streams of events).
>
> So all of your tag manipulations need to be done by the time you use
> \addQuote .  Maybe you don't need quotes here but rather straightforward
> music variables: those contain the input and are still susceptible to
> tag manipulations.
>


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


Re: Re: A notice about \mark when Mark_engraver is moved

2017-03-23 Thread Kaj Persson

Den 2017-03-23 kl. 17:27, skrev Mats Bengtsson:

On 2017-03-23 10:18,  wrote:

Hello all!
I had need of printing marks on several staves, so I moved the
Mark_engraver to the Staff context, all according to LilyPond NR, see
snippet below. Then I noticed, that I could not control the contents of
Rehearsal marks any more, except for the first one. All successors were
follow in sequence from the start id just as  were they all defined as
\default. Hence the hash mark has no influence contrary to when the
Mark_engraver resides in Score. The only possibility to get another id
is to define it as a text mark.

In the IR manual they say that the Staff_collecting_engraver must be
moved together with the Mark_engraver so I did, but could see no effect
from that. I have also tested to move the engraver to the Voice context,
but with the the same result.

I am running version 2.18.2, and have not tested any newer version.

This is my example:|

|

|\version "2.18.2" A = { \mark #3 a'4 a' | \mark #6 a' a' | \mark
\markup "Z" a' \mark \default a' | a' } \score { << \new Staff \with {
\consists "Mark_engraver" \consists "Staff_collecting_engraver" } {
\time 2/4 \new Voice { \A } } >> \layout { indent = #0 \context { \Score
\remove "Mark_engraver" \remove "Staff_collecting_engraver" } } }|

||Result when Mark_engraver is moved

Any experience?
Well, by default, the \mark command is defined as (in 
.../ly/music-functions-init.ly)


mark =
#(define-music-function
   (label) ((number-or-markup?))
  "Make the music for the \\mark command."
  (let* ((set (and (integer? label)
   (context-spec-music (make-property-set 
'rehearsalMark label)

  'Score)))
 (ev (make-music 'MarkEvent
 'origin (*location*

(if set
(make-sequential-music (list set ev))
(begin
  (if label (set! (ly:music-property ev 'label) label))
  ev


If you copy this definition into the top of your file and replace 
'Score by 'Staff, it should behave as you expect.


/Mats


Thank you Mats! Well, I haven't tested this, and do not find much reason 
to do so neither. Shouldn't the routine adapt itself to the context it 
is defined in? Some kind of variable? In the "Notation Reference" there 
is no hint of having to change the code when you move an engraver to a 
new context. Well I do not know Scheme (yet), and do not see that an 
ordinary user should have to (even if I can imagine it might raise the 
understanding a wee).


Kaj


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


Re: A notice about \mark when Mark_engraver is moved

2017-03-23 Thread Kaj Persson

On 2017-03-23 at 16:39, Toine Schreurs wrote:

Try:

A = {
   \mark #3 a'4 a' |
   \set Staff.rehearsalMark = #6
   \mark \default a' a'
} %etc


Yes, it does in fact work. I had seen this variable setting in  the
Internal Reference manual, but it was noted "(read)" so i did not test it.
However, this must be a work around for a bug, isn't it? It should work
without it, shouldn't it?

Yes, and yes.

I had a similar problem using MarkLine (http://lsr.di.unimi.it/LSR/Item?id=1010)
referred by
http://lilypond.org/doc/v2.19/Documentation/snippets/contexts-and-engravers#contexts-and-engravers-using-marklines-in-a-frenched-score

I used
\set MarkLine.rehearsalMark = #6
in that case.

Toine
Well, thank you for help. Step by step one learns how to come around the 
pecularities...


Kaj


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


Re: A notice about \mark when Mark_engraver is moved

2017-03-23 Thread Kaj

On 2017-03-23 at 14:28, Toine Schreurs wrote:


I had need of printing marks on several staves, so I moved the
Mark_engraver to the Staff context, all according to LilyPond NR, see
snippet below. Then I noticed, that I could not control the contents of
Rehearsal marks any more, except for the first one. All successors were
follow in sequence from the start id just as  were they all defined as
\default. Hence the hash mark has no influence contrary to when the
Mark_engraver resides in Score. The only possibility to get another id
is to define it as a text mark.

Try:

A = {
   \mark #3 a'4 a' |
   \set Staff.rehearsalMark = #6
   \mark \default a' a'
} %etc


|\version "2.18.2" A = { \mark #3 a'4 a' | \mark #6 a' a' | \mark
\markup "Z" a' \mark \default a' | a' } \score { << \new Staff \with {
\consists "Mark_engraver" \consists "Staff_collecting_engraver" } {
\time 2/4 \new Voice { \A } } >> \layout { indent = #0 \context { \Score
\remove "Mark_engraver" \remove "Staff_collecting_engraver" } } }|

Toine Schreurs

Yes, it does in fact work. I had seen this variable setting in  the 
Internal Reference manual, but it was noted "(read)" so i did not test it.
However, this must be a work around for a bug, isn't it? It should work 
without it, shouldn't it?


Kaj

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


Re: MIDI and template for dynamics

2016-05-31 Thread Kaj Persson

Hello Jan-Peter,

Sorry, I do not exactly understand the intention of your proposal. I am 
almost always using two \score sections, one for the midi and one for 
the layout (pdf). There are many reasons for that, among others 
"\unfoldRepeats" to take care of repeats. There are also other 
circumstances motivating this procedure. But there are nevertheless 
reasons to let them be as alike as possible, not least the amount of 
work to put into the project, by e.g. using a common dynamics template 
if the music allows this, which is often the case. To move the 
Dynamic_performer to the Staff context I do not think is a good idea, 
because the dynamics like the rest of the music belongs intimately to 
the voice, and small peculiarities  must be taken care of there. Small 
and maybe rare differences can e.g. be adapted to the special note and 
voice where it belongs while the rest of the dynamics might be taken 
care of by the common template.


I might have misunderstood you, and do not see the innermost intention 
with your suggestion, so please come back and explain.


After all, your suggestion with including the dynamics template in the 
voice itself is the best for the moment, because it in fact does work. I 
have tested with the music I am working with for the moment. The result 
is what I want, and the midi, the strength of the notes is following the 
dynamics template.. However it is a pity that one has to define the 
template in every voice, instead of every staff or even group of staves. 
And still, I cannot understand why I have to do so, and what is  
happening when I put a name on one of the voices, as it works without 
this name.


/Kaj


Den 2016-05-30 15:37, skrev Jan-Peter Voigt:

Hi Kaj,

if you use separate templates for pdf and midi, of course you can 
adjust the template as needed per case.
But it seems, you want to create both from one template. If you can 
use at least two score-statements, you can separate both cases and - 
for example - use tags to avoid double dynamics in PDF-output.
Another approach would be to move the Dynamic_performer to the 
Staff-context:


\midi {
  \context {
\Voice
\remove "Dynamic_performer"
  }
  \context {
\Staff
\consists "Dynamic_performer"
  }
}

though, I haven't tested that!

HTH
Jan-Peter


Am 30.05.2016 um 11:34 schrieb Kaj Persson:

Hi Jan-Peter!

This, in fact, worked. Now I have to investigate the consequences for 
my real case, as this is of course a wee more complicated than the 
simple snippet. it deals with choir music with double voices (soprano 
and alto etc.) in each staff, and also other things.


The question remains however, if the first attempt with the dynamics 
as a separate voice is working for the printed score, why does not 
this information go into the MIDI file, when any of the voices is named.


/Kaj


Den 2016-05-30 10:34, skrev Jan-Peter Voigt:

Hi Kaj,

perhaps it doesn't matter that its named, but dynamics are in a 
separate voice context?


You might try instead:

\new Voice = "SA" << \Music \Dynamics >>

Just a thought ...

HTH
Jan-Peter


Am 30.05.2016 um 10:28 schrieb 70147pers...@telia.com:

Hi all,

Using a template for dynamics is a convenient way of writing, when
dealing with voices following the same dynamics pattern. Basically it
works very well for producing beautiful scores, and also controlling
MIDI. But now I have found something that might be a bug, even if I 
hope

it is just a mistake of mine. Here is a small example:

|\version "2.18.2"||

||Music = {||
||  a'4 a' a' a'||
||  a'4 a' a' a'||
||}||

||Dynamics = { ||
||  s4\ppp s s s||
||  s4\fff s s s||
||}||

||\score {||
||   \new Staff <<||
|| \new Voice { \Music }||
|| \new Voice { \Dynamics }||
||   >>||

||  \layout {}||
||  \midi {}||
||}|

It produces a nice score and also the MIDI reflects the dynamics. But,
if I name one of the Voices, which I need to for Lyrics, the score is
still fine, but in the MIDI file nothing of dynamics can be heard. 
Just

one level all the time.

|\version "2.18.2"||

||Music = {||
||  a'4 a' a' a'||
||  a'4 a' a' a'||
||}||

||Dynamics = { ||
||   s4\ppp s s s||
||   s4\fff s s s||
||}||

||\score {||
||  \new Staff <<||
||\new Voice = "SA" { \Music }||  % <-- named voice
||\new Voice { \Dynamics }||
||  >>||

||   \layout {}||
||   \midi {}||
||}||
|||

As you see the above examples are written for version 2.18.2, the 
latest
stable, but I have tested also in version 2.19.42 without any 
difference.


/Kaj



___
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: Re: MIDI and template for dynamics

2016-05-30 Thread Kaj Persson

Hi Jan-Peter!

This, in fact, worked. Now I have to investigate the consequences for my 
real case, as this is of course a wee more complicated than the simple 
snippet. it deals with choir music with double voices (soprano and alto 
etc.) in each staff, and also other things.


The question remains however, if the first attempt with the dynamics as 
a separate voice is working for the printed score, why does not this 
information go into the MIDI file, when any of the voices is named.


/Kaj


Den 2016-05-30 10:34, skrev Jan-Peter Voigt:

Hi Kaj,

perhaps it doesn't matter that its named, but dynamics are in a 
separate voice context?


You might try instead:

\new Voice = "SA" << \Music \Dynamics >>

Just a thought ...

HTH
Jan-Peter


Am 30.05.2016 um 10:28 schrieb 70147pers...@telia.com:

Hi all,

Using a template for dynamics is a convenient way of writing, when
dealing with voices following the same dynamics pattern. Basically it
works very well for producing beautiful scores, and also controlling
MIDI. But now I have found something that might be a bug, even if I hope
it is just a mistake of mine. Here is a small example:

|\version "2.18.2"||

||Music = {||
||  a'4 a' a' a'||
||  a'4 a' a' a'||
||}||

||Dynamics = { ||
||  s4\ppp s s s||
||  s4\fff s s s||
||}||

||\score {||
||   \new Staff <<||
|| \new Voice { \Music }||
|| \new Voice { \Dynamics }||
||   >>||

||  \layout {}||
||  \midi {}||
||}|

It produces a nice score and also the MIDI reflects the dynamics. But,
if I name one of the Voices, which I need to for Lyrics, the score is
still fine, but in the MIDI file nothing of dynamics can be heard. Just
one level all the time.

|\version "2.18.2"||

||Music = {||
||  a'4 a' a' a'||
||  a'4 a' a' a'||
||}||

||Dynamics = { ||
||   s4\ppp s s s||
||   s4\fff s s s||
||}||

||\score {||
||  \new Staff <<||
||\new Voice = "SA" { \Music }||  % <-- named voice
||\new Voice { \Dynamics }||
||  >>||

||   \layout {}||
||   \midi {}||
||}||
|||

As you see the above examples are written for version 2.18.2, the latest
stable, but I have tested also in version 2.19.42 without any 
difference.


/Kaj



___
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: MIDI and template for dynamics

2016-05-30 Thread Kaj Persson

Hi Phil,
Thank you for the hint. No I had not tried \new Dynamics, but now I 
have. And sorry, that works even worse. Now there is no dynamic 
difference, even with no name on the \Music voice. It's a pity, because 
when you put the question I got the feeling that, this of course is the 
answer, the developers had snapped the problem and put the solution into 
the \new Dynamics concept.

/Kaj

On 2016-05-30 10:38, Phil Holmes wrote:

Have you tried \new Dynamics { \Dynamics } instead of \new Voice ?

--
Phil Holmes

- Original Message -
*From:* 70147pers...@telia.com <mailto:70147pers...@telia.com>
*To:* Lilypond-User Mailing List <mailto:lilypond-user@gnu.org>
*Sent:* Monday, May 30, 2016 9:28 AM
*Subject:* MIDI and template for dynamics

Hi all,

Using a template for dynamics is a convenient way of writing, when
dealing with voices following the same dynamics pattern. Basically
it works very well for producing beautiful scores, and also
controlling MIDI. But now I have found something that might be a
bug, even if I hope it is just a mistake of mine. Here is a small
example:

|\version "2.18.2"||

||Music = {||
||  a'4 a' a' a'||
||  a'4 a' a' a'||
||}||

||Dynamics = { ||
||  s4\ppp s s s||
||  s4\fff s s s||
||}||

||\score {||
||   \new Staff <<||
|| \new Voice { \Music }||
|| \new Voice { \Dynamics }||
||   >>||

||  \layout {}||
||  \midi {}||
||}|

It produces a nice score and also the MIDI reflects the dynamics.
But, if I name one of the Voices, which I need to for Lyrics, the
score is still fine, but in the MIDI file nothing of dynamics can
be heard. Just one level all the time.

|\version "2.18.2"||

||Music = {||
||  a'4 a' a' a'||
||  a'4 a' a' a'||
||}||

||Dynamics = { ||
||   s4\ppp s s s||
||   s4\fff s s s||
||}||

||\score {||
||  \new Staff <<||
||\new Voice = "SA" { \Music }||  % <-- named voice
||\new Voice { \Dynamics }||
||  >>||

||   \layout {}||
||   \midi {}||
||}||
|||

As you see the above examples are written for version 2.18.2, the
latest stable, but I have tested also in version 2.19.42 without
any difference.

/Kaj


___
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: Re: Chords and what they mean

2015-09-19 Thread Kaj Persson

On 2015-09-19 05:06, Brett Duncan wrote:

On 19/09/15 8:49 AM, Kaj Persson wrote:
As you wrote Csus ought to mean that the first third is removed, and 
nothing else. Among professional musicians, which I am not, but I 
have friends who are, this is not the whole truth, there exists a de 
facto standard which does not exactly coincide with the pure logical.
Not exactly - there are several conventions used by musicians, with a 
wide range of similarities and differences, but there is no one 
standard, de facto or otherwise.


Csus is one example, C5 another. So when I work with these people i 
will use their methods and system, not trying to introduce something 
else (more "clever"). Therefore it would be fine if one could adapt 
LP to the current situation.
Well, in this instance that might seem reasonable, where we are only 
talking about simple chords, but where the chords are more complex or 
follow some other convention, adapting LP might prove a lot more 
difficult. For example, a lot of jazz charts follow a widely used 
convention where minor chords are denoted with a minus sign and 
augmented chords are denoted with a plus sign, i.e.  F-7, G+. But LP 
uses these symbols in \chordmode for alterations.


But this all just points to the fact that there is a distinction 
between how chords are entered and how they are displayed. And given 
that the same chord can be displayed several different ways, that 
distinction cannot really be avoided. For my own purposes, the default 
chord names generated by LP are far from ideal, so like many I have a 
separate file of chord exceptions that I include when I need it. So 
long as the input method allows me to create the chords I need in a 
reasonably way and I can get the output to appear as I need it to, 
there is no need to make the input take the same form as the output.


Brett


Yes, you are completely right, Brett and David. Also, I myself was 
wrong, when I used the term de facto standard. I should have developed 
my discussion a wee more. You might say that the world of music and 
musicians is like an archipelago, with a lot islands. On every of these 
islands they speak their own language, or at least dialect, and 
everybody there understands everyting, as they have common way of 
talking. You might say there is a de facto standard of how to 
communicate. But if you come to another of the islands, you will find 
another vocabulary, which everybody on that island understands. They too 
have a de facto standard, but another one. The standard is not global, 
so some of you would say there is no standard. But such is life 
elsewhere too. Do not tell an American that he/she does not follow a 
standard because he/she measures in inches while most of we others use 
meters. So there are de facto standards in the music world too, and as 
long as you are in one of these islands, which some of us call contexts, 
it is practical to use adapted tools. That makes life easier.


On the other hand, when you are skilled enough, you can use the global 
standard, almost as quickly as the local one, and you make the 
transformations in your head, like American scientists who hardly use 
inches and gallons in their job, but instead the established SI-units.


As you might understand, I here consider the LP way of interpreting the 
symbols the "global" standard (we forget Sibelius and the others), while 
many of us live on our own island, where it might being an aid to use an 
adapted tool. However skilled people like Brett do not need them, they 
fix that in their brains.


Much of my thoughts came from the happiness I felt, and this is not a 
very long time ago, when I first discovered that I can put chord symbols 
direct into LP in chordmode, but also the disappointment I felt when I 
found the deviations. I guess that once in the future, with even more 
experience, I can talk like Brett, and say: I do not need the adaptions 
any more.

/Kaj

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


Re: Re: Chords and what they mean

2015-09-18 Thread Kaj Persson

On 2015-09-18 21:39, Thomas Morley wrote:

2015-09-18 21:20 GMT+02:00 Blöchl Bernhard <b_120902342...@telecolumbus.net>:





Am 18.09.2015 19:53, schrieb 70147pers...@telia.com:

...

Csus means  it would be fine, if I
could define this once, and then use my definition(s) when entering
the music, instead of, like today, having to enter Csus4 or c:1.4.5,


Do you use a different program?
I checked c:1.4.5 and get  and not  as you claim!
Are you really working with lilypond or are you trolling?


to not get  which LP says is the definition.


Where did you find this definition??? Please simply check anything yourself
before encumbering!

\version "2.19.25"

theMusic =chordmode {
   c:1.4.5
   c:sus4
}

\layout {
   ragged-right =#t
}

<< \context ChordNames \theMusic
\context Voice \theMusic



I love all LP users and I do not want to be unpolite - but
R-T-F



Well, (re-)reading docs is always good advice, but I'm pretty sure
from his other posts, he did already.
More thoroughly than others.

Though, yes, Kay could have provided some more code example(s).

But, did you (re-)read his posts, trying to understand?



Anyway, I understood him as follows:

He tried
% 1
\chordmode {
 c:sus
 c:5
}
and was surprised by the printed output.

Which actually can be achieved by entering
% 2
\chordmode {
 c:sus4
 c^3
}

And now he asks whether inputting % 1 can be made to return what % 2 does.


And now I'm thinking about it ...

-Harm


Yes, one should never take things for granted. Now I tried to be 
concise, not using too many words, but obviously it was too short and 
brief. But Samuel and Harm did exactly express what I meant and should 
have written. So thank you Bernhard for trying to understand my thoughts 
even if expressed so dimly.


By the way, as I said before, I am not that clever, and familiar with 
all these advanced ways of expressing oneself, so your shorthand message 
is a first time experience for me. A try to use my imagination could 
maybe be something like Read-The-???-Manual, but this is just a guess. 
If so, I can really tell that I have read it, but there are so many 
possibilities with LilyPond, that the more special ones are often hiding.


I was late, so i did not see that you, Bernhard, had already sent 
another post, but Kieren has very clearly answered exactly the way I 
would have done. Being a computer engineer (correct?) (so am I), you are 
perhaps used to compilers, which by necessity must be very strict in 
dealing with the code, and you might think this naming of chords is a 
non consistent way of writing. As you wrote Csus ought to mean that the 
first third is removed, and nothing else. Among professional musicians, 
which I am not, but I have friends who are, this is not the whole truth, 
there exists a de facto standard which does not exactly coincide with 
the pure logical. Csus is one example, C5 another. So when I work with 
these people i will use their methods and system, not trying to 
introduce something else (more "clever"). Therefore it would be fine if 
one could adapt LP to the current situation.

/Kaj

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


Re: Chords and what they mean

2015-09-17 Thread Kaj Persson

Den 2015-09-17 11:33, skrev Thomas Morley:

2015-09-17 11:13 GMT+02:00 David Kastrup <d...@gnu.org>:

Thomas Morley <thomasmorle...@gmail.com> writes:


2015-09-17 10:47 GMT+02:00 Simon Albrecht <simon.albre...@mail.de>:

Hello Kaj,

On 17.09.2015 09:27, 70147pers...@telia.com wrote:

First I will declare, that I am not 100 percent sure this is a bug, but
friends of mine, musicians, say it probably is. Also, as I am not an expert,
I have tried to learn by searching on among others Wikipedia.

It is about chords, a few of them. It started when I should clean write a
score from a manuscript. In one measure there were noted two chords, C5 and
C. Obviously not the same, as they stood just beside of each other. A search
on Wikipedia also told me, and this was also confirmed, the author's
intention, that C5 means C(no 3), hence , while the chord C means . But LilyPond treats these two the same and produces the same notes. This
is also clearly said e.g. in Appendices A.1 and A.2 of Notation Reference,
as well as in the text part. However even if possibly a correct procedure,
is it a correct practise?

Another such discrepancy is about Csus, which Wikipedia (and my friends)
says is equivalent to Csus4, hence . But LilyPond produces ,
hence what should come from the notation C5 as in the previous paragraph.

So, what is the truth?

There are others who are more into the subject, but I may say:
There is no ‘truth’. With chord names, there are so many different
conventions and fiercely defended convictions that it’s impossible to define
a single ‘standard’ naming scheme. (Edit: just like the NR says)

Very true.
It's a mess, but LilyPond can handle it. ;)


Many things in the chords rendering may be overridden in LilyPond. In case
you’re not aware yet, check out
<http://lilypond.org/doc/v2.18/Documentation/notation/displaying-chords#customizing-chord-names>
and perhaps the LSR <http://lsr.di.unimi.it>. If that doesn’t cover your
wishes, you may come back with a code example, I’d suggest.

HTH, Simon

chrds =
\chordmode {
 \set chordNameExceptions =
   #(append
  powerChordExceptions
  ignatzekExceptions)
 c:1.4.5
 c:1.5
 \notemode {
 <c' f' g'>
 <c' g'>
 }
}

<<
 \new Staff \chrds
 \new ChordNames \chrds
If it's not sufficient you can set your own 'exceptions' for
chord-naming, see the links Simon provided.

I think you are talking past each other.  Kaj complained about how
LilyPond converts \chordmode input into notes, you explain how to change
LilyPond's conversion of notes to markups in a ChordNames context.

We could create an exception for c:5 (like we do for c:13 which drops
the 11th step).  I think that's a reasonable suggestion on its surface
and c:5 is not likely to be in much use exactly because it is equal to c
on its own.  However, it would beg the question of how to interpret c:5+
and c:5- then.  Those aren't redundant.

--
David Kastrup

Obviously I still don't understand.

For me the following looks as wished for Staff and ChordName context:


chrds =
\chordmode {
 \set chordNameExceptions =
   #(append
  powerChordExceptions
  ignatzekExceptions)
 c:1.5
 c^3
}

<<
     \new Staff \chrds
 \new ChordNames \chrds

@Kaj
Could you provide an example to illustrade?

Cheers,
   Harm
Well, an example is not that easy, since what I got was a sheet with 
just a piano staff and a line of chords above it. It might be 
illustrated like this:




where C5 should mean (according to the author/composer)  and Csus 
.


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


Re: Putting lyrics below its staff?

2015-05-28 Thread Kaj

Hi Noeck

Sorry for a late answer. I have been away from home and not being able 
to read my e-mail.


On 2015-05-23 20:41, Noeck wrote:

Hi Kaj,

in general you are right: In case there is only one expression,
duplicating the 'brackets',   or { } is not needed. You can even
write a single note without brackets:
\new Staff a
but of course not two:
\new Staff a b

At the top level you need something to tell LilyPond that this is music
(\new Staff in the examples above or braces) and not lyrics or commands
or something else:
{ a }
simply writing
a
is not enough.

Your code does not compile and it looks a bit strange.
Well, not strange. Now I see the example is not complete. It is an 
extract from the complete code, which was discussed earlier in the 
thread. Outside the \score block there are definitions of the different 
music parts \mE etc and text parts \tE etc. Another point is that I 
found a strange behaviour in my original version for LilyPond 2.18.2. 
However I also noticed that my example is working fine in LP version 
2.19.20, so the bug I discovered is nowadays corrected.

While you are
right concerning redundant brackets, I wonder why you have staves inside
of voices?
The reason is the original question which dealt with how to get the 
lyrics below a staff appearing not at the beginning but later in the 
music. My original problem was that the lyrics showed up between the 
staves, while I wanted it below its respective staff. The lyrics text is 
not the same for the two staves. This lead to some different suggestion, 
while the final one from Carl was the one really working. However he 
suggested these doubled braces and angles, which I could not think are 
necessary, and you also agreed upon. I think that I understand this now. 
Thank you.

I put a different example here and I comment some of the brackets

\new ChoirStaff  % needed because of 2 staves
   \new Staff  % needed because of 2 voices inside staff
 \new Voice = vA { a b } % {} needed because multiple notes
 \new Voice = vB { c d }
 \new Lyrics \lyricsto vB { Hel -- lo }
   
   \new Staff { e f }  % no  needed because only one voice
Does that make sense to you?
Yes, this example works fine for me, even if it does not really deal 
with the original question.


Cheers,
Joram


Thanks everybody for your hints and suggestions, which have finally lead 
me to a working knowledge.

/Kaj

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


Re: Re: Putting lyrics below its staff?

2015-05-21 Thread Kaj Persson


On 2015-05-21 15:30, tisimst wrote:

Kaj,

On Thu, May 21, 2015 at 2:05 AM, Kaj [via Lilypond] [hidden email] 
/user/SendEmail.jtp?type=nodenode=176853i=0 wrote:


I am working on a piece of choir music. It consists of two parts,
the first of which is written on one staff, and the second two
staves. The upper staff in part two is a continuation of the staff
in part one. All the staves are accompanied with lyrics. My wish
is that this lyrics should be written below its respective staff.
However, whatever I do, the lyrics for the lower staff in part
two, which I denote C, is written above the staff, hence directly
below the lyrics for the upper staff (B). I suspect there should
be a simple solution for this, and in the handbook they say that
the lyrics is normally written below the staff. To get it above
the staff you would have to do some overrides.

In the code you can see the commented lines, which are part of all
the tries I have done, but nothing seems to help. To me it almost
looks as if the behaviour is hard coded, just because of putting
the lyrics between the staves is the normal. After an experience
like this I feel strengthened in a thought, grown in my head, that
LilyPond will never ever be a tool for everybody. It is too
complicated and inconsistent to be used by anybody else than the
absolute top expert. Which is a pity, as it produces an excellent
result.

This is the result of my efforts so far:

\version 2.18.2

\paper { ragged-right = ##t }

mA = \relative c' { c4 d e f }
mB = \relative c'' { g4 a b c }
mC = \relative c' { c'4 b a8 g f4 }
mAB = \relative c' { c4 d e f g4 a b c }

tA = \lyricmode { A B C D }
tB = \lyricmode { E F G H }
tC = \lyricmode { i j k l m }
tAB = \lyricmode { A B C D E F G H }

xA = { s1*1 \break }
xB = { s1*1 }
xC = { s1*1 }

\score {
  \new ChoirStaff
  
\new Staff = sAB {
  
\new Voice = vAB { \mAB }
{
  \new Voice = vA { \xA }
  
\new Voice = vB { \xB }
\new Staff = sC {
  \new Voice = vC { \mC }
}
  
}
  
}
\new Lyrics = lAB \lyricsto vAB { \tAB }
\new Lyrics = lC \with {
% alignBelowContext = #sC
% \override VerticalAxisGroup #'staff-affinity = #UP
}
{ \lyricsto vC { \tC } }
  

  \layout { indent = #0 }
}

/which produces this:/

/Kaj


I think LilyPond is just getting confused by all the nested 
voices/staves. As Phil suggested, a little restructuring of your 
example score can bring a nice solution to light:


\version 2.18.2

mA = \relative c' {
  c4 d e f | \break
  g a b c
}
mB = \relative c'' {
  s1 |
  c4 b a8 g f4
}
tA = \lyricmode { A B C D E F G H }
tB = \lyricmode { i j k l m }

\score {
\new ChoirStaff 
\new Staff {
\new Voice = vA \mA
}
\new Lyrics \lyricsto vA \tA
\new Staff \with {
\RemoveEmptyStaves
\override VerticalAxisGroup.remove-first = ##t
}{
\new Voice = vB \mB
}
\new Lyrics \lyricsto vB \tB

\layout {
indent = 0
  }
}

There are a few things I'd point out:

 1. All \new Staff declarations are only within the ChoirStaff
 2. Each staff gets its own voice and the second voice gets a spacer
rest before its notes.
 3. The second staff's empty measures are removed via two overrides
\RemoveEmptyStaves and \override VerticalAxisGroup.remove-first = ##t
 4. Each set of Lyrics is placed immediately after its staff so there
is no need to direct it above or below anything

I hope that this provides a clearer logic to how to construct a score 
that is quite obvious to what's happening (to the user) and relatively 
mistake-proof in interpretation (for LilyPond).


Regards,
Abraham


View this message in context: Re: Putting lyrics below its staff? 
http://lilypond.1069038.n5.nabble.com/Putting-lyrics-below-its-staff-tp176837p176853.html
Sent from the User mailing list archive 
http://lilypond.1069038.n5.nabble.com/User-f3.html at Nabble.com.


Phil and Abraham

Thank you for your comments, and for the example showing a solution to 
my problem. At least it solves this much simplified example. However I 
get an impression it being a fix for just this, so I made an, a wee 
more complicated, but never the less much realistic example. Sorry, of 
course it will occupy a lot of valuable space on this mailing list, but 
to illustrate my thought I see no other way to go. It shows a case with 
several regions with note systems containing more than one staff, but 
with regions between them with just one staff. Generally there could of 
course also be a base system with a number of staves, more than one, 
which is expanded with excess staves. It follows a quite simple 
algorithm, inspired

How do I extract individual voices from chords

2015-03-21 Thread Kaj

Hello everybody,

I have a piece of music for three choir voices (Soprano Alto Baritone). 
It is written almost solely as chords with one, two or three voices. 
With one voice, everybody is singing that one, with two the sopranos 
sing the top notes and the others sing the lower voice. My wish is to 
produce a MIDI output for each one of the three voices, for educational 
purposes, and possibly also a part score for each of them. But how do I 
do this at best?


I have tried to separate the three manually by means of regular 
expressions in emacs. You could possibly do so also with regular 
expressions in Frescobaldi, but I find emacs easier to use. The whole 
task is nevertheless a wee cumbersome. Moreover with this method you 
have to take care of two different versions of the music code, one based 
on chords, and one on separate voices, and this causes maintenance issues.


My first thought was that the separated version with three different 
voices could be sufficient, but I soon realized that, when the pitch 
from two voices are equal, both are printed side by side. This is of 
course quite normal and desirable, but in my special case I would 
suppress that behaviour. When the pitch and duration from two different 
voices are the same, only one should be printed. Is there any workaround?


Or: How do I extract the first, second and third voice from the chord 
score to use as input to the midi?


A simplified example illustrating the case:






\version 2.18.2

% NB. These \layout items are only for the positioning of the headings 
in the example

\layout {
\override Score.RehearsalMark #'self-alignment-X = #LEFT
\override Score.RehearsalMark #'Y-offset = #4
\override
}

All = { c' e' g'8 d' f' a' e' g' f' a'
g'8 a'g' e' c' a' f' d'
}
Soprano = { g'8 a' g' a' g' a' c' d' }
Alto = { e'8 f' g' a' g' a' e' f' }
Baritone = { c'8 d' e' f' g' a' g' a' }

% First score is to illustrate the chord version
\score {
\new Staff {
\mark This is what I want...
\new Voice {
\All
}
}
\layout {}
}

% Second score illustrates the three voices separated
\score {
\new Staff {
\mark ...but I get this.
\new Voice {

{ \Soprano }
{ \Alto }
{ \Baritone }

}
}

\layout {}
\midi {}
}

p, li { white-space: pre-wrap; }
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Spacing Cheat Sheet

2015-03-12 Thread Kaj

Hi Joram,

Yes, of course, I can say now after your replay and explanation. Why 
didn't I see this myself?  For what you point out, of course I have seen 
this with hierarchy and different kinds of staff grouping a lot of times 
when reading the documentation. But I did not realize the consequences 
of my reading. Your are a good teacher, and also a wee of mind reader, 
which probably is one important making of being a successful teacher. 
What you pointed out is exactly my case: no StaffGroup but ChoirStaff 
and PianoStaff. So of course I my efforts to move the staves had no 
effect by just copying from your sheet. Now I can say of course, but I 
did not realize this. Your explanation has opened my eyes, and I have 
come a few steps further towards the true understanding. Thank you!


Kaj

On 2015-03-12 01:31, Noeck wrote:

Dear Kaj,

you are brave to really dig through all this! That's a good thing. I
think I can help you here, too:

It is correct (and it works like expected) if you do
\override StaffGroup.StaffGrouper.staff-staff-spacing.padding = 30
like I wrote. But only (!) if your grouping context is a StaffGroup. In
case you have a PianoStaff or a ChoirStaff or anything else, you need to
override the property of that context. I.e.
\override PianoStaff.StaffGrouper.staff-staff-spacing.padding = 30
and the like.
There is a context hierarchy in LilyPond: A lower level context (e.g.
Voice) can be inside a staff, which can be inside a staff group, which
can be inside a score. Of course more complex nesting is possible.
The important thing for you is: The inner contexts inherit (take the
overrides) from the outer contexts. In your case, if you override the
StaffGrouper of the Score, that overrides the spacing for any
StaffGrouper in the Score. If you override the spacing for the
StaffGroup (and similar), only this kind of group is affected and if you
do so in the \with statement, only this particular context is affected.

Here is an example showing some possible overrides:

\version 2.18.2

\layout {
   % no effect because there is no StaffGroup
   % only PianoStaff and ChoirStaff
   \override StaffGroup.StaffGrouper.staff-staff-spacing.padding = 60
   % this works for the piano staff (upper group)
   \override PianoStaff.StaffGrouper.staff-staff-spacing.padding = 15
   % this works for all groups but the PianoStaff has more specific
   % settings which are used instead
   \override Score.StaffGrouper.staff-staff-spacing.padding = -2
   \override Score.StaffGrouper.staff-staff-spacing.basic-distance = 0
}

  
   \new PianoStaff 
 \new Staff { a }
 \new Staff { b }
   
   \new ChoirStaff 
 \new Staff { c }
 \new Staff { d }
   
   \new PianoStaff \with {
 % this override only affects this second piano staff
 % overriding the Score and PianoStaff overrides from
 % the layout block above
 \override StaffGrouper.staff-staff-spacing.padding = 4
   } 
 \new Staff { e }
 \new Staff { f }
   
  

Don't hesitate to ask again if things are still unclear.

Cheers,
Joram



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


Re: Spacing Cheat Sheet

2015-03-11 Thread Kaj

Hi Joram,
Time has gone since you helped me to understand the vertical spacing 
mystery in LilyPond. Well I am not ready yet for the big battle, but a 
lot has been clear since. And a lot of thanks for your very valuable 
sheet compiling the different items. But not always I have got things 
work the way I wished, and more than once I have been ready to give up 
the LilyPond project. Today I found something in your sheet loosening a 
lot of knots. I think a small mistake has slipped into it. The left 
column, lower part, says \override 
StaffGroup.StaffGrouper.staff-staff-spacing.padding = #2. At first this 
sounds reasonable, but I think that StaffGroup should be substituted 
with Score. Reading the Internals Reference confirms that the context 
StaffGroup does not create the grob StaffGrouper and also that 
StaffGrouper is not created by any engraver. Well, I am not the person 
to account for all this, but after reading the Notation Reference 
(http://lilypond.org/doc/v2.18/Documentation/notation/flexible-vertical-spacing-within-systems#spacing-of-grouped-staves) 
and the example there, I feel encouraged to announce my experience. My 
case worked with context Score but not with StaffGroup.


The next line however: \override Staff.VerticalAxisGroup etc is 
perfectly correct as VerticalAxisGroup is created by Axis_Group_Engraver 
which belongs to the context Staff. Possibly the context Staff could 
also be use in the previous case, but I have not tested this.


Best regards
Kaj

Den 2015-02-21 14:04, skrev Noeck:

Hi Kaj, hi Lilypond users,

I also would like to say that again that spacing is a bit daunting. But I hope
with the help you got here, it is possible to adjust the spacing you need. The
deeper understanding will come with time and it is difficult if one wants to
understand everything at once.

To make the use of spacing settings easier, I put the most relevant settings on
this page:
http://joramberger.de/files/LilypondSpacing.pdf

The aim of this is not to explain everything – that is better done in the docs –
but to give a visual summary of the spacing settings and an example (on the
left) how to change them. If you know that there are different settings in the
paper and in the layout block and that there are fixed distances (in mm, cm, in)
and flexible spacings (minimum-distance, basic-distance, padding,
strechability), then this cheat sheet should make it easier to adjust all these
to your liking.

Cheers,
Joram

PS: Lyrics and other nonstaff spacings are to be done.





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


Re: Spacing Cheat Sheet

2015-02-21 Thread Kaj

Thanks Trevor!
So this with stretching demands to be the next thing to put your teeth into.
/Kaj

Den 2015-02-21 23:15, skrev Trevor Daniels:

Kaj wrote Saturday, February 21, 2015 9:10 PM


One thing (among others) I still do not understand: why are there three
keys describing the distance between staves and systems? In the Notation
Reference
(http://www.lilypond.org/doc/v2.18/Documentation/notation/flexible-vertical-spacing-paper-variables#structure-of-flexible-vertical-spacing-alists)
one tries to describe how they are defined. But, if I understand it
correct, the effective (resulting) distance will always be the biggest
of the three, hence
 effective_distance = max(minimum-distance; basic-distance; padding).
Is there any reason to use three, one should be sufficient. If they were
adding like
 resulting_distance = minimum-distance + basic-distance + padding
this could motivate the number, but I cannot read this from the manual.

That is only true if the page has a ragged bottom.  In that case no
stretching or compression is required, and the various spacings are set at
their natural values, specified by the effective_distance you show above
(plus anything needed to avoid collisions).

However, if ragged-bottom = ##f, the spacing between the various
elements on the page needs to be adjusted so the page is exactly
filled.  That is when all four parameters come into play, as described
on the page you reference above, to control the amount of stretching
or compression required, and how it should be distributed between
the elements on the page.

Trevor



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


Re: Spacing Cheat Sheet

2015-02-21 Thread Kaj

Hi Kieren!

Thanks for the info.

You might be correct in what you suggest. However so far I have not seen 
any complete description of stretchability. There are some words in the 
paragraphs about Structure of flexible vertical spacing alists (the 
link I gave in my previous note), but those are for the experts, who 
already know how it works. The novice does not understand, since the 
description contains holes, where info is lacking or implied.


Kaj

Den 2015-02-21 22:27, skrev Kieren MacMillan:

Hi Kaj (et al.),


if I understand it correct, the effective (resulting) distance will always be 
the biggest of the three, hence
effective_distance = max(minimum-distance; basic-distance; padding).
Is there any reason to use three, one should be sufficient.

If I understand correctly, three are required for compression and expansion 
calculations.

For example, consider

   ((basic-distance . 4) (minimum-distance . 2) (padding . 1) (stretchability . 
10))

When compressing a page, I believe #'stretchability is applied [inversely] 
against

 basic-distance - miminum-distance

which in this case is 2 staff spaces. If instead you had

   ((basic-distance . 2) (minimum-distance . 2) (padding . 2) (stretchability . 
10)),

I believe there could/would be no compression done.

Others (e.g., Keith) will have a more complete and accurate understanding of 
the intricacies of the spacing model — hopefully someone will chime in here to 
expand upon or correct what I’ve said.

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: Spacing Cheat Sheet (was: How to increase the distance between systems?)

2015-02-21 Thread Kaj

Hi Joram!

I will say that compilations and overviews like this are most valuable 
and usable tools for people (like me) in the state where the different 
objects and concepts begin to come out of the shadows, but still you do 
not know the connections between them or their exact roles. So thank you 
very much. The sheet has got its deserved place on the wall ahead of me 
and the computer.


One thing (among others) I still do not understand: why are there three 
keys describing the distance between staves and systems? In the Notation 
Reference 
(http://www.lilypond.org/doc/v2.18/Documentation/notation/flexible-vertical-spacing-paper-variables#structure-of-flexible-vertical-spacing-alists) 
one tries to describe how they are defined. But, if I understand it 
correct, the effective (resulting) distance will always be the biggest 
of the three, hence

effective_distance = max(minimum-distance; basic-distance; padding).
Is there any reason to use three, one should be sufficient. If they were 
adding like

resulting_distance = minimum-distance + basic-distance + padding
this could motivate the number, but I cannot read this from the manual. 
Nor does your very good sheet give a definite answer. So I do not see 
the reason. Historical maybe?


Kaj

Den 2015-02-21 14:04, skrev Noeck:

Hi Kaj, hi Lilypond users,

I also would like to say that again that spacing is a bit daunting. But I hope
with the help you got here, it is possible to adjust the spacing you need. The
deeper understanding will come with time and it is difficult if one wants to
understand everything at once.

To make the use of spacing settings easier, I put the most relevant settings on
this page:
http://joramberger.de/files/LilypondSpacing.pdf

The aim of this is not to explain everything – that is better done in the docs –
but to give a visual summary of the spacing settings and an example (on the
left) how to change them. If you know that there are different settings in the
paper and in the layout block and that there are fixed distances (in mm, cm, in)
and flexible spacings (minimum-distance, basic-distance, padding,
strechability), then this cheat sheet should make it easier to adjust all these
to your liking.

Cheers,
Joram

PS: Lyrics and other nonstaff spacings are to be done.






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


Re: Re: How to increase the distance between systems? (new try) (7)

2015-02-20 Thread Kaj Persson

Hi Paul,

I think that aids like this are very valuable to lead the novice past 
all the pitfalls surrounding her/his way towards the bigger 
understanding. At first you just use it, finding it a good help, which I 
will do now. Later on by investigating how it works, it also leads to a 
better insight. Of course this accompanied with studying the different 
manuals available.


Thank you very much for your assistance on my wobbly learning path.
Kaj

Den 2015-02-20 02:27, skrev Paul Morris:

Hi Kaj,

In my experience adjusting vertical spacing in LilyPond can be particularly
complicated and low-level.  I wrote an include file to simplify things.
You can read about it and access it here:

https://github.com/openlilylib/openlilylib/tree/master/notation-snippets/scale-vertical-spacing

Basically it lets you scale the default spacing values and spares you from
having to decide whether to adjust padding, basic-distance, or
minimum-distance.  Usually you just know you want more or less spacing
somewhere and you don't really care about how LilyPond does it.

Cheers,
-Paul




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/How-to-increase-the-distance-between-systems-new-try-tp172032p172106.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: How to increase the distance between systems? (new try)

2015-02-19 Thread Kaj
Yes, thank you! You gave me the solution, and it works fine. My question 
to myself is how I could miss that in my searching through the manuals. 
But the first things making you blind are the eyes.


However, Joram. Your suggestion to use 
default-staff-staff-spacing.basic-distance did not work for me. I have 
tried it in different places: in the \layout block inside the \score 
block (as in the example), in a \layout block outside the \score and 
also inside a \with block appended to the first \staff. Nowhere it had 
any effect, but on all these places the sentence without default- did 
work as intended. So there must be something I have missed. Yes, I 
admit, I do no quite understand the short explanation in the manual.


So thank you all: Joram, Simon and Stephen for your valuable help.

Kaj

On 2015-02-18 15:49, Kaj wrote:
Sorry, the code example became totally distorted in the previous try, 
so here it is again:

---
I have tried to find in the manuals180 how to increase the distance 
between systems in the same score. I have found how to control the 
distance between individual staves inside the system, but not between 
systems. In my real task I want to fill the page. I see there is 
plenty of room below the last system, but I cannot find out how to get 
the score to expand. I also want to use the tagline at the bottom, but 
this should not have any impact.


Here is a simple example:

\version 2.18.2

\score {
  
\new StaffGroup

  \new Staff
  { c'1 e'1 \break g'1 b'1 }
  \new Staff
  { d'1 f'1 \break a'1 c''1 }

  

  \layout {
indent = #0
ragged-right = ##t
%\override Staff.VerticalAxisGroup #'staff-staff-spacing = 
#'((basic-distance . 15))

  }
}



If you remove the comment sign (%) from the \override sentence at 
the end of the code, the space between the staves increases, but what 
to write to make the same happen between the two systems? Reading the 
manual make me think, that possibly staffgroup-staff-spacing could 
be the solution, but I have had no success so far. I have tried, I 
think, all combinations of contexts and grobs, but none has been 
successful.


By the way, I also found a discrepancy between the manual and the real 
life. According to the manual (e.g. chapter 4.4.1 in the Notation 
Reference) the override sentence could also be written like:


|\override Staff.VerticalAxisGroup #'staff-staff-spacing 
#'basic-distance = #15 |


but this did not succeed for me. I did also test the modern way of 
writing with dots between the keywords, but with no effect.


Kaj



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


Re: How to increase the distance between systems? (new try)

2015-02-19 Thread Kaj

Hello Joram!
Sorry for misspelling your name! I saw it first when the e-mail slipped 
away. /Kaj


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


Re: How to increase the distance between systems? (new try)

2015-02-19 Thread Kaj

Hello Noram!

The fog is slowly moving away from my eyes, even if it is not clear day yet.

I see why I did not succeed with default-staff-staff-spacing. I was 
checking only in my grouped system, as this is my current environment 
and will be so for a long time, as I am pottering about choir music.


Your explanation shows a theoretically clean interface to grouped and 
not grouped staves. But obviously VerticalAxisGroup will do the job much 
as good as StaffGrouper also when the staves are grouped, even if this 
might be against the designed rule. Question is if this causes a 
disadvantage compared to the correct solution. When I have learned 
more about LilyPond I maybe can answer this myself, but for now I have 
climbed just a small piece up on this long and steep uphill slope, which 
one has to walk to learn this program.


Thank you for your explanation. It helped me a good deal.
Kaj

Den 2015-02-19 12:39, skrev Noeck:

Hi Kaj,

these spacing settings are very flexible but also quite complicated. The manual
indeed explains this. But I try to make it easier for your case. This works for 
me:

\version 2.18.2

\layout {
   indent = #0
   ragged-right = ##t
   % staves setting
   \override Staff.VerticalAxisGroup.default-staff-staff-spacing.basic-distance 
= #20
   % staffgoup setting
   \override StaffGroup.StaffGrouper.staff-staff-spacing.basic-distance = #15
}

% staves
\score {
   
 \new Staff { c'1 e'1 }
 \new Staff { d'1 f'1 }
   
}

% staff group example
\score {
   \new StaffGroup 
 \new Staff { c'1 e'1 }
 \new Staff { d'1 f'1 }
   
}

In the first case (staves combined with   without grouping), the
VerticalAxisGroup of the Staff (or higher level objects like the Score) is
responsible. Here is one exception from other x-y-spacing settings: In this
case, the staff-staff-setting is a function that should not be overwritten (and
throws an error if it is). This function combines different settings, one of
them being default-staff-staff-spacing.

In the second case (any kind of StaffGroup), the StaffGrouper is responsible for
vertical distances between staves in this staff group.

Is it clearer now?

Cheers,
Joram


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


Re: How to increase the distance between systems? (new try) (7)

2015-02-19 Thread Kaj

Hi Joram!

I would lie if I said that I now understand it all. No, on the contrary, 
you have made the learning mountain even higher and the slope even 
steeper. After reading your latest e-mail, I went back to the Notation 
Reference and the Internals Reference to get more information. But there 
is so much! LilyPond is really not easy to learn. A million of functions 
with as many properties, yes that is what they seem to. Often, for a 
non-expert as me, it looks to be different routines for almost the same 
thing. See e.g. all different text handlers. I am at the beginning to 
perceive some kind of pattern, not understand, but to accept which unit 
is connected to which task.


Well, end of complain section. I saw,  exactly as you pointed out, that 
I was wrong in the assumed equity between the two ways of writing the 
assignments. Just the opposite of what I thought, that the other keys in 
the a-list were unaffected they are zeroed, or more correct reset to 
their default-when-unset values, which most often is zero. This is a new 
learning. Possibly I have come across the text in the manual before, but 
then I was not ready to assimilate it. At that moment I was searching 
for more elementary info. And so it will continue until I have learnt 
enough to feel that I can use the program, and it is a well known tool.


At least one more question remains: If I now has redefined the a-list 
and assigned a zero to the keys minimum-distance and padding, but put a 
reasonable value to basic-distance, how can this make the function 
(grob) to work as if it were another one? VerticalAxisGroup does the job 
it should not be able to do, but instead StaffGrouper should. 
Demonstrably I was able to change the distance between the staves inside 
the system by the means of VerticalAxisGroup while StaffGrouper is the 
one which actually should do that job. Yes, I know that you tried to 
give an explanation, but, sorry to say, it was much above my head.


Nevertheless, thank you very much for your try.
Kaj

On 2015-02-19 19:12, Noeck wrote:

Hi Kaj,


These two ways of writing, should be equivalent:
 \override Staff.VerticalAxisGroup.staff-staff-spacing = #'((basic-distance 
.
15))
 \override Staff.VerticalAxisGroup.staff-staff-spacing.basic-distance = #15
but they are not.

No, because in the first line you set the spacing to (basic-distance . 15), i.e.
you remove the function which is there by default and replace it with an alist.
If you replace this function with an alist #'((...)), it works again, but you’ve
lost the flexibility that this function offers.
In the second case you try to override the basic-distance property of the
staff-staff-spacing. But because this is a function, it has no such property.
That’s where the error occurs.

If there was no function involved here, it still is different because in the
first case you have only one spacing setting (basic-distance is 15) and thus you
remove all others (padding and so on). In the second case you keep all the other
settings in the alist and just override the basic-distance.

What is indeed the same (and failing in both cases for the reason above) is:
\override Staff.VerticalAxisGroup #'staff-staff-spacing #'basic-distance = #15
\override Staff.VerticalAxisGroup.staff-staff-spacing.basic-distance = #15


Probably the possibility will be
closed in the future, when someone has corrected the error.

So I would object here. I think this is no error. What I learned from this
conversation is that naming things that are conceptually different in a
consistent way (like the staff-staff-spacing here) is likely to confuse users.

Cheers,
Joram



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


Re: How to increase the distance between systems? (new try)

2015-02-19 Thread Kaj

Hi Joram!

Yes, you are right!

But so am I. And this might be because of a possible bug I have 
discovered, and which I described in the last paragraph in very first 
(and, well second, because I corrected the code paragraph which was 
distroyed during the first transmission).


These two ways of writing, should be equivalent:
\override Staff.VerticalAxisGroup.staff-staff-spacing = 
#'((basic-distance . 15))
\override 
Staff.VerticalAxisGroup.staff-staff-spacing.basic-distance = #15

but they are not.

In my example, I used the first way of writing, since I did not get the 
second format to work. And this is of course because of the conditions 
you have so instructively**described. But at that time I did not know 
anything about that. However I observed that by chosing the first format 
I could change the staff to staff distance, and this still works, also 
in your example. If I use the first format that can replace the 
StaffGrouper sentence:

\override StaffGroup.StaffGrouper.staff-staff-spacing.basic-distance = #15.

Now, however, I understand that this is off the road, and indeed should 
not work, and therefore not ought to be used. Probably the possibility 
will be closed in the future, when someone has corrected the error.


So well, possibly even you have realised something. Thank you for 
showing me the right way...!

/Kaj

Den 2015-02-19 14:21, skrev Noeck:

Hi Kaj,

I don't understand this part:


But obviously  VerticalAxisGroup will do the job much as good as StaffGrouper
also when the staves are grouped, even if this might be against the designed 
rule.

If you comment out the StaffGrouper line in my layout block, you will see that
the VerticalAxisGroup setting does not affect the staves grouped with 
StaffGroup.
The reason why there are two different settings is that you can adjust these
spacings to different values in such a case:

   
 \new StaffGroup 
   \new Staff { c'1 e'1 }
   \new Staff { d'1 f'1 }
 
 \new Staff { d'1 f'1 }
   

Where a staff group is grouped with other non-grouped staves.

Joram


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


How to increase the distance between systems?

2015-02-18 Thread Kaj
I have tried to find in the manuals180 how to increase the distance 
between systems in the same score. I have found how to control the 
distance between individual staves inside the system, but not between 
systems. In my real task I want to fill the page. I see there is plenty 
of room below the last system, but I cannot find out how to get the 
score to expand. I also want to use the tagline at the bottom, but this 
should not have any impact.


Here is a simple example:

|\version 2.18.2 \score {  \new StaffGroup  \new Staff { c'1 e'1 
\break g'1 b'1 } \new Staff { d'1 f'1 \break a'1 c''1 }   \layout { 
indent = #0 ragged-right = ##t %\override Staff.VerticalAxisGroup 
#'staff-staff-spacing = #'((basic-distance . 15)) } } |





If you remove the comment sign (%) from the \override sentence at the 
end of the code, the space between the staves increases, but what to 
write to make the same happen between the two systems? Reading the 
manual make me think, that possibly staffgroup-staff-spacing could be 
the solution, but I have had no success so far. I have tried, I think, 
all combinations of contexts and grobs, but none has been successful.


By the way, I also found a discrepancy between the manual and the real 
life. According to the manual (e.g. chapter 4.4.1 in the Notation 
Reference) the override sentence could also be written like:


|\override Staff.VerticalAxisGroup #'staff-staff-spacing 
#'basic-distance = #15 |


but this did not succeed for me. I did also test the modern way of 
writing with dots between the keywords, but with no effect.


Kaj

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


How to increase the distance between systems? (new try)

2015-02-18 Thread Kaj
Sorry, the code example became totally distorted in the previous try, so 
here it is again:

---
I have tried to find in the manuals180 how to increase the distance 
between systems in the same score. I have found how to control the 
distance between individual staves inside the system, but not between 
systems. In my real task I want to fill the page. I see there is plenty 
of room below the last system, but I cannot find out how to get the 
score to expand. I also want to use the tagline at the bottom, but this 
should not have any impact.


Here is a simple example:

\version 2.18.2

\score {
  
\new StaffGroup

  \new Staff
  { c'1 e'1 \break g'1 b'1 }
  \new Staff
  { d'1 f'1 \break a'1 c''1 }

  

  \layout {
indent = #0
ragged-right = ##t
%\override Staff.VerticalAxisGroup #'staff-staff-spacing = 
#'((basic-distance . 15))

  }
}

||




If you remove the comment sign (%) from the \override sentence at the 
end of the code, the space between the staves increases, but what to 
write to make the same happen between the two systems? Reading the 
manual make me think, that possibly staffgroup-staff-spacing could be 
the solution, but I have had no success so far. I have tried, I think, 
all combinations of contexts and grobs, but none has been successful.


By the way, I also found a discrepancy between the manual and the real 
life. According to the manual (e.g. chapter 4.4.1 in the Notation 
Reference) the override sentence could also be written like:


|\override Staff.VerticalAxisGroup #'staff-staff-spacing 
#'basic-distance = #15 |


but this did not succeed for me. I did also test the modern way of 
writing with dots between the keywords, but with no effect.


Kaj

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


Closing key and two staves on the same line

2015-02-06 Thread Kaj

Is this possible to accomplish in LilyPond?



I have two wishes:

1. To put the short coda on its own staff, but without breaking the 
line. Just a short space to the preceding staff.


2. To put the key signature before the final bar line, so this will be 
the really last bar line on the staff. From a pure musical point of view 
the key change is not necessary, as the segno is situated in a part 
without accidentals (c major) but  I want it as a reminder for the 
musician. Anything I have done so far results in a new measure after the 
closing double bar line where the natural accidental is written.


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


Re: Re: Closing key and two staves on the same line

2015-02-06 Thread Kaj

Wow!

That was a solution! Should never had found it myself, and, to be 
honest, do not understand it neither. Not yet, but I will try to. And 
obviously it works.


So Klaus, danke schön!

Den 2015-02-06 15:22, skrev Klaus Blum:

Hello Kaj,

you can put an empty measure in between and interrupt the staff lines via
\stopStaff and \startStaff.
The huge override section is taken from a snippet, it's needed to have the
natural sign before the double bar line. I hope this helps:


% 

\version 2.18.2

\relative c' {
   
   \override Score.BreakAlignment.break-align-orders =

 ##((left-edge ambitus breathing-sign clef staff-bar
key-cancellation key-signature time-signature custos)

 (left-edge ambitus breathing-sign clef key-cancellation
staff-bar key-signature time-signature custos)

 (left-edge ambitus breathing-sign clef key-cancellation
key-signature staff-bar time-signature custos))
   
   \key f \major

   e4 e e e
   \key c \major
   \bar |.
   \stopStaff
   s1
   \startStaff
   f4 f f f
   \bar |.
}

% 


Cheers,
Klaus






--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Closing-key-and-two-staves-on-the-same-line-tp171496p171499.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: Re: Shortening volta brackets at two (and more) staves

2015-02-04 Thread Kaj Persson

Thank you David!
Yes, this solved my problem, and I am satisfied. It works fine also with 
four staves Choir staff which I will use it for.

/Kaj

Den 2015-02-04 02:50, skrev David Nalesnik:

Hi,

On Tue, Feb 3, 2015 at 4:35 PM, David Nalesnik 
david.nales...@gmail.com mailto:david.nales...@gmail.com wrote:


Hi Kaj,

On Tue, Feb 3, 2015 at 1:37 PM, Kaj Persson kape_...@algonet.se
mailto:kape_...@algonet.se wrote:

In the snippet collection, the Repeats section, there is one
named Shortening volta brackets. I have use for just this,
since in a piece of music I need some extra space in order to
put a mark immediately after the volta alternative bracket. So
I tested it, and, yes, the example promised well. The method
is to work with the variable voltaSpannerDuration via the the
statement:
\set Score.voltaSpannerDuration = #(ly:make-moment 2 4)
This way you can shorten the bracket even down to one single
strike:


But when I expand the system to this, hence two staves instead
of one, this happens:



I'll have to look at this some more, but it seems there is a bug. 
Even in the single staff example, there is a warning: cannot end

volta spanner.  I get this with the snippet you reference as
well.   Possibly there is a flaw in lily/volta-engraver.cc.  And
another possibly: this might be related to what happens in your
multi-staff example.

Yes, there is a problem in the file that defines the engraver.  
Unfortunately, there would need to be a fix to this file to enable you 
to use the property voltaSpannerDuration to give you what you want 
(and this wouldn't be available until the next release).


Fortunately, there is a workaround, though you will need to eyeball 
it to get a good result.  Try this:


 \version 2.18.2

StaffA = \relative c' {
  c4 c c c
  \repeat volta 2 { d4 d d d }
  \alternative {
{
  e4 e e e
}
{
  % Shorten the volta bracket
  \override Score.VoltaBracket.shorten-pair = #'(0.5 . 5)
 % OR:
% \offset shorten-pair #'(0 . 5) Score.VoltaBracket
  f4 r4 r4 r4
}
  }
  \repeat volta 2 {g4 g g g}
}

StaffB = \relative c'{
  c4 c c c
  \repeat volta 2 { d4 d d d }
  \alternative {
{
  e4 e e e
}
{
  % Shorten the volta bracket
  %\override Score.VoltaBracket.shorten-pair = #'(0.5 . 5)
  f4 r4 r4 r4
}
  }
  \repeat volta 2 {g4 g g g}
}

\score {
  
\StaffA
% Remove the comment sign (%) on next line to get two staves.
\StaffB
  
  \layout {
  }
}

%
Hope this helps,
David


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


Shortening volta brackets at two (and more) staves

2015-02-03 Thread Kaj Persson
In the snippet collection, the Repeats section, there is one named 
Shortening volta brackets. I have use for just this, since in a piece 
of music I need some extra space in order to put a mark immediately 
after the volta alternative bracket. So I tested it, and, yes, the 
example promised well. The method is to work with the variable 
voltaSpannerDuration via the the statement:

\set Score.voltaSpannerDuration = #(ly:make-moment 2 4)
This way you can shorten the bracket even down to one single strike:


But when I expand the system to this, hence two staves instead of one, 
this happens:



The compilation works ok, with the message  Success: compilation 
successfully completed. Completed successfully in 1.2. But the volta 
alternative 2 has disappeared, and the figure 2 has moved left, close to 
the first adjacent bracket. In the compilation log there also has come a 
lot of messages: warning: Found infinity or nan in output.  
Substituting 0.0. I can count up to twelve such messages, all together 
just before the Success... message.


I have tested a lot of parameter settings in the ly:make-moment. Nothing 
but 4 4 works when more than one staff, which means the bracket ends at 
the repeat bar in the example above, and you get no shortening of the 
bracket.


My knowledge of programming LilyPond is not good enough to do any 
troubleshooting, so I have to rely on the community to tell if I am 
doing anything wrong and if so what? Else the result might be the 
information that this is the behaviour of this function and there is no 
solution to my task. But at least I can not see any hint of that when I 
read the description of the variable in the Internals Reference.


The LilyPond code producing this is:

\version 2.18.2

voltaLength = {
  \set Score.voltaSpannerDuration = #(ly:make-moment 2 4) }

StaffA = \relative c' {
  c4 c c c
  \repeat volta 2 { d4 d d d }
  \alternative {
{
  e4 e e e
}
{
  % Shorten the volta bracket
  \voltaLength
  f4 r4 r4 r4
}
  }
  \repeat volta 2 {g4 g g g}
}

StaffB = \relative c'{
  c4 c c c
  \repeat volta 2 { d4 d d d }
  \alternative {
{
  e4 e e e
}
{
  % Shorten the volta bracket
  \voltaLength
  f4 r4 r4 r4
}
  }
  \repeat volta 2 {g4 g g g}
}

\score {
  
\StaffA
% Remove the comment sign (%) on next line to get two staves.
%\StaffB
  
  \layout { }
}

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