Re: Lyrics in polyphony with ties in second voice

2019-09-30 Thread Carl Sorensen


From: Flaming Hakama by Elaine 
Date: Sunday, September 29, 2019 at 9:41 PM
To: Lilypond-User Mailing List 
Subject: Lyrics in polyphony with ties in second voice


Hi.

I'm hoping someone can help me figure out how to notate this.

I am creating a lead sheet that has vocal line with lyrics.  Some sections have 
just the melody, and other sections have harmonies under the melody.

In general, I have been having success using this pattern for going into and 
out of polyphony, while keeping the lyrics associated with the melody:

melody = \relative c'' {
c1 << { \voiceOne d } { b1 } >> | \oneVoice e1 |
}




I know that this is not what you asked for, because you want the harmony stems 
to go up.

But this is the way I set it; I think it’s clearer, because it points out the 
fact that the tied notes need to be handled differently from the melody notes.

\version "2.19.80"

words = \lyricmode {
One, two and three four
}

melody = \relative c'' {
\time 3/4
g2.^"Use partcombine and NullVoice" | g8 a f2 ~ | 2. | e2. \bar "|."
}

harmony =  \relative c'{
\time 3/4
s2. |
2. ~ | 2.
}


combined = \partcombine \melody \harmony





\book {
\header { title = "Use partcombine and NullVoice" }
\score {
<<
\new Staff = "upper" \with {
  printPartCombineTexts = ##f
}<<
\new Voice = "lead" {
\combined
}
\new NullVoice = "synch" {
  \melody
}
>>

   \new Lyrics \with { alignAboveContext = "staff" } {
   \lyricsto "synch" { \words }
}
>>
\layout {
}
}
}



Carl

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


Re: Lyrics in polyphony with ties in second voice

2019-09-30 Thread Knute Snortum
I'm not sure why you'd want that, but oh well...

%%% Start
\version "2.19.83"

words = \lyricmode {
  One, two and three four
}

melody = \relative c'' {
  \time 3/4
  g2. |
  g8 a f2 ~ |
  2. |
  e2.
  \bar "|."
}

harmony = \relative c' {
  \time 3/4
  \voiceOne
  s2. |
  2. _~ |
  2. |
  s2.
  \bar "|."
}

\score {
  <<
\new Staff = "upper" {
  <<
\new Voice = "lead" {
  \melody
}
\new Voice = "harmony" {
  \harmony
}
  >>
}
\new Lyrics \with { alignAboveContext = "staff" } {
  \lyricsto "lead" { \words }
}
  >>
  \layout {
  }
}
%%% End

At some magnifications, the stems don't seem exactly aligned.  Maybe
someone else can fix that.
---
Knute Snortum
(via Gmail)


On Mon, Sep 30, 2019 at 3:40 PM Flaming Hakama by Elaine <
ela...@flaminghakama.com> wrote:

>
>
> On Mon, Sep 30, 2019 at 7:57 AM Knute Snortum  wrote:
>
>> Here's one way to do it:
>>
>> %%% Start
>> \version "2.19.83"
>>
>> words = \lyricmode {
>>   One, two and three four
>> }
>>
>> melody = \relative c'' {
>>   \time 3/4
>>   g2. |
>>   g8 a f2 ~ |
>>   2. |
>>   e2.
>>   \bar "|."
>> }
>>
>> harmony = \relative c' {
>>   \time 3/4
>>   \voiceTwo
>>   s2. |
>>   2. ~ |
>>   2. |
>>   s2.
>>   \bar "|."
>> }
>>
>> \score {
>>   <<
>> \new Staff = "upper" {
>>   <<
>> \new Voice = "lead" {
>>   \melody
>> }
>> \new Voice = "harmony" {
>>   \harmony
>> }
>>   >>
>> }
>> \new Lyrics \with { alignAboveContext = "staff" } {
>>   \lyricsto "lead" { \words }
>> }
>>   >>
>>   \layout {
>>   }
>> }
>> %%% End
>>
>> ---
>> Knute Snortum
>> (via Gmail)
>>
>>
>
> Thanks for the help.
>
> This approach puts the melody and harmony voices into different columns,
> with different stems.
> Is there any way to get them to become realigned, and share stems?
>
>
> Elaine Alt
> 415 . 341 .4954   "*Confusion is
> highly underrated*"
> ela...@flaminghakama.com
> Producer ~ Composer ~ Instrumentalist ~ Educator
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Snippet for aligning markup inside another markup

