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: 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: 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 
*To:* Lilypond-User Mailing List 
*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 :





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 :

Thomas Morley  writes:


2015-09-17 10:47 GMT+02:00 Simon Albrecht :

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

and perhaps the LSR . 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 {
 
 
 }
}

<<
 \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: 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 

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: 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