2019-09-30 Thread Kieren MacMillan
Hi Aaron,

> Here's my take:

Nice work!
This should be part of the base distro, IMO.

Thanks,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Lyrics in polyphony with ties in second voice

2019-09-30 Thread Flaming Hakama by Elaine
On Mon, Sep 30, 2019 at 7:57 AM Knute Snortum  wrote:

> Here's one way to do it:
>
> %%% Start
> \version "2.19.83"
>
> words = \lyricmode {
>   One, two and three four
> }
>
> melody = \relative c'' {
>   \time 3/4
>   g2. |
>   g8 a f2 ~ |
>   2. |
>   e2.
>   \bar "|."
> }
>
> harmony = \relative c' {
>   \time 3/4
>   \voiceTwo
>   s2. |
>   2. ~ |
>   2. |
>   s2.
>   \bar "|."
> }
>
> \score {
>   <<
> \new Staff = "upper" {
>   <<
> \new Voice = "lead" {
>   \melody
> }
> \new Voice = "harmony" {
>   \harmony
> }
>   >>
> }
> \new Lyrics \with { alignAboveContext = "staff" } {
>   \lyricsto "lead" { \words }
> }
>   >>
>   \layout {
>   }
> }
> %%% End
>
> ---
> Knute Snortum
> (via Gmail)
>
>

Thanks for the help.

This approach puts the melody and harmony voices into different columns,
with different stems.
Is there any way to get them to become realigned, and share stems?


Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
Producer ~ Composer ~ Instrumentalist ~ Educator
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Input syntax question

2019-09-30 Thread Aaron Hill

On 2019-09-30 5:18 am, foxfanfare wrote:

Aaron Hill wrote

Whether it is prudent to do such a thing is another matter.  (:


That's interesting, because I find very complicated to deal with 
variables
without any digits... especially when composing multiple pieces works. 
But

why would for instance \"01" not be safe?


Well, I was commenting more on the use of syntactic elements and emoji 
within the name.


I use letters (e.g. ChorusA, ChorusB) and Roman numerals (e.g. StanzaI, 
StanzaII) when naming variables, to avoid the need to use actual numbers 
that could be confused for durations.  So far, it seems to work well.


That said, I have considered switching to quoted names in a few special 
cases, since "Psalm 146" renders better than PsalmCXLVI.



-- Aaron Hill

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


Re: Snippet for aligning markup inside another markup

2019-09-30 Thread Aaron Hill

On 2019-09-30 6:18 am, Kieren MacMillan wrote:

Hi Michael,

for a project of mine I wanted to center a markup inside another 
markup.
I searched the built-in markup functions, but to no avail. (Surely it 
is

possible that I missed something...)


This is *almost* it, right?

%%%  SNIPPET ENDS
\version "2.19.83"

boxone = \markup \with-color #blue \filled-box #'(0 . 6) #'(0 . 6) #0
boxtwo = \markup \with-color #red \filled-box #'(3 . 5) #'(5 . 7) #0

\markup \combine \halign #0 \boxone \halign #0 \boxtwo
%%%  SNIPPET ENDS

I may be wrong, but I’m thinking there’s some relatively simple
incantation which would take it to the goal line.
Hopefully someone out there more knowledgeable than I will help.


Here's my take:


\version "2.19.83"

#(define-markup-command (centered-overlay layout props args)
  (markup-list?)
  (ly:stencil-aligned-to
(interpret-markup layout props #{ \markup \halign #LEFT \overlay {
  #@(map (lambda (m) #{ \markup \vcenter \halign #CENTER $m #}) 
args) } #})

Y DOWN))

boxone = \markup \with-color #yellow \filled-box #'(0 . 6) #'(0 . 6) #0
boxtwo = \markup \with-color #green \filled-box #'(3 . 5) #'(5 . 7) #0

\markup {
  "\centered-overlay:"
  \centered-overlay { \boxone "1" }
  \centered-overlay { \boxtwo "2" }
  \centered-overlay { \boxone \boxtwo "1+2" }
}



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


Re: Lyrics in polyphony with ties in second voice

2019-09-30 Thread Knute Snortum
Here's one way to do it:

%%% Start
\version "2.19.83"

words = \lyricmode {
  One, two and three four
}

melody = \relative c'' {
  \time 3/4
  g2. |
  g8 a f2 ~ |
  2. |
  e2.
  \bar "|."
}

harmony = \relative c' {
  \time 3/4
  \voiceTwo
  s2. |
  2. ~ |
  2. |
  s2.
  \bar "|."
}

\score {
  <<
\new Staff = "upper" {
  <<
\new Voice = "lead" {
  \melody
}
\new Voice = "harmony" {
  \harmony
}
  >>
}
\new Lyrics \with { alignAboveContext = "staff" } {
  \lyricsto "lead" { \words }
}
  >>
  \layout {
  }
}
%%% End

---
Knute Snortum
(via Gmail)


On Sun, Sep 29, 2019 at 8:42 PM Flaming Hakama by Elaine <
ela...@flaminghakama.com> wrote:

>
> Hi.
>
> I'm hoping someone can help me figure out how to notate this.
>
> I am creating a lead sheet that has vocal line with lyrics.  Some sections
> have just the melody, and other sections have harmonies under the melody.
>
> In general, I have been having success using this pattern for going into
> and out of polyphony, while keeping the lyrics associated with the melody:
>
> melody = \relative c'' {
> c1 << { \voiceOne d } { b1 } >> | \oneVoice e1 |
> }
>
>
> However, there is one phrase where I can't figure out how to make it work,
> which is when the second voice contains ties.
>
> What I'm after is like the second score--except there should be ties
> between the chords in the second voice in bars 2-3.
> Alternately, like the music in example 6, except with lyrics in the 2nd &
> 3rd bars.
>
>
>
> \version "2.19.80"
>
> words = \lyricmode {
> One, two and three four
> }
>
> melody = \relative c'' {
> \time 3/4
> g2.^"1. Just melody - missing harmony" | g8 a f2 ~ | 2. | e2. \bar "|."
> }
>
> melodyHarmonizedNoTies = \relative c'' {
> \time 3/4
> g2.^"2. Harmonized, no ties: missing ties in voice 2"
> <<
> \relative c'' { \voiceOne g8 a f2 ~ | 2. }
> \relative c' { 2. | 2. }
> >> | \oneVoice
> e2.
> \bar "|."
> }
>
>
> melodyHarmonizedWithTies = \relative c'' {
> \time 3/4
> g2.^"3. Harmonized with ties: lyrics do not follow voice 1, and ties
> are missing in voice 2"
> <<
> \relative c'' { \voiceOne g8 a f2 ~ | 2. }
> \relative c' { 2. ~ | 2. }
> >> | \oneVoice
> e2.
> \bar "|."
> }
>
> melodyHarmonizedLV = \relative c'' {
> \time 3/4
> g2.^"4. Harmonized, LV in voice 2: Extra LV in voice 1"
> <<
> \relative c'' { \voiceOne g8 a f2 ~ | 2. }
> \relative c' { 2. \laissezVibrer | 2. }
> >> | \oneVoice
> e2.
> \bar "|."
> }
>
>
> melodyHarmonizedSlashNoTies = \relative c'' {
> \time 3/4
> g2.^"5. Slash, no ties: missing lyrics in voice 1 and missing ties in
> voice 2"
> <<
> \relative c'' { \voiceOne g8 a f2 ~ | 2. } \\
> \relative c' { 2. | 2. }
> >> | \oneVoice
> e2.
> \bar "|."
> }
>
>
> melodyHarmonizedSlashWithTies = \relative c'' {
> \time 3/4
> g2.^"6. Slash with ties: lyrics do not follow voice 1"
> <<
> \relative c'' { \voiceOne g8 a f2 ~ | 2. } \\
> \relative c' { 2. ~ | 2. }
> >> | \oneVoice
> e2.
> \bar "|."
> }
>
> melodyHarmonizedSlashLV = \relative c'' {
> \time 3/4
> g2.^"7. Slash, LV in voice 2: lyrics do not follow voice 1"
> <<
> \relative c'' { \voiceOne g8 a f2 ~ | 2. } \\
> \relative c' { 2. \laissezVibrer | 2. }
> >> | \oneVoice
> e2.
> \bar "|."
> }
>
>
>
> \book {
> \header { title = "MWE: lyrics in voice 1 with tied notes in voice 2"
> }
> \score {
> <<
> \new Staff = "upper" {
> \new Voice = "lead" {
> \melody
> }
> }
> \new Lyrics \with { alignAboveContext = "staff" } {
> \lyricsto "lead" { \words }
> }
> >>
> \layout {
> }
> }
>
> \score {
> <<
> \new Staff = "upper" {
> \new Voice = "lead" {
> \melodyHarmonizedNoTies
> }
> }
> \new Lyrics \with { alignAboveContext = "staff" } {
> \lyricsto "lead" { \words }
> }
> >>
> \layout {
> }
> }
>
> \score {
> <<
> \new Staff = "upper" {
> \new Voice = "lead" {
> \melodyHarmonizedWithTies
> }
> }
> \new Lyrics \with { alignAboveContext = "staff" } {
> \lyricsto "lead" { \words }
> }
> >>
> \layout {
> }
> }
>
>
> \score {
> <<
> \new Staff = "upper" {
> \new Voice = "lead" {
> \melodyHarmonizedLV
> }
> }
> \new Lyrics \with { alignAboveContext = "staff" } {
> \lyricsto "lead" { \words }
> 

Re: Input syntax question

2019-09-30 Thread David Kastrup
msk...@ansuz.sooke.bc.ca writes:

> On Mon, 30 Sep 2019, David Kastrup wrote:
>> The respective lines in lily/lexer.ll read
>>
>> A[a-zA-Z\200-\377]
>> SYMBOL   {A}([-_]{A}|{A})*
>> COMMAND  \\{SYMBOL}
>
> Interesting that this disagrees with the item from the Notation Reference
> cited elsewhere in the thread, which says hyphens and underscores aren't
> allowed.

It has changed (for good reason) in the course of LilyPond's history.
As the change author, I thought to have documented this change as it
happened, but I have been neither able to find a documentation of the
current state nor a documentation of the previous state when I looked
now.  Obviously someone else was able to find a documentation of the
previous state.

So the documentation would likely warrant amending.  The state of "every
non-ASCII character is as good as a letter" is not explicitly documented
but it's not obvious that this comparatively simple rule is one that may
not at some point of time be further changed.  So that the documentation
remains silent on non-ASCII characters is more or less intentional.

-- 
David Kastrup

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


Re: Input syntax question

2019-09-30 Thread mskala
On Mon, 30 Sep 2019, David Kastrup wrote:
> The respective lines in lily/lexer.ll read
>
> A [a-zA-Z\200-\377]
> SYMBOL{A}([-_]{A}|{A})*
> COMMAND   \\{SYMBOL}

Interesting that this disagrees with the item from the Notation Reference
cited elsewhere in the thread, which says hyphens and underscores aren't
allowed.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/

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


Re: Snippet for aligning markup inside another markup

2019-09-30 Thread Kieren MacMillan
Hi Michael,

> for a project of mine I wanted to center a markup inside another markup.
> I searched the built-in markup functions, but to no avail. (Surely it is
> possible that I missed something...)

This is *almost* it, right?

%%%  SNIPPET ENDS
\version "2.19.83"

boxone = \markup \with-color #blue \filled-box #'(0 . 6) #'(0 . 6) #0
boxtwo = \markup \with-color #red \filled-box #'(3 . 5) #'(5 . 7) #0

\markup \combine \halign #0 \boxone \halign #0 \boxtwo
%%%  SNIPPET ENDS

I may be wrong, but I’m thinking there’s some relatively simple incantation 
which would take it to the goal line.
Hopefully someone out there more knowledgeable than I will help.

Cheers,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Input syntax question

2019-09-30 Thread David Kastrup
msk...@ansuz.sooke.bc.ca writes:

> What characters are allowed in variable names?

Cannot find it after a short search.  The basic rule is that any
combination of upper- or lowercase letters as well as non-ASCII
characters (so Unicode characters with a character code larger than
127), with isolated - and _ characters allowed inside.

The respective lines in lily/lexer.ll read

A   [a-zA-Z\200-\377]
SYMBOL  {A}([-_]{A}|{A})*
COMMAND \\{SYMBOL}

-- 
David Kastrup

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


Re: Input syntax question

2019-09-30 Thread foxfanfare
Aaron Hill wrote
> Whether it is prudent to do such a thing is another matter.  (:

That's interesting, because I find very complicated to deal with variables
without any digits... especially when composing multiple pieces works. But
why would for instance \"01" not be safe?




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Snippet for aligning markup inside another markup

2019-09-30 Thread Michael Käppler

Hi folks,
for a project of mine I wanted to center a markup inside another markup.
I searched the built-in markup functions, but to no avail. (Surely it is
possible that I missed something...)
So I came up with the following code. Feel free to test and comment it.
Maybe it is possible in an easier way, though.
Would this kind of stuff fit into the LSR?

Best regards,
Michael

% Align src-markup inside dest-markup and merge stencils
% xdir = -1 aligns left edges, 1 right edges
% ydir = -1 aligns bottom edges, 1 top edges
% Values between -1 and 1 are interpolated

#(define-markup-command (align-inside layout props xdir ydir src-markup
dest-markup)
   (number? number? markup? markup?)
   (let* ((src-stil (interpret-markup layout props src-markup))
  (dest-stil (interpret-markup layout props dest-markup))

  (src-x-extent (ly:stencil-extent src-stil X))
  (src-y-extent (ly:stencil-extent src-stil Y))
  (src-x-center (interval-center src-x-extent))
  (src-y-center (interval-center src-y-extent))
  (src-width (interval-length src-x-extent))
  (src-height (interval-length src-y-extent))

  (dest-x-extent (ly:stencil-extent dest-stil X))
  (dest-y-extent (ly:stencil-extent dest-stil Y))
  (dest-x-center (interval-center dest-x-extent))
  (dest-y-center (interval-center dest-y-extent))
  (dest-width (interval-length dest-x-extent))
  (dest-height (interval-length dest-y-extent))

  (offset-x-centered (- dest-x-center src-x-center))
  (offset-y-centered (- dest-y-center src-y-center))
  (offset-dir (cons (+ offset-x-centered (* xdir 0.5 (-
dest-width src-width)))
 (+ offset-y-centered (* ydir 0.5 (-
dest-height src-height))

 (ly:stencil-add dest-stil (ly:stencil-translate src-stil
offset-dir

boxone = \markup \with-color #blue \filled-box #'(0 . 6) #'(0 . 6) #0
boxtwo = \markup \with-color #red \filled-box #'(3 . 5) #'(5 . 7) #0

\markup \align-inside #CENTER #CENTER \boxtwo \boxone
\markup \align-inside #LEFT #0.5 \boxtwo \boxone
\markup \align-inside #RIGHT #DOWN \boxtwo \boxone

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


Re: Input syntax question

2019-09-30 Thread Vaughan McAlley
On Mon, 30 Sep 2019 at 15:39, David Wright 
wrote:
> Has a LilyPond obfuscation contest ever been held? :)

\score #( blah blah) % output of \displayMusic

...would be a promising start

